我有一个spring(使用jsf1.2和hibernate)web应用程序,当我尝试在websphere8.5中运行它时,我得到以下异常,我无法调试
以下是错误堆栈跟踪:
com.ibm.ws.naming.util.CacheableReference@70bf45a1[super=Reference Class Name: javax.persistence.EntityManagerFactory
Type: JPAJndiLookupInfo
Content: PuId=3dsAcsFrontOfficeWeb_war#3dsAcsFrontOfficeWeb.war#3ds-acs-entityManager-pu, 3dsAcsFrontOfficeWeb_war#3dsAcsFrontOfficeWeb.war#persistence/3ds-acs-entityManager-pu, isFactory=true, isSFSB=false, , properties=[]
]
[27/01/16 10:18:27:872 WET] 0000008a FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: Incident FFDC émis sur C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\logs\ffdc\server1_22048ced_16.01.27_10.18.27.8516602842131953426877.txt com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated 1341
[27/01/16 10:18:27:872 WET] 0000008a webapp E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception interceptée lors de l''initialisation du contexte : {0}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [META-INF/cxf/cxf.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'txInterceptor' while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txInterceptor' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.ws.naming.util.CacheableReference' to required type 'javax.persistence.EntityManagerFactory' for property 'entityManagerFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.ws.naming.util.CacheableReference] to required type [javax.persistence.EntityManagerFactory] for property 'entityManagerFactory': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:722)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
...
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cxf' defined in class path resource [META-INF/cxf/cxf.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot resolve reference to bean 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0' while setting bean property 'transactionAttributeSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'txInterceptor' while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txInterceptor' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/PC-S2M4Node01Cell/3dsAcsFrontOfficeWeb_war.ear/3dsAcsFrontOfficeWeb.war/WEB-INF/lib/3ds-acs-front-office-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.ibm.ws.naming.util.CacheableReference' to required type 'javax.persistence.EntityManagerFactory' for property 'entityManagerFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.ibm.ws.naming.util.CacheableReference] to required type [javax.persistence.EntityManagerFactory] for property 'entityManagerFactory': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
at org.apache.cxf.bus.spring.BusExtensionPostProcessor.getBus(BusExtensionPostProcessor.java:62)
at org.apache.cxf.bus.spring.BusExtensionPostProcessor.postProcessBeforeInitialization(BusExtensionPostProcessor.java:53)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
... 114 more
我的 web.xml 中添加了以下代码:
<resource-ref>
<res-ref-name>jdbc/acs_3ds_websphere_db</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<persistence-unit-ref>
<persistence-unit-ref-name>persistence/3ds-acs-entityManager-pu</persistence-unit-ref-name>
<persistence-unit-name>3ds-acs-entityManager-pu</persistence-unit-name>
</persistence-unit-ref>
在我的 application-context.xml 中,我有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<!-- <bean id="entityManagerFactory" class="javax.persistence.Persistence" factory-method="createEntityManagerFactory">
<constructor-arg type="java.lang.String" value="3ds-acs-back-entityManager-pu" />
</bean> -->
<jee:jndi-lookup id="datasource" jndi-name="jdbc/acs_3ds_websphere_db" cache="true" resource-ref="true" lookup-on-startup="false"
proxy-interface="javax.sql.DataSource"/>
<jee:jndi-lookup id="entityManagerFactory" jndi-name="persistence/3ds-acs-entityManager-pu" />
<bean id="transactionManager"
class="org.springframework.transaction.jta.WebSphereUowTransactionManager"/>
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
</beans>
对于我的 persistence.xml ,我有:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="3ds-acs-entityManager-pu" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:comp/env/jdbc/acs_3ds_websphere_db</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory" />
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform" />
<property name="hibernate.transaction.flush_before_completion" value="true" />
<property name="hibernate.transaction.auto_close_session" value="true" />
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.query.substitutions" value="true 'Y', false 'N'" />
<property name="hibernate.cache.use_second_level_cache" value="true" />
</properties>
</persistence-unit>
</persistence>
我还添加了一个文件WEB-INF / ibm-web-bnd.xml ,其中包含:
<?xml version="1.0" encoding="UTF-8"?>
<web-bnd
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_2.xsd"
version="1.2">
<virtual-host name="default_host" />
<resource-ref name="jdbc/acs_3ds_websphere_db" binding-name="jdbc/acs_3ds_websphere_db" />
</web-bnd>
我被困在这里超过两天