简体   繁体   English

Tomcat 7上的Spring应用程序问题

[英]Spring app on Tomcat 7 problems

When I start my app localy with embeded tomcat 7 everything is working fine. 当我使用嵌入的tomcat 7在本地启动应用程序时,一切正常。 But when I deploy to the remote machine with tomcat7:redeploy (maven plugin) I have problems with the part of the application. 但是,当我使用tomcat7:redeploy(Maven插件)部署到远程计算机时,我的应用程序部分出现了问题。 App starts fine and parts of it are working, but when I send XML package to the app it throws this exception : 应用启动正常,并且部分运行正常,但是当我将XML包发送到应用时,它将引发此异常:

 ERROR o.s.i.handler.LoggingHandler - org.springframework.integration.transformer.MessageTransformationException: org.springframework.messaging.MessageHandlingException: java.lang.IllegalStateException: Cannot process message
        at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:74)
        at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:170)
        at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
        at org.springframework.integration.endpoint.PollingConsumer.handleMessage(PollingConsumer.java:74)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint.doPoll(AbstractPollingEndpoint.java:202)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint.access$000(AbstractPollingEndpoint.java:52)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:143)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:278)
        at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:50)
        at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
        at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:272)
        at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
        at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)
Caused by: org.springframework.messaging.MessageHandlingException: java.lang.IllegalStateException: Cannot process message
        at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:78)
        at org.springframework.integration.transformer.AbstractMessageProcessingTransformer.transform(AbstractMessageProcessingTransformer.java:64)
        at org.springframework.integration.transformer.MessageTransformingHandler.handleRequestMessage(MessageTransformingHandler.java:68)
        ... 22 more
Caused by: java.lang.IllegalStateException: Cannot process message
        at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:284)
        at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:142)
        at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:75)
        ... 24 more
Caused by: java.lang.NoSuchMethodError: org.springframework.xml.transform.TraxUtils.isStaxSource(Ljavax/xml/transform/Source;)Z
        at org.springframework.oxm.AbstractMarshaller.unmarshal(AbstractMarshaller.java:124)
        at com.mozzartbet.joker.api.udp.UDPTransformer.transform(UDPTransformer.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:63)
        at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:122)
        at org.springframework.expression.spel.ast.MethodReference.access$000(MethodReference.java:44)
        at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:258)
        at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84)
        at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:114)
        at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:111)
        at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:159)
        at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:268)
        ... 26 more

Version of the java on both machines is the same 1.6.45, and there is only this webapp on the remote tomcat instance. 两台机器上的Java版本是相同的1.6.45,并且远程tomcat实例上只有此webapp。 I tried playing with the endorsed dir but with no success. 我尝试使用认可的目录,但没有成功。

This is the root cause: 这是根本原因:

Caused by: java.lang.NoSuchMethodError: org.springframework.xml.transform.TraxUtils.isStaxSource(Ljavax/xml/transform/Source;)Z
        at org.springframework.oxm.AbstractMarshaller.unmarshal(AbstractMarshaller.java:124)

I'm guessing that there's a conflict between the Spring version of the JAR and the one that ships with Tomcat. 我猜想JAR的春季版本与Tomcat附带的版本之间存在冲突。 Tomcat's server class loader finds their version first and doesn't have the method that Spring needs. Tomcat的服务器类加载器首先找到其版本,并且没有Spring所需的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM