我正在尝试在我现有的 spring 4.3 web-mvc 应用程序中使用 Hibernate 4.3。
我的应用程序上下文中的 Beans。
<orcl:pooling-datasource id="dataSource" connection-properties-prefix="conn" properties-location="WEB-INF/orcl.properties"/>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
</bean>
在创建 sessionFactory
bean 时,spring bean 正在尝试解析 jtaplatform
并期望 Websphere 应用程序服务器特定的记录器类。
但有趣的是我在 tomcat 上运行我的应用程序,它没有那些 bootstrap.jar 或 websphere 的类。
我的问题是为什么我们需要 Websphere jar,我进入了 StandardJtaPlatformResolver
并发现最后一个可能的(如果是 else 或 try catch 方法)jta 提供程序将是 websphere。
不确定为什么我应该在这种情况下提供 jta 提供程序?
最佳答案
终于找到罪魁祸首了。很久以前这个应用程序在 websphere 服务器上运行,然后迁移到 jboss。
这个没用 jar 误导 hibernate 认为有可用的 websphere jtaplatform。
所以,删除这个垃圾 jar 解决了这个问题。
关于spring - Hibernate 4.3 需要 Websphere RASWsLoggerFactory 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39868057/