美好的一天....
我们正在开发一个项目,将J2EE应用程序从WAS 8.5迁移到JBOSS EAP 7.0,我们是JBOSS的新手。
应用程序包: 1)EAR(WAR和EJB) 2)Application Utility Jars和Persistence jar(实体类) 3)第三方jar像log4j2.5,Jackson,hibernate,
我们创建了名为sharedLib的文件夹并维护了sharedLib / main / module.xml
我们将所有Application Utility Jars,Persistence jar和第三方jar移动到shardLib模块。
<resource-root path="../SEC_BatchService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_DepartmentService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_LoginService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_MenuService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_ProcessesService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_SessionMaintenanceService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_SessionService_Contract-1.0.0.jar"/>
<resource-root path="../SecurityInterfaceServices_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserAuthoriser_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserMaintenanceService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserRole_Contract-1.0.0.jar"/>
<resource-root path="../SystemUtility_Contract-1.0.0.jar"/>
<resource-root path="../WorkFlow_Contract-1.0.0.jar"/>
<resource-root path="../Application_Contract-1.0.0.jar"/>
<resource-root path="../BootStrapService_Contract-1.0.0.jar"/>
<resource-root path="../Intergration_Contract-1.0.0.jar"/>
<resource-root path="../Logger_Contract-1.0.0.jar"/>
<resource-root path="../Persistence_Contract-1.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/Logger_Contract-1.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/antlr-2.7.7.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/btf-1.2.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/com.ibm.websphere.appserver.api.json-1.0.13.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/commons-codec-1.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/commons-httpclient-3.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/cors-filter-2.5.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/disruptor-3.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/dom4j-1.6.1.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/guava-19.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-commons-annotations-4.0.5.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-core-4.2.7.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-annotations-2.7.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-core-2.7.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-coreutils-1.8.jar"/>
And APP_EAR/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Dependencies: sharedLib
从EAR调用sharedLib模块文件时,我们没有遇到任何问题。但是驻留在sharedLib中的文件无法访问EAR的EJB jar。
示例WAR -----&gt; EJB - &GT; sharedLib(模块)很好 战争-----&gt; EJB1 - &GT; sharedLib ---&gt; EJB2.jar与NoClassDifferror失败。 (无法访问任何类型的EJB jar POJO类。)
我们可以从sharedLib(隔离模块)
调用EAR EJB Jar吗?错误:
流程:休息服务----&gt; EJB.jar ---&gt; EJB.jar ---&gt; sharedLib ---&gt; EJB
引起:java.lang.NoClassDefFoundError:scb / technical / bootstrap / process / SystemProperties ----------------(POJO类驻留在EJB JAR中)----- --------- 在scb.technical.security.service.util.SecurityUtility.convertDateToUserTZ(SecurityUtility.java:257)----------------------(POJO类驻留在sharedLib模块中) )---------------------- 在scb.technical.security.service.LoginServiceBean.validateLogin(LoginServiceBean.java:161)------------------------(SessionBean驻留在EJB JAR中) ---------------------------- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.invocation.InterceptorContext $ Invocation.proceed(InterceptorContext.java:437) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory $ 1.processInvocation(UserInterceptorFactory.java:63) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.invocation.InterceptorContext $ Invocation.proceed(InterceptorContext.java:437) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64) 在org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) 在org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) 在org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) 在org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) 在org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) 在org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) 在org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254) ......还剩212 引起:java.lang.ClassNotFoundException:来自本地模块加载器的[Module“sharedLib:main”的scb.technical.bootstrap.process.SystemProperties @ 66133adc(finder:local module finder @ 7bfcd12c(roots:/jboss/eap/7.0/) JBoss的-EAP /模块,/ JBoss的/ EAP / 7.0 / JBoss的-EAP /模块/系统/层/基层/ .overlays /层碱基的JBoss-EAP-7.0.6.CP,/ JBoss的/ EAP / 7.0 / JBoss的-EAP /模块/系统/层/基))]
服务器:JBOSS EAP 7.0
由于 Viswa ..