1

我试图启动部署在 WAS 8 控制台中的应用程序。我见过类似的问题,但无法理解我必须实施的解决方案。请帮我解决一下这个。我已经坚持很久了。

服务器特定的类加载器策略:多个服务器特定的类加载模式:父优先

EAR/WAR 类加载器策略 : 多个 EAR/WAR 类加载模式 : parent last

    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/CompoundClassLoader@197001c" of class "org/springframework/remoting/jaxws/LocalJaxWsServiceFactory" and loader "com/ibm/oti/vm/BootstrapClassLoader@753492c" 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)
4

1 回答 1

0

LinkageError 通常表明一个类对某个类的两个不同版本具有可见性,一个是直接的(通过它自己的类加载器),一个是间接的(通过其他的加载器)。这通常只有在“父最后”样式加载时才有可能,所以如果您不需要,切换类加载模式可能会奏效。一般来说,如果您没有使用“最后一个父级”的特定理由,则应避免使用它,因为它会与默认的 Java 类加载行为相混淆,并可能导致类似这样的问题。

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

于 2016-11-30T13:58:16.083 回答