Hi

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?
http://camel.apache.org/ejb

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 <add...@gmail.com> 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:http://sample.com/feed/?consumer.delay=30000";).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: 
> http://camel.465427.n5.nabble.com/EJB-and-RSS-Component-in-JBoss-7-tp5583762p5583762.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to