Apache camel 在bean上找不到名为sayHi的方法-使用ApacheCamel
我使用apachecamel与部署在weblogicserver12c中的远程EJB通信。当我调用远程EJB时,它抛出以下异常Apache camel 在bean上找不到名为sayHi的方法-使用ApacheCamel,apache-camel,Apache Camel,我使用apachecamel与部署在weblogicserver12c中的远程EJB通信。当我调用远程EJB时,它抛出以下异常 org.apache.camel.component.bean.MethodNotFoundException:在bean:ClusterableRemoteRef(39619051234449960886s:192.168.1.98:[70017001,-1,-1,-1,-1]:weblogic:AdminServer[39619051234449960886s:19
org.apache.camel.component.bean.MethodNotFoundException:在bean:ClusterableRemoteRef(39619051234449960886s:192.168.1.98:[70017001,-1,-1,-1,-1]:weblogic:AdminServer[39619051234449960886s:192.168.1.98:[70017001,-1]:weblogic:AdminServer/394])/394类型:com.iexceed.study.HelloRemoteEJBImpl_6zix6y_IHelloRemoteEJBImpl_12120_WLStub。交换[消息:[正文为空]]
我的come-context.xml文件如下
<bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
<property name="properties" ref="jndiProperties" />
</bean>
<util:properties id="jndiProperties">
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://IPADDRESS:PORT</prop>
<prop key="java.naming.security.principal">weblogic</prop>
<prop key="java.naming.security.credentials">Weblogic@01</prop>
</util:properties>
<camelContext id="camelclient" xmlns="http://camel.apache.org/schema/spring">
<template id="template" />
<endpoint id="camelejb" uri="ejb:EJBRemoteModule-1_0-SNAPSHOTEJBRemoteModule-1_0-SNAPSHOT_jarHelloRemoteEJBImpl_IHelloRemoteEJB?method=sayHi"/>
<route>
<from uri="direct:start_0" />
<to uri="camelejb" />
</route>
</camelContext>
EJB:
不知道为什么在EJB中提供该方法时会抛出此错误。
我真的会发自内心地感激,因为我已经在汤里了。下面代码的结果是什么
getUriMap().get("camelejb")
如果要引用驼峰路由中的端点,应执行以下操作
<endpoint id="endpoint1" uri="direct:start"/>
<endpoint id="endpoint2" uri="mock:end"/>
<route>
<from ref="endpoint1"/>
<to uri="ref:endpoint2"/>
</route>
我抵制住了说“你不要汤!!”的诱惑。无论如何,为了真诚地提供帮助,我可以问一下-您的IHelloRemoteEJB接口是否通过OSGI正确导出?我没有使用OSGI。它是一个简单的Maven EJB模块,并在Weblogic.Endpoint中部署了JAR文件[ejb://EJBRemoteModule-1_0-SNAPSHOTEJBRemoteModule-1_0-SNAPSHOT_jarHelloRemoteEJBImpl_IHelloRemoteEJB?method=sayHi]. getUriMap()的Out put.get(“cameleEJB”)
getUriMap().get("camelejb")
<endpoint id="endpoint1" uri="direct:start"/>
<endpoint id="endpoint2" uri="mock:end"/>
<route>
<from ref="endpoint1"/>
<to uri="ref:endpoint2"/>
</route>