我在查找ejb后调用异常并调用它的方法..我正在将jboss4.2.3升级为wildfly
参见堆栈跟踪:---
ERROR [org.apache.struts.actions.DispatchAction] (default task-41) Dispatch[/submitActivityForm] to method 'showDetails' returned an exception: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274) [struts-1.0.jar:1.2.7]
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194) [struts-1.0.jar:1.2.7]
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) [struts-1.0.jar:1.2.7]
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) [struts-1.0.jar:1.2.7]
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) [struts-1.0.jar:1.2.7]
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) [struts-1.0.jar:1.2.7]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at com.tzaconsulting.ptw.filter.SecurityFilter.doFilter(SecurityFilter.java:75) [ptw-common-1.jar:]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
引起:java.lang.LinkageError:加载器约束违规:解析接口方法" com.tzaconsulting.ptw.maintenance.ejb.activity.ActivityBusiness.showDetails(Ljava / lang / String;)Lcom / tzaconsulting / PTW /维护/普通/ PO /活动;"当前类的类加载器(org / jboss / modules / ModuleClassLoader的实例),com / tzaconsulting / ptw / maintenance / web / delegate / ActivityDelegate,以及用于解析的类加载器(org / jboss / modules / ModuleClassLoader的实例) class,com / tzaconsulting / ptw / maintenance / ejb / activity / ActivityBusiness,对于ctivityBusiness.showDetails类型有不同的Class对象(Ljava / lang / String;)Lcom / tzaconsulting / ptw / maintenance / common / po / Activity;用于签名 在com.tzaconsulting.ptw.maintenance.web.delegate.ActivityDelegate.getCurrentActivity(ActivityDelegate.java:240)[classes:] 在com.tzaconsulting.ptw.maintenance.web.action.ActivityDispatchAction.showDetails(ActivityDispatchAction.java:626)[classes:] ... 43更多
答案 0 :(得分:0)
我还完成了从4.2.2到野外的迁移,容器的行为也不同。
在4中你有统一的类加载,这意味着一切只有一个类加载器。听起来你可以从任何地方加载每个类。每个应用程序都有一个不同的类加载器,以便您获得链接错误。
解决方案是在不同的应用程序之间设置依赖关系,你应该没问题。
顺便说一句:根据您的项目布局,它可能会导致更大的重构。