Spring 原因:org.hibernate.HibernateException:未找到当前线程的会话

Spring 原因:org.hibernate.HibernateException:未找到当前线程的会话,spring,hibernate,Spring,Hibernate,我有一个Hibernate项目作为CoreServices,具有所有Hibernate配置。我已经在我的另一个项目中导入了项目jar,但是我得到了 由以下原因导致的错误:org.hibernate.HibernateException:未找到任何会话 对于当前线程 **********型号 ${hibernate.dial} ${hibernate.show_sql:false} ${hibernate.format_sql:false} 我假设相关代码标记有“@Transaction”注释,

我有一个Hibernate项目作为CoreServices,具有所有Hibernate配置。我已经在我的另一个项目中导入了项目jar,但是我得到了

由以下原因导致的错误:org.hibernate.HibernateException:未找到任何会话 对于当前线程


**********型号
${hibernate.dial}
${hibernate.show_sql:false}
${hibernate.format_sql:false}

我假设相关代码标记有“@Transaction”注释,对吗?可能是:Hi@jenschauder的副本是的,代码标记有Transaction,但唯一的问题是它是一个不同的项目,所有hibernate DAO和服务都可以访问该DAO。我已经在我的项目中包含了jar,但是我得到了org.hibernate.HibernateException:没有找到当前线程的会话我找到了根本原因。发生这种情况是因为用于日志记录的AOP类。有人对此有什么想法吗?嗨,当我打开AOP logger类时,我得到的原因是:org.hibernate.HibernateException:找不到当前线程的会话
    <context:property-placeholder location="classpath:application.properties" />
    <context:annotation-config />
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="${jdbc.driverClassName}" />
    <property name="url" value="${jdbc.url}" />
    <property name="username" value="${jdbc.username}" />
    <property name="password" value="${jdbc.password}" />
</bean>
<bean id="sessionFactory"
    class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="packagesToScan">
        <list>
            <value>****.******.model</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.show_sql">${hibernate.show_sql:false}</prop>
            <prop key="hibernate.format_sql">${hibernate.format_sql:false}</prop>
        </props>
    </property>
</bean>
<bean id="transactionManager"
    class="org.springframework.orm.hibernate4.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="persistenceExceptionTranslationPostProcessor"
    class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />