JBoss war 部署

JBoss war deployment

抱歉 classes 被屏蔽了。

一个棘手的场景。

当它是耳朵的一部分时,这个 war 可以正常部署。但是当我尝试将其部署为单独的可部署实体时,它会闪烁此消息。它具有 'provided' 范围内所需的所有依赖项。我不确定 JBoss class 加载程序是否在不同的位置进行查找,而不是在加载耳朵时查找的位置。

2015-01-20 17:50:35,485 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-13) WELD-000119 Not generating any bean definitions from com.xxxx.yyy.services.dddd.zzzz.eeee.LoadedClass because of underlying class loading error
2015-01-20 17:50:35,485 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-13) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class com.xxxx.yyy.services.dddd.zzzz.eeee.LoadedClass
        at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:176) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.bootstrap.BeanDeployer.loadWeldClass(BeanDeployer.java:116) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:79) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:135) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:184) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:349) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:63) [jboss-as-weld-7.3.4.Final-redhat-1.jar:7.3.4.Final-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
Caused by: java.lang.NoClassDefFoundError: com/xxxx/yyy/services/dddd/zzzz/eeee/MyClass
        at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.7.0_60]
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2570) [rt.jar:1.7.0_60]
        at java.lang.Class.getDeclaredMethods(Class.java:1855) [rt.jar:1.7.0_60]
        at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:175) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.reflection.SecureReflections.work(SecureReflections.java:172) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:172) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:240) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:126) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.load(ClassTransformer.java:60) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.load(ClassTransformer.java:51) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3990)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878)
        at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:71) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:112) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:93) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:164) [weld-core-1.1.17.SP3-redhat-1.jar:1.1.17.SP3-redhat-1]
        ... 11 more
Caused by: java.lang.ClassNotFoundException: com.xxxx.yyy.services.dddd.zzzz.eeee.MyClassfrom [Module "deployment.blah-server-war-1.0.23-SNAPSHOT.war:main" from Service Module Loader]
        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]
        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]
        ... 34 more

感谢任何帮助。

War 内容如下所示。

Blahblah.War
|
---元信息
|
---WEB-INF----
| |
---index.htm |_____classes
|_____lib
|_____beans.xml
|_____faces-config.xml
|_____web.xml

如果将其部署到耳朵内时没有发生错误,则可能是您耳朵的 lib 文件夹提供了缺失的 class。

我建议将您耳朵的 lib 文件夹中包含的 jar 与 war 的 lib 中的进行比较。

也许您在 ear 中捆绑了另一个使用丢失的 jar 的应用程序,因此它被复制到您 ear 的 lib 文件夹中并使您的 war 部署。