2016-11-30 113 views
1

我试图启动我的应用程序部署在WAS 8控制台中。我已经看到过类似的问题,但无法理解我必须实施的解决方案。请帮我解决一下这个。我坚持了很久。IBM websphere 8.0中的嵌套异常BeanCreationException java.lang.LinkageError

服务器特定的类加载器策略:多 服务器特定的类加载模式:家长首先

EAR/WAR类装入器策略:多 EAR/WAR类加载模式:父最后

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'soapFinsService' defined in class path resource [springcontext/api_third_party_beans.xml]: Invocation of init method failed; nested exception is java.lang.LinkageError: loading constraint violation when resolving method "javax/xml/ws/Service.create(Ljava/net/URL;Ljavax/xml/namespace/QName;)Ljavax/xml/ws/Service;" : loader "com/ibm/ws/classloader/[email protected]" of class "org/springframework/remoting/jaxws/LocalJaxWsServiceFactory" and loader "com/ibm/oti/vm/[email protected]" of class "javax/xml/ws/Service" have different types for the method signature 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) 
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) 
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) 
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) 
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) 
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) 
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) 
at org.jboss.resteasy.plugins.spring.SpringContextLoaderListener.contextInitialized(SpringContextLoaderListener.java:48) 
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1649) 
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410) 
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88) 
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169) 
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:748) 
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:633) 
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422) 
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714) 
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1134) 

回答

0

一LinkageError通常表示一个类可以看到某个类的两个不同版本,一个直接(通过它自己的类加载器)和一个间接(通过其他加载器)。这通常只适用于“父亲最后”风格的加载,所以如果你不需要,切换类加载模式可能会诀窍。一般来说,如果您没有特定的原因使用“最后一个父母”,应该避免它,因为它会使用默认的Java类加载行为混淆,并可能导致类似这样的问题。

根据错误消息,我猜想重复可见性类是javax.xml.namespace.QName类。您是否有理由在应用程序中打包XML API? WAS的JDK中包含了Xerces的副本,因此除非您对XML提供者有一些特殊之处,否则实际上不太可能需要这样做。如果您确实需要“最后一个父母”,那么删除包含XML API的jar也可能会解决问题。