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 E63F66BE3 for ; Thu, 16 Jun 2011 20:09:23 +0000 (UTC) Received: (qmail 76205 invoked by uid 500); 16 Jun 2011 20:09:23 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 76164 invoked by uid 500); 16 Jun 2011 20:09:23 -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 76156 invoked by uid 99); 16 Jun 2011 20:09:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 20:09:23 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of cmoulliard@gmail.com designates 74.125.83.173 as permitted sender) Received: from [74.125.83.173] (HELO mail-pv0-f173.google.com) (74.125.83.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jun 2011 20:09:19 +0000 Received: by pvg3 with SMTP id 3so1545233pvg.32 for ; Thu, 16 Jun 2011 13:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=RbxY9w2lzbxSEt9Y9k+hDlIEtCzvxpJigsK8MSNe0g4=; b=wfXpM64YeKok1LWVPwshEATpCagPOVct6hBJ06w1YZEBbNrnGi1L/0RvZ2h2s/a93N 4PIW1/XqBBW978Kni/Xi0fe68z1mQieINrsGe8mzClkLSgvw3rWOWhmfblp/BimOURfT xfXPZrPlDLOHmxVQHlb0N9nM9QOyUiMRjaq/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KQg5hco/AU15YGjr09enJdrTTJ1Sw0OIG6k+kyQURPvpKkeevBAH5Okg3ZpxxWfz8s 7tYKUEj3ScVZza2/OGZsVLqGQaHTEY61bHqUxAPO0L7hCbNvI8bmXUpYEpUVddkR+NAt 0OJF+fi6il04IWY5X5Ap8VjvpQGMnEuzqQoqs= MIME-Version: 1.0 Received: by 10.142.155.17 with SMTP id c17mr274225wfe.217.1308254938839; Thu, 16 Jun 2011 13:08:58 -0700 (PDT) Received: by 10.143.7.5 with HTTP; Thu, 16 Jun 2011 13:08:58 -0700 (PDT) In-Reply-To: References: Date: Thu, 16 Jun 2011 22:08:58 +0200 Message-ID: Subject: Re: Error with camel-ejb From: Charles Moulliard To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I progress. If I create a camel bean processor containing the code to setup initial context and cal openEJB, i get this error now 21:53:49,737 | ERROR | foo | DefaultErrorHandler | ache.camel.processor.CamelLogger 232 | 55 - org.apache.camel.camel-core - 2.8.0.SNAPSHOT | Failed delivery for exchangeId: ID-biker-chm-local-61842-1308253897457-1-17. Exhausted after delivery attempt: 1 caught: java.lang.IllegalArgumentException: interface org.apache.openejb.client.EJBObjectProxy is not visible from class loader java.lang.IllegalArgumentException: interface org.apache.openejb.client.EJBObjectProxy is not visible from class loader at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)[:1.6.0_24] at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)[:1.6.0_24] at org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk1= 3ProxyFactory.java:118)[66:org.apache.openejb.client:4.0.0.SNAPSHOT] at org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyMana= ger.java:107)[66:org.apache.openejb.client:4.0.0.SNAPSHOT] at org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObje= ctHandler.java:126)[66:org.apache.openejb.client:4.0.0.SNAPSHOT] at org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.= java:191)[66:org.apache.openejb.client:4.0.0.SNAPSHOT] at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)[66:o= rg.apache.openejb.client:4.0.0.SNAPSHOT] at javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_24] at org.apache.camel.example.remote.ejb.EJBClientBean.process(EJBClientBean= .java:41)[69:org.apache.camel.camel-example-remote-ejb:2.8.0.SNAPSHOT] at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso= rImpl.java:25)[:1.6.0_24] at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24] at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:328)[= 55:org.apache.camel.camel-core:2.8.0.SNAPSHOT] at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:23= 0)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT] at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.jav= a:161)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT] On Thu, Jun 16, 2011 at 8:55 PM, Romain Manni-Bucau wrote: > were you able to check properties? > > i think there are ignored if you are not in testing envt. > > - Romain > > 2011/6/16 Charles Moulliard > >> I have created a camel-example-remote-ejb project containing a test >> case with a remote EJB deployed on openEJB and that works fine using >> InitialContext with the properties provided in my first email. So the >> project + remote EJB is in order. This is the camel + jndi in OSGI >> container where we have a problem. >> >> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau >> wrote: >> > Charles, which part of code do you think is not working? >> > >> > I never tried the camel-ejb component in OSGi but i did openejb remote >> > client in servicemix and it works fine and camel doesn't add anything = on >> it, >> > just a way to get a bean not the initial context. >> > >> > Can you just check your properties are used and if it is the case can = you >> > try a manual client? >> > >> > I think i had some issues reading system.properties or jndi.properties >> with >> > camel in a non osgi envt some weeks ago (that's why i used spring to d= o >> the >> > lookup). >> > >> > - Romain >> > >> > 2011/6/16 Charles Moulliard >> > >> >> The camel route has been deployed using deploy dir of servicemix and >> >> DynamicImport package is enable. I have also installed the openEJB >> >> client jar and wrapped it. So everything is in place >> >> >> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau >> >> wrote: >> >> > oh you are in an OSGi container? >> >> > >> >> > for openejb you have to import package org.apache.openejb.client an= d >> >> > org.apache.openejb.client.proxy i think or something like that (i >> don't >> >> > really remember). >> >> > >> >> > - Romain >> >> > >> >> > 2011/6/16 Charles Moulliard >> >> > >> >> >> I think that the code that we use to create the endpoint works fin= e >> in >> >> >> a non osgi environment but not on osgi as jndi is not really >> supported >> >> >> >> >> >> =A0 =A0@Override >> >> >> =A0 =A0protected Endpoint createEndpoint(String uri, String remain= ing, >> >> >> Map parameters) throws Exception { >> >> >> =A0 =A0 =A0 =A0BeanEndpoint answer =3D new BeanEndpoint(uri, this)= ; >> >> >> =A0 =A0 =A0 =A0answer.setBeanName(remaining); >> >> >> >> >> >> =A0 =A0 =A0 =A0// plugin registry to lookup in jndi for the EJBs >> >> >> =A0 =A0 =A0 =A0Registry registry =3D new JndiRegistry(getContext()= ); >> >> >> =A0 =A0 =A0 =A0answer.setBeanHolder(new EjbRegistryBean(registry, >> >> >> getCamelContext(), answer.getBeanName())); >> >> >> >> >> >> =A0 =A0 =A0 =A0Processor processor =3D answer.getProcessor(); >> >> >> =A0 =A0 =A0 =A0setProperties(processor, parameters); >> >> >> =A0 =A0 =A0 =A0return answer; >> >> >> =A0 =A0 } >> >> >> >> >> >> >> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau >> >> >> wrote: >> >> >> > Hi, >> >> >> > >> >> >> > creating a list with spring should work but i think the problem = is >> the >> >> >> > context creation here. >> >> >> > >> >> >> > personnaly i use the bean component and i ask to me (with java d= sl) >> or >> >> >> > spring to do the lookup to put it in the camel registry. >> >> >> > >> >> >> > - Romain >> >> >> > >> >> >> > 2011/6/15 Charles Moulliard >> >> >> > >> >> >> >> Hi, >> >> >> >> >> >> >> >> I try to use openejb from camel using camel-ejb but get this er= ror >> >> >> >> when camel looks to find the ejb stateless bean >> >> >> >> >> >> >> >> > >> >> >> =A0 =A0 =A0 xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-insta= nce" >> >> >> >> =A0 =A0 =A0 xmlns:p=3D"http://www.springframework.org/schema/ut= il" >> >> >> >> =A0 =A0 =A0 xsi:schemaLocation=3D" >> >> >> >> =A0 =A0 =A0 http://www.springframework.org/schema/beans >> >> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd >> >> >> >> =A0 =A0 =A0 http://www.springframework.org/schema/util >> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd >> >> >> >> =A0 =A0 =A0 http://camel.apache.org/schema/spring >> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd"> >> >> >> >> >> >> >> >> =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 4 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= 3 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0 =A0 =A0>> Result : ${body}"/> >> >> >> >> =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 >> >> >> >> >> >> >> >> =A0 =A0 >> >> >> >> =A0 =A0> >> class=3D"org.apache.camel.component.ejb.EjbComponent"> >> >> >> >> =A0 =A0 =A0 =A0 >> >> >> >> =A0 =A0 >> >> >> >> >> >> >> >> =A0 =A0 >> >> >> >> =A0 =A0 >> >> >> >> =A0 =A0 =A0 =A0> >> >> >> >> >> >> >> >> >> key=3D"java.naming.factory.initial">org.apache.openejb.client.RemoteInit= ialContextFactory >> >> >> >> =A0 =A0 =A0 =A0ejbd://12= 7.0.0.1:4201 >> >> >> >> >> >> >> =A0 =A0 =A0 =A0dan= iel >> >> >> >> =A0 =A0 =A0 =A0> key=3D"java.naming.security.credentials">password >> >> >> >> =A0 =A0 >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> 23:12:32,227 | ERROR | foo =A0 =A0 =A0 =A0 =A0 =A0 =A0| Default= ErrorHandler >> >> >> >> =A0 =A0| ache.camel.processor.CamelLogger =A0232 | 64 - >> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for >> exchangeId: >> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after >> delivery >> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bea= n >> >> could >> >> >> >> be found in the registry for: CalculatorImplRemote >> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in >> the >> >> >> >> registry for: CalculatorImplRemote >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:6= 8)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java= :84)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.= java:103)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java= :74)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.jav= a:102)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java= :72)[64:org.apache.camel.camel-core:2.7.0] >> >> >> >> =A0 =A0 =A0 =A0at >> >> >> >> >> >> >> >> >> >> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToA= syncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apa= che.camel.camel-core:2.7.0] >> >> >> >> >> >> >> >> >> >> >> >> How can we define using tag the following two paramet= ers >> to >> >> >> >> call the method sum of the stateless ejb CalculatorRemote ? >> >> >> >> >> >> >> >> =A0 =A0public int sum(int add1, int add2); >> >> >> >> >> >> >> >> >> >> >> >> =A0??? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> Regards, >> >> >> >> >> >> >> >> Charles Moulliard >> >> >> >> >> >> >> >> Apache Committer >> >> >> >> >> >> >> >> Blog : http://cmoulliard.blogspot.com >> >> >> >> Twitter : http://twitter.com/cmoulliard >> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard >> >> >> >> Skype: cmoulliard >> >> >> >> >> >> >> > >> >> >> >> >> > >> >> >> > >> >