Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 46FEF995A for ; Thu, 22 Mar 2012 14:44:18 +0000 (UTC) Received: (qmail 24119 invoked by uid 500); 22 Mar 2012 14:44:17 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 24084 invoked by uid 500); 22 Mar 2012 14:44:17 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 24075 invoked by uid 99); 22 Mar 2012 14:44:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 14:44:17 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.217.173 as permitted sender) Received: from [209.85.217.173] (HELO mail-lb0-f173.google.com) (209.85.217.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 14:44:13 +0000 Received: by lbon3 with SMTP id n3so2096913lbo.32 for ; Thu, 22 Mar 2012 07:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=DvqECE5fk8yJxfC+2VdadRzNa3Ssrr+yXQg6z0/rh98=; b=X8JjpqlgiUQf8I1h2viCIMU6i4IshUObw+vNTlO+CDSzYS0SBbUJBqE2QP51w0cAix vKi1pEnvLdVsRv5M+wUuDaO3Gri0klu2Msja2ZXfnN62EbEvzhN/w1yadU2I42dCSVA4 qr9Cb1roDfk9pSxrWUi2gqPCxl6ODvSzJYt4ZT24wOaRNyAfMEuKqob7ez/YdAB7On5s mjLQGL27Wjxu36NN7mu0XCTyhzbPlq+uJPLTbe3pj8ChGSMcSTY3ZVgtYEj5trHHRkap LeWSOXoddOjz4tycSAApHe2ArX6X4630SNHuaCya6b6HNYBxgXI/pCeYWJc5G3er/ydV QxTA== Received: by 10.112.11.5 with SMTP id m5mr2846823lbb.66.1332427432074; Thu, 22 Mar 2012 07:43:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.107.106 with HTTP; Thu, 22 Mar 2012 07:43:31 -0700 (PDT) In-Reply-To: <1332355196614-5583762.post@n5.nabble.com> References: <1332355196614-5583762.post@n5.nabble.com> From: Claus Ibsen Date: Thu, 22 Mar 2012 15:43:31 +0100 Message-ID: Subject: Re: EJB and RSS Component in JBoss 7 To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 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 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: cibsen@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/