Temporary workaround for you would be usage of spring-jee namespace. With code shown below you just set ref="testJNDI" and you don't need any extra Java code.
<jee:jndi-lookup id="testJNDI" jndi-name="app/TestJNDI" expected-type="com.ge.camel.jndi.TestJNDI" /> Kind regards, Łukasz Dywicki -- [email protected] Twitter: ldywicki Blog: http://dywicki.pl Code-House - http://code-house.org Wiadomość napisana przez Claus Ibsen <[email protected]> w dniu 23 kwi 2014, o godz. 09:32: > Hi > > Camel's registry is a facade for an actual registry such as > - jndi > - spring's app context > - osgi service registry > > So the spring stuff is only registered in spring's own app context (eg > that is how spring works). So you cannot use jndi to lookup stuff that > are in spring's app context. > > But you can create a composite registry in Camel that lookup in jndi > and then spring afterwards. > But to do that you would need to write some java code to setup that, > etc. Not as easy and clean to do. > > > On Tue, Apr 22, 2014 at 3:36 PM, Jacinto, Alex (GE Energy Management) > <[email protected]> wrote: >> Is there a way I can make the two work? What happens is that when I do >> ApplicationContextRegistry but wants to access through jndi it won’t work, >> if I do the JndiRegistry, it would not resolve all my routeContextRef. My >> camel-context looks like: >> >> <routeContext id=“template" >> xmlns="http://camel.apache.org/schema/spring"> >> <route> >> <from uri=“vm:from" /> >> <bean ref=“java:app/TestJndi"/> >> <to uri=“vm:to" /> >> </route> >> </routeContext> >> >> >> <camelContext id=“id" xmlns="http://camel.apache.org/schema/spring"> >> <routeContextRef ref=“template" /> >> </camelContext> >> >> I would like to use camel simply for routing then use my beans for >> transformation. Am I going at this the wrong way? Let me know. Thanks in >> advance. >> >> Alex > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > Email: [email protected] > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen > hawtio: http://hawt.io/ > fabric8: http://fabric8.io/
