我正在从JBoss 5迁移 - > JBoss 7并且根据https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7,战争的WEB-INF / lib中打包的本地资源应该在部署间依赖性之前加载。
在我的WEB-INF / lib目录中,我有wss4j(版本1.5.7)库jar,其中包含Transform.init()方法。
部署应用程序并运行后,我收到以下错误。
ERROR [org.apache.catalina.core.ContainerBase [jboss.web] [缺省主机]。[/]。[RestEasy的]] (http - 127.0.0.1-8080-1)servlet的Servlet.service()Resteasy扔了 异常:org.jboss.resteasy.spi.UnhandledException: java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V 在org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [RestEasy的-JAXRS-2.3.2.Final.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [RestEasy的-JAXRS-2.3.2.Final.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [RestEasy的-JAXRS-2.3.2.Final.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [RestEasy的-JAXRS-2.3.2.Final.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [JBoss的-servlet的api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [JBoss的-AS-web的7.1.1.Final.jar:7.1.1.Final] 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:] 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:] 在org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:] 在org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:] 在org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:] at java.lang.Thread.run(Thread.java:722)[rt.jar:1.7.0_05]引起:java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V 在org.apache.ws.security.WSSConfig。(WSSConfig.java:81)[wss4j-1.5.2.jar:] 在org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:95) [WSS4J-1.5.2.jar:] 在org.apache.ws.security.WSSConfig。(WSSConfig.java:47) [WSS4J-1.5.2.jar:] 在org.apache.ws.security.WSSecurityEngine。(WSSecurityEngine.java:51) [WSS4J-1.5.2.jar:] 在org.apache.ws.security.handler.WSHandler。(WSHandler.java:62) [WSS4J-1.5.2.jar:] at java.lang.Class.forName0(Native Method)[rt.jar:1.7.0_05] at java.lang.Class.forName(Class.java:264)[rt.jar:1.7.0_05] 在org.apache.axis.utils.ClassUtils $ 2.run(ClassUtils.java:177)[axis-1.4.jar:] at java.security.AccessController.doPrivileged(Native Method)[rt.jar:1.7.0_05] at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160) [轴-1.4.jar:] at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100) [轴-1.4.jar:] 在org.apache.axis.deployment.wsdd.WSDDDeployableItem.getJavaClass(WSDDDeployableItem.java:353) [轴-1.4.jar:] at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:295) [轴-1.4.jar:] at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274) [轴-1.4.jar:] at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260) [轴-1.4.jar:] 在org.apache.axis.deployment.wsdd.WSDDChain.makeNewInstance(WSDDChain.java:125) [轴-1.4.jar:] at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274) [轴-1.4.jar:] at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260) [轴-1.4.jar:] 在org.apache.axis.deployment.wsdd.WSDDDeployment.getGlobalRequest(WSDDDeployment.java:473) [轴-1.4.jar:] 在org.apache.axis.configuration.FileProvider.getGlobalRequest(FileProvider.java:269) [轴-1.4.jar:] 在org.apache.axis.AxisEngine.getGlobalRequest(AxisEngine.java:365) [轴-1.4.jar:] 在org.apache.axis.client.AxisClient.invoke(AxisClient.java:126) [轴-1.4.jar:] 在org.apache.axis.client.Call.invokeEngine(Call.java:2784)[axis-1.4.jar:] 在org.apache.axis.client.Call.invoke(Call.java:2767)[axis-1.4.jar:] 在org.apache.axis.client.Call.invoke(Call.java:2443)[axis-1.4.jar:] 在org.apache.axis.client.Call.invoke(Call.java:2366)[axis-1.4.jar:] 在org.apache.axis.client.Call.invoke(Call.java:1812)[axis-1.4.jar:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[rt.jar:1.7.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar中:1.7.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar中:1.7.0_05] 在java.lang.reflect.Method.invoke(Method.java:601)[rt.jar:1.7.0_05] 在org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [RestEasy的-JAXRS-2.3.2.Final.jar:] 在org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [RestEasy的-JAXRS-2.3.2.Final.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [RestEasy的-JAXRS-2.3.2.Final.jar:] ......还有19个
答案 0 :(得分:1)
从我能找到的信息来看,似乎该方法在版本1.4之后的xmlsec中不可用。您可以尝试使用旧版本的jar,例如:
http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/santuario/xmlsec/1.4.2/xmlsec-1.4.2.jar
答案 1 :(得分:0)
我发现了同样的问题,我解决了它在META-INF / jboss-deployment-structure.xml中设置以下JBoss的部署排除(在7.1.1中):
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>true</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="deployment.javaee.api" />
</dependencies>
<exclusions>
<module name="javaee.api" />
</exclusions>
</deployment>
<module name="deployment.javaee.api">
<dependencies>
<module name="javaee.api" export="true">
<imports>
<exclude path="org/apache/xml/security/**" />
</imports>
</module>
</dependencies>
</module>
</jboss-deployment-structure>