0

We are facing a strange issue.

We are having a web application with spring and hibernate persistence. We are facing issue while deploying our application on Jboss with below error

Caused by: org.hibernate.HibernateException: Could not instantiate connection provider [org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider]
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:192) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:114) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.initiateService(ConnectionProviderInitiator.java:54) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    at org.hibernate.service.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:69) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    ... 37 more
Caused by: java.lang.ClassCastException: org.springframework.orm.hibernate3.TransactionAwareDataSourceConnectionProvider cannot be cast to org.hibernate.service.jdbc.connections.spi.ConnectionProvider
    at org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator.instantiateExplicitConnectionProvider(ConnectionProviderInitiator.java:189) [hibernate-core-4.1.9.Final.jar:4.1.9.Final]
    ... 41 more

Looks like it is conflicting with existing jar in jboss. SAme setup is working fine in windows but not working in linux server.

Please help.

4

1 回答 1

1

您正在将 Hibernate 4.1.9 与org.springframework.orm.hibernate3包中的类一起使用。你不应该。此包中的类必须与 Hibernate 3.x 一起使用。要将 Hibernate 4 与 Spring 一起使用,请使用org.springframework.orm.hibernate4包中的类。

于 2013-04-11T21:34:35.057 回答