当我在JBOSS EAP6.4中部署我的战争时,尽管我的类路径中有jackson-mapper-asl.1.9.2.jar并且设置为读取部署结构,但我得到以下错误
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="deploy" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
</dependencies>
</deployment>
</jboss-deployment-structure>
下面是日志堆栈
Thread-11733 2016-09-12 06:12:10,169 | WARN | session= | user= | org.hornetq.jms.client | HQ122001: Unhandled exception thrown from onMessage: java.lang.RuntimeException: java.lang.LinkageError: Failed to link com/sun/jersey/api/json/JSONWithPadding (Module "deploy:main" from local module loader @ed17bee (finder: local module finder @2a33fae0 (roots: /vend/hybris/jboss/jboss-eap-6.4/modules,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base/.overlays/BZ1281963,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base,/vend/hybris/OTMM16/Media-Manager/mediamanagement,/vend/hybris/OTMM16/Media-Manager/mediamanagement)))
at com.artesia.event.services.EventListenerManager$EventListenerWrapper.onMessage(EventListenerManager.java:101)
at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:98)
at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1117)
at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:57)
at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1252)
at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:105)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.LinkageError: Failed to link com/sun/jersey/api/json/JSONWithPadding (Module "deploy:main" from local module loader @ed17bee (finder: local module finder @2a33fae0 (roots: /vend/hybris/jboss/jboss-eap-6.4/modules,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base/.overlays/BZ1281963,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base,/vend/hybris/OTMM16/Media-Manager/mediamanagement,/vend/hybris/OTMM16/Media-Manager/mediamanagement)))
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:487)
at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:277)
at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:92)
at org.jboss.modules.Module.loadModuleClass(Module.java:568)
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.sun.jersey.core.reflection.MethodList.getAllDeclaredMethods(MethodList.java:70)
at com.sun.jersey.core.reflection.MethodList.<init>(MethodList.java:64)
at com.sun.jersey.core.spi.component.ComponentConstructor.getPostConstructMethods(ComponentConstructor.java:132)
at com.sun.jersey.core.spi.component.ComponentConstructor.<init>(ComponentConstructor.java:124)
at com.sun.jersey.core.spi.component.ProviderFactory.__getComponentProvider(ProviderFactory.java:165)
at com.sun.jersey.core.spi.component.ProviderFactory.getComponentProvider(ProviderFactory.java:137)
at com.sun.jersey.core.spi.component.ProviderServices.getComponent(ProviderServices.java:283)
at com.sun.jersey.core.spi.component.ProviderServices.getServices(ProviderServices.java:163)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.initWriters(MessageBodyFactory.java:207)
at com.sun.jersey.core.spi.factory.MessageBodyFactory.init(MessageBodyFactory.java:163)
at com.sun.jersey.api.client.Client.init(Client.java:343)
at com.sun.jersey.api.client.Client.access$000(Client.java:119)
at com.sun.jersey.api.client.Client$1.f(Client.java:192)
at com.sun.jersey.api.client.Client$1.f(Client.java:188)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.api.client.Client.<init>(Client.java:188)
at com.sun.jersey.api.client.Client.<init>(Client.java:171)
at com.microsoft.windowsazure.core.pipeline.jersey.Exports$3.create(Exports.java:81)
at com.microsoft.windowsazure.core.pipeline.jersey.Exports$3.create(Exports.java:65)
at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
at com.microsoft.windowsazure.core.DefaultBuilder$1.create(DefaultBuilder.java:138)
at com.microsoft.windowsazure.core.DefaultBuilder.build(DefaultBuilder.java:200)
at com.microsoft.windowsazure.Configuration.create(Configuration.java:119)
at com.microsoft.windowsazure.services.media.MediaService.create(MediaService.java:47)
at com.example.AzureAPIProxy.getMediaService(AzureAPIProxy.java:250)
at com.artesia.event.services.EventListenerManager$EventListenerWrapper.onMessage(EventListenerManager.java:85)
... 8 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonSerializableWithType
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361)
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482)
... 51 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonSerializableWithType from [Module "deploy:main" from local module loader @ed17bee (finder: local module finder @2a33fae0 (roots: /vend/hybris/jboss/jboss-eap-6.4/modules,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base/.overlays/BZ1281963,/vend/hybris/jboss/jboss-eap-6.4/modules/system/layers/base,/vend/hybris/OTMM16/Media-Manager/mediamanagement,/vend/hybris/OTMM16/Media-Manager/mediamanagement))]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
... 55 more
如何解决这个问题?
答案 0 :(得分:0)
似乎&#34;部署&#34;文件夹可能不在模块下的正确文件夹树级别。我还建议不要将其命名为&#34; deploy&#34;文件夹,以避免与实际部署混淆。
如果您希望在引用它的情况下使其工作,那么您的文件夹结构应该如下所示。
vend/hybris/jboss/jboss-eap-6.4/modules/deploy/main
。在此文件夹下,您应该有一个module.xml
文件以及对必要的罐子以及罐子本身的引用。
答案 1 :(得分:0)
我已通过向我的部署模块添加jar修复了此问题。看看是否有另一种方法可以解决这个问题,现在将jar添加到部署模块已经解决了这个问题。