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:
On peut voir qu'il y a un probleme avec LocalSessionFactoryBean.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 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)
Celui-ci prend un fichier Configuration en argument. A mon avis il n'est pas correctement initialisé.
Pensez-vous qu'il puisse s'agir d'un problème de permission ? Faut-il configurer qqch de particuler pour hibernate sous websphere ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 <!-- 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>
Par contre je me demande si il n'y a pas qqch avec le security manager de websphere ...
Merci d'avance pour vos lumière
septentryon
Partager