Hi,
I have an application using hibernate and spring together.
All is fine when i use tomcat but when I deploy on websphere, I've got the following error:
The following exception was logged org.spr
ingframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping' defined in ServletContext resource [/WEB-INF/SPGMApp-servlet.xm
l]: Cannot resolve reference to bean 'hibernateInterceptor' while setting bean property 'interceptors'; nested exception is org.springframework.beans.factor
y.BeanCreationException: Error creating bean with name 'hibernateInterceptor' defined in ServletContext resource [/WEB-INF/SPGMApp-servlet.xml]: Cannot reso
lve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationExcep
tion: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/SPGMApp-servlet.xml]: Initialization of bean failed; neste
d exception is org.hibernate.HibernateException: Unable to copy listeners
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateInterceptor' defined in ServletContext resource [/WEB-INF/S
PGMApp-servlet.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework
.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/SPGMApp-servlet.xml]: Init
ialization of bean failed; nested exception is org.hibernate.HibernateException: Unable to copy listeners
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/SPGMApp
-servlet.xml]: Initialization of bean failed; nested exception is org.hibernate.HibernateException: Unable to copy listeners
org.hibernate.HibernateException: Unable to copy listeners
at org.hibernate.util.Cloneable.copyListeners(Cloneable.java:81)
at org.hibernate.util.Cloneable.access$000(Cloneable.java:18)
at org.hibernate.util.Cloneable$1.run(Cloneable.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at org.hibernate.util.Cloneable.shallowCopy(Cloneable.java:30)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1185)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:825)
--------------------------------------------------------------
We can see there is a problem with the LocalSessionFactoryBean.
Here is a part of the spring xml for configuration.
---------------------------------------------------------------
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="lobHandler">
<ref local="oracleLobHandler" />
</property>
<property name="mappingResources">
<list>
<value>com/business/spg/domain/Issue.hbm.xml</value>
<value>com/ebusiness/spg/ext/vo/File.hbm.xml</value>
<value>com/ebusiness/spg/ext/vo/FileType.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<prop key="show_sql">false</prop>
<prop key="cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/defaultdatasource</value>
</property>
</bean>
-------------------------------------------------------------
What kind of problem could it be ?
I tried to put was.policy with I found here :
http://www.hibernate.org/294.html
without success...
Thanks in advance
Septentryon