camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: EJB and RSS Component in JBoss 7
Date Thu, 22 Mar 2012 14:43:31 GMT

Sad to hear that using EJBs is still a **** in 2012.

Have you configured the EjbComponent to specify the JndiContext it
need to lookup the EJBs?

And in the old EJB days you needed to have container specific
deployment configuration files.
I assume this is no longer needed, but you never know if there is
something there you can do.

On Wed, Mar 21, 2012 at 7:39 PM, Adrianos  Dadis <> wrote:
> Hi all,
> I am trying to use RSS and EJB components together, inside new JBoss 7.1. I
> want the RSS component to consume some data from a real rss location and
> call an EJB with this data (using the EJB component).
> I have written 2 different routes that both of them call the same EJB, using
> its "name" value [@Stateless(name="MyEJBServiceImplName")].
> 1) SimpleRoute1:
> from("direct:myroute1").log("I got:
> ${body}").to("ejb:java:module/MyEJBServiceImplName?method=echo");
> 2) PollRoute2:
> from("rss:").log("I got:
> ${body}").to("ejb:java:module/MyEJBServiceImplName?method=echo");
> Both Camel context and EJB are in the same WAR. As you can see both Routes
> try to call the same EJB.
> I trigger SimpleRoute1, within another EJB, using the following code:
> myCamelContext.createProducerTemplate().requestBody("direct:myroute1", msg);
> This works and my "MyEJBServiceImplName" is called successfully.
> The PollRoute2 is triggered by itself as RSS component extends
> "ScheduledPollConsumer". This route fails with the following exception:
> org.apache.camel.NoSuchBeanException: No bean could be found in the registry
> for: java:module/MyEJBServiceImplName
> When SimpleRoute1 is invoked by another EJB, the JNDI Context contains the
> EJB that I want to call. But when PollRoute2 triggered, the JNDI Context
> does not contain the same EJB. Both Routes and both EJBs are in the same WAR
> file. The difference is that the first time the method
> "org.apache.camel.impl.JndiRegistry.createContext()" returns a JNDI Context
> that contains all the EJB of the WAR, but on the PollRoute2 case, the same
> method returns another Context that does NOT contain any EJB of the WAR.
> Do you have any idea why is this happening?
> The only thing that I suspect is the JBoss Modules, which have changed the
> Classloading procedure in JBoss.
> Notes: The prefix "java:module/" before EJB name ("
> java:module/MyEJBServiceImplName") is correct. This is how JBoss works.
> Environment:
> JDK: HotSpot 1.6.0_26
> Camel: 2.9
> JBoss AS: 7.1
> OS: GNU/Linux Debian wheezy
> Thanks in advance,
> Adrianos Dadis.
> --
> Democracy requires Free Software
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message