Apache Camel:通过JMX更新路由抛出org.omg.CORBA.BAD_PARAM

时间:2015-03-04 10:13:15

标签: weblogic apache-camel jmx jconsole

在Apache Camel上开发了一个小组件,作为多播器,将传入的消息转发到一组端点。

此组件在WebLogic服务器上运行。

版本详情:

  • JDK:1.6 / 1.7.0_75
  • Apache Camel:2.14.1
  • WebLogic:10.3.6

出现了一项新的要求,即在运行时修改目标端点集,而无需重建和重新部署组件。

第一个想法是使用Apache Camel提供的JMX功能来实现这一目标。

JConsole用作JMX客户端。

jconsole -J-Djava.class.path=%JAVA_HOME%\lib\jconsole.jar;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\wlfullclient.jar;%WL_HOME%\server\lib\wljmxclient.jar -debug

作为我们使用的连接字符串:

service:jmx:rmi:///jndi/iiop://localhost:7001/weblogic.management.mbeanservers.runtime

管理对象路由(see available docu)中的方法 updateRouteFromXML 似乎是此工作的正确方法。

为了测试此方法,首先调用 dumpRouteAsXml 以获取要以XML格式修改的路由的描述。

路线样本如下所示:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route customId="false" id="route7" xmlns="http://camel.apache.org/schema/spring">
<from uri="servlet:///TESTServer"/>
<convertBodyTo type="[B" id="convertBodyTo7"/>
<removeHeader headerName="CamelHttpPath" id="removeHeader7"/>
  <multicast parallelProcessing="true" timeout="3000" id="multicast7">
    <to uri="http://ip1:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to19"/>
    <to uri="http://ip2:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to20"/>
    <to uri="http://ip3:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to21"/>
  </multicast>
</route>

此xml用作 updateRouteFromXML 的输入:

<route customId="false" id="route7" xmlns="http://camel.apache.org/schema/spring">
<from uri="servlet:///TESTServer"/>
<convertBodyTo type="[B" id="convertBodyTo7"/>
<removeHeader headerName="CamelHttpPath" id="removeHeader7"/>
  <multicast parallelProcessing="true" timeout="3000" id="multicast7">
    <to uri="http://ip1:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to19"/>
    <to uri="http://ip2:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to20"/>
    <to uri="http://ip3:8007/IOCServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to21"/>
  </multicast>
</route>

我们尝试了几种变体(例如没有xml标题)。

但总是得到同样的例外:

在Jconsole中

org.omg.CORBA.MARSHAL: CORBA BAD_PARAM 0 No; nested exception is:
    org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No  vmcid: 0x0  minor code: 0  completed: No
    at weblogic.iiop.Utils.wrapMARSHALWithCause(Utils.java:906)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:2142)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:345)
    at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:70)
    at weblogic.iiop.InboundResponseImpl.unmarshalReturn(InboundResponseImpl.java:86)
    at weblogic.iiop.IIOPRemoteRef.invokeInternal(IIOPRemoteRef.java:232)
    at weblogic.iiop.IIOPRemoteRef.invoke(IIOPRemoteRef.java:161)
    at javax.management.remote.rmi.RMIConnection_IIOP_WLStub.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
    at sun.tools.jconsole.inspector.XMBean.invoke(XMBean.java:76)
    at sun.tools.jconsole.inspector.XOperations$1.doInBackground(XOperations.java:151)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:277)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at javax.swing.SwingWorker.run(SwingWorker.java:316)
    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: java.rmi.MarshalException: CORBA BAD_PARAM 0 No; nested exception is:
    org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at weblogic.iiop.Utils.mapSystemException(Utils.java:941)
    at weblogic.iiop.IIOPInputStream.readObject(IIOPInputStream.java:2791)
    at weblogic.utils.io.ObjectStreamClass.readFields(ObjectStreamClass.java:460)
    at weblogic.corba.utils.ValueHandlerImpl.readValueData(ValueHandlerImpl.java:294)
    at weblogic.corba.utils.ValueHandlerImpl.readValue(ValueHandlerImpl.java:93)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:2128)
    ... 16 more
Caused by: org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at weblogic.corba.idl.RemoteDelegateImpl.postInvoke(RemoteDelegateImpl.java:477)
    at weblogic.corba.idl.RemoteDelegateImpl.invoke(RemoteDelegateImpl.java:384)
    at weblogic.corba.idl.RemoteDelegateImpl.invoke(RemoteDelegateImpl.java:341)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
    at com.sun.org.omg.SendingContext._CodeBaseStub.meta(_CodeBaseStub.java:105)
    at com.sun.corba.se.impl.io.IIOPInputStream.getOrderedDescriptions(IIOPInputStream.java:1281)
    at com.sun.corba.se.impl.io.IIOPInputStream.skipObjectUsingFVD(IIOPInputStream.java:1635)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleSkipObject(IIOPInputStream.java:465)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:315)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:289)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:2154)
    at weblogic.iiop.IIOPInputStream.readObject(IIOPInputStream.java:2788)
    ... 20 more
Caused by: org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:357)
    at java.lang.Class.newInstance(Class.java:310)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:318)
    at weblogic.corba.idl.RemoteDelegateImpl.postInvoke(RemoteDelegateImpl.java:468)
    ... 31 more

在Weblogic域日志中

####<04-Mar-2015 09:18:47 o'clock GMT> <Warning> <RMI> <A06687> <AdminServer> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogi
c.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <563d78f4cf343dab:1b180373:14be40cba13:-8000-000000000000006d> <14254607271
31> <BEA-080003> <RuntimeException thrown by rmi server: weblogic.corba.cos.codebase.CodeBaseImpl.meta(Ljava.lang.String;)
 org.omg.CORBA.BAD_PARAM: Could not find FVD class for: RMI:org.apache.camel.FailedToCreateRouteException:8AC243E89C992A07:000
0000000000001  vmcid: 0x0  minor code: 0  completed: No.M
org.omg.CORBA.BAD_PARAM: Could not find FVD class for: RMI:org.apache.camel.FailedToCreateRouteException:8AC243E89C992A07:0000
000000000001  vmcid: 0x0  minor code: 0  completed: NoM
        at weblogic.corba.cos.codebase.CodeBaseImpl.meta(CodeBaseImpl.java:104)M
        at org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:94)M
        at weblogic.corba.idl.CorbaServerRef.invoke(CorbaServerRef.java:249)M
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)M
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)M
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)M
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)M
        at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)M
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)M
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)M
>

是否有人通过JMX成功调用 UpdateRouteFromXml

使用jdk1.7.0_75进行相同的错误测试

Weblogic域日志

####<04-Mar-2015 17:30:22 o'clock GMT> <Warning> <RMI> <A06687>
<AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <563d78f4cf343dab:3d01a2cd:14be5cdcdc4:-8000-0000000000000032> <14254902221 66><BEA-080003> <RuntimeException thrown by rmi server:weblogic.corba.cos.codebase.CodeBaseImpl.meta(Ljava.lang.String;)
 org.omg.CORBA.BAD_PARAM: Could not find FVD class for: RMI:org.apache.camel.FailedToCreateRouteException:8AC243E89C992A07:000
0000000000001  vmcid: 0x0  minor code: 0  completed: No.M
org.omg.CORBA.BAD_PARAM: Could not find FVD class for: RMI:org.apache.camel.FailedToCreateRouteException:8AC243E89C992A07:0000
000000000001  vmcid: 0x0  minor code: 0  completed: NoM
        at weblogic.corba.cos.codebase.CodeBaseImpl.meta(CodeBaseImpl.java:104)M
        at org.omg.SendingContext._CodeBaseImplBase._invoke(_CodeBaseImplBase.java:94)M
        at weblogic.corba.idl.CorbaServerRef.invoke(CorbaServerRef.java:249)M
        at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)M
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)M
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)M
        at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)M
        at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)M
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)M
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)M
>

JConsole日志

java.lang.SecurityException: Expecting a javax.management.remote.rmi.RMIServerImpl_Stub stub!
    at javax.management.remote.rmi.RMIConnector.checkStub(RMIConnector.java:1845)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:295)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
    at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:370)
    at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
    at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:292)
java.io.StreamCorruptedException: 
    at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2389)
    at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1580)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:414)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:2154)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:345)
    at weblogic.iiop.InboundResponseImpl.getThrowable(InboundResponseImpl.java:70)
    at weblogic.iiop.InboundResponseImpl.unmarshalReturn(InboundResponseImpl.java:86)
    at weblogic.iiop.IIOPRemoteRef.invokeInternal(IIOPRemoteRef.java:232)
    at weblogic.iiop.IIOPRemoteRef.invoke(IIOPRemoteRef.java:161)
    at javax.management.remote.rmi.RMIConnection_IIOP_WLStub.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1022)
    at sun.tools.jconsole.inspector.XMBean.invoke(XMBean.java:96)
    at sun.tools.jconsole.inspector.XOperations$1.doInBackground(XOperations.java:168)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at javax.swing.SwingWorker.run(SwingWorker.java:335)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at weblogic.corba.idl.RemoteDelegateImpl.postInvoke(RemoteDelegateImpl.java:477)
    at weblogic.corba.idl.RemoteDelegateImpl.invoke(RemoteDelegateImpl.java:384)
    at weblogic.corba.idl.RemoteDelegateImpl.invoke(RemoteDelegateImpl.java:341)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:475)
    at com.sun.org.omg.SendingContext._CodeBaseStub.meta(_CodeBaseStub.java:123)
    at com.sun.corba.se.impl.io.IIOPInputStream.getOrderedDescriptions(IIOPInputStream.java:1296)
    at com.sun.corba.se.impl.io.IIOPInputStream.skipObjectUsingFVD(IIOPInputStream.java:1650)
    at com.sun.corba.se.impl.io.IIOPInputStream.simpleSkipObject(IIOPInputStream.java:482)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:333)
    at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
    at weblogic.iiop.IIOPInputStream.read_value(IIOPInputStream.java:2154)
    at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1912)
    at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2335)
    ... 20 more
Caused by: org.omg.CORBA.BAD_PARAM:   vmcid: 0x0  minor code: 0  completed: No
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:379)
    at weblogic.iiop.ReplyMessage.getThrowable(ReplyMessage.java:318)
    at weblogic.corba.idl.RemoteDelegateImpl.postInvoke(RemoteDelegateImpl.java:468)
    ... 32 more

任何帮助都将不胜感激。

2 个答案:

答案 0 :(得分:1)

当WebLogic服务器在我的笔记本电脑上本地运行时,我尝试从JConsole进行本地连接(而不是远程连接),然后重新测试。 通过这样做我摆脱了CORBA错误,并且可以看到Camel抛出异常,但无法在客户端加载。

引起:java.lang.ClassNotFoundException:org.apache.camel.FailedToCreateRouteException(没有安全管理器:禁用RMI类加载器)

完整的堆栈跟踪:

java.lang.SecurityException: Expecting a javax.rmi.ssl.SslRMIClientSocketFactory RMI client socket factory in stub!
    at javax.management.remote.rmi.RMIConnector.checkStub(RMIConnector.java:1874)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:295)
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:268)
    at sun.tools.jconsole.ProxyClient.tryConnect(ProxyClient.java:357)
    at sun.tools.jconsole.ProxyClient.connect(ProxyClient.java:313)
    at sun.tools.jconsole.VMPanel$2.run(VMPanel.java:292)
java.rmi.UnmarshalException: Error unmarshaling return; nested exception is: 
    java.lang.ClassNotFoundException: org.apache.camel.FailedToCreateRouteException (no security manager: RMI class loader disabled)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:246)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
    at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl_Stub.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:1022)
    at sun.tools.jconsole.inspector.XMBean.invoke(XMBean.java:96)
    at sun.tools.jconsole.inspector.XOperations$1.doInBackground(XOperations.java:168)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at javax.swing.SwingWorker.run(SwingWorker.java:335)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.camel.FailedToCreateRouteException (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:393)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:185)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:214)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:244)
    ... 12 more

我向jConsole类路径添加了camel-core.jar:

jconsole -J-Djava.class.path=%JAVA_HOME%\lib\jconsole.jar;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\server\lib\wlfullclient.jar;%WL_HOME%\server\lib\wljmxclient.jar;%M2_HOME%\repository\org\apache\camel\camel-core\2.14.1\camel-core-2.14.1.jar -debug

再次重新测试:

用于测试的输入XML(实际上它是从 dumpRouteAsXml 输出的)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route customId="false" id="route1" xmlns="http://camel.apache.org/schema/spring">
    <from uri="servlet:///TESTServer"/>
    <convertBodyTo type="[B" id="convertBodyTo1"/>
    <removeHeader headerName="CamelHttpPath" id="removeHeader1"/>
    <multicast parallelProcessing="true" timeout="3000" id="multicast1">
        <to uri="http://ip-address1:6001/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to1"/>
        <to uri="http://ip-address2:6001/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to2"/>
        <to uri="http://ip-address3:6001/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to3"/>
    </multicast>
</route>

现在记录了Camel抛出的异常,我可以看到Route定义中存在错误。我不能简单地复制 dumpRouteAsXml 的输出并将其粘贴到 updateRouteFromXml

引起:java.lang.ClassNotFoundException:[B

完成堆栈跟踪:

org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> ConvertBodyTo[[B] <<< in route: Route(route1)[[From[servlet:///IOCVodaServer]] -> [ConvertBo... because of [B
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:945)
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:187)
    at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:805)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:2174)
    at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:739)
    at org.apache.camel.impl.DefaultCamelContext.addRouteDefinition(DefaultCamelContext.java:744)
    at org.apache.camel.management.mbean.ManagedRoute.updateRouteFromXml(ManagedRoute.java:262)
    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 sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
    at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
    at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1074)
    at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:955)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$16.run(WLSMBeanServerInterceptorBase.java:449)
    at java.security.AccessController.doPrivileged(Native Method)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:447)
    at weblogic.management.mbeanservers.internal.JMXContextInterceptor.invoke(JMXContextInterceptor.java:263)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$16.run(WLSMBeanServerInterceptorBase.java:449)
    at java.security.AccessController.doPrivileged(Native Method)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:447)
    at weblogic.management.mbeanservers.internal.SecurityInterceptor.invoke(SecurityInterceptor.java:444)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServer.invoke(WLSMBeanServer.java:323)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1360)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
    at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: [B
    at org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:53)
    at org.apache.camel.model.ConvertBodyDefinition.createProcessor(ConvertBodyDefinition.java:92)
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:942)
    ... 46 more

这个“[B”代表byte [] .class。您可以在下面看到以编程方式设置的实际配置。

from("servlet:///TESTServer")
    .convertBodyTo(byte[].class)
    .removeHeader(Exchange.HTTP_PATH)
    .multicast()
    .parallelProcessing()
    .timeout(3000)
    .to(eb.getEndpoints("DESTINATIONS1"))
.end();

一些试验和错误,我得到了正确的XML定义并成功调用了 updateRouteFromXml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<route customId="false" id="route3" xmlns="http://camel.apache.org/schema/spring">
    <from uri="servlet:///TESTServer"/>
    <convertBodyTo type="byte[]" id="convertBodyTo3"/>
    <removeHeader headerName="CamelHttpPath" id="removeHeader3"/>
    <multicast parallelProcessing="true" timeout="3000" id="multicast3">
        <to uri="http://ip-address1:9993/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to7"/>
        <to uri="http://ip-address2:9993/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to8"/>
        <to uri="http://ip-address3:9993/TARGETServer?bridgeEndpoint=true&amp;throwExceptionOnError=false" id="to9"/>
    </multicast>
</route>

谢谢和问候

答案 1 :(得分:0)

Apache Camel 2.14以后版本不支持Java 6。您需要使用Java 7或8。

请参阅发行说明的底部: