Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Method with name: sayHi not found on bean - Using apache Camel  RSS feed

Arthanarisamy Annamalai
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using apache camel to communicate to a remote EJB which is deployed in Weblogic Server 12c. when i invoke remote EJB it throws me the below exception org.apache.camel.component.bean.MethodNotFoundException: Method with name: sayHi not found on bean: ClusterableRemoteRef(3961905123449960886S:[7001,7001,-1,-1,-1,-1,-1]:weblogic:AdminServer [3961905123449960886S:[7001,7001,-1,-1,-1,-1,-1]:weblogic:AdminServer/394])/394 of type: Exchange[Message: [Body is null]]

My Came-context.xml file is as below

<bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
<property name="properties" ref="jndiProperties" />
<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="">weblogic</prop>
<prop key="">Weblogic@01</prop>
<camelContext id="camelclient" xmlns="">
<template id="template" />

<endpoint id="camelejb" uri="ejb:EJBRemoteModule-1_0-SNAPSHOTEJBRemoteModule-1_0-SNAPSHOT_jarHelloRemoteEJBImpl_IHelloRemoteEJB?method=sayHi"/>

<from uri="direct:start_0" />
<to uri="camelejb" />
and the java client class which i am using is

public void postRequest(){
try {
String camelID = "camelejb";
Exchange exchange = null;
Message msg = null;
System.out.println("Starting camel context.....");
ProducerTemplate template = springCamelContext.createProducerTemplate();
System.out.println("camelejb::::::" + getUriMap().get("camelejb"));
exchange = template.request(getUriMap().get(camelID), new Processor() {

public void process(Exchange exchng) throws Exception {
System.out.println("Exception:" + exchange.getException());
msg = exchange.getOut();

System.out.println("Message:" + msg);
System.out.println("Stopping Camel Context....");
} catch (Exception ex) {


public interface IHelloRemoteEJB {

public void sayHello(String name);

public void sayHi();
Having no clue why this error is thrown when the method is available in my EJB. Will be really grateful from heart because i am already in soup.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!