-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: [spring][hibernate]tomcat -> websphere
PostPosted: Thu Sep 28, 2006 4:04 am 
Newbie

Joined: Thu Sep 28, 2006 4:01 am
Posts: 8
Bonjour,

J'ai une application spring tourant sur tomcat.
Pas de problème jusque la. Mais lorsque je déplois sous websphere, j'obtiens l'erreur suivante:

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)



On peut voir qu'il y a un probleme avec LocalSessionFactoryBean.
Celui-ci prend un fichier Configuration en argument. A mon avis il n'est pas correctement initialisé.


<!-- Hibernate SessionFactory -->
<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>
<value>com/ebusiness/spg/ext/vo/FileCategory.hbm.xml</value>
<value>com/ebusiness/spg/domain/Category.hbm.xml</value>
<value>com/ebusiness/spg/domain/CategoryDocument.hbm.xml</value>
<value>com/ebusiness/spg/domain/Country.hbm.xml</value>
<value>com/ebusiness/spg/domain/Currency.hbm.xml</value>
<value>com/ebusiness/spg/domain/Context.hbm.xml</value>
<value>com/ebusiness/spg/domain/Language.hbm.xml</value>
<value>com/ebusiness/spg/domain/News.hbm.xml</value>
<value>com/ebusiness/spg/domain/ProductType.hbm.xml</value>
<value>com/ebusiness/spg/domain/RiskCategory.hbm.xml</value>
<value>com/ebusiness/spg/domain/UnderlyingType.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>

<prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
<!-- Echo all executed SQL to stdout -->
<prop key="show_sql">false</prop>
<prop key="cache.use_query_cache">true</prop>
<!-- Force to flush() after changes ?
<prop key="transaction.auto_close_session">false</prop> -->
<!-- Disable the second-level cache-->
<prop key="hibernate.cache.use_second_level_cache">false</prop>
<!-- Enable Hibernate's automatic session context management
<prop key="current_session_context_class">thread</prop>-->
<!-- JDBC connection pool (use the built-in)
<prop key="connection.pool_size">1</prop> -->
</props>
</property>
</bean>

<!-- Transaction manager for a single Hibernate SessionFactory -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
</bean>

<!-- Use this one under WebSphere 5 -->
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/defaultdatasource</value>
</property>
</bean>

Pensez-vous qu'il puisse s'agir d'un problème de permission ? Faut-il configurer qqch de particuler pour hibernate sous websphere ?
je viens d'ajouter la fichier was.policy dans le ear avec les infos que j'ai pu trouvé sur http://www.hibernate.org/294.html
Mais cela ne change rien au problème...
Merci d'avance pour vos lumière
septentryon


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 4:36 am 
Newbie

Joined: Thu Sep 28, 2006 4:01 am
Posts: 8
Par contre je me demande si il n'y a pas qqch avec le security manager de websphere ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.