camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor NO√čL <>
Subject Bug in createRegistry of DefaultCamelContext?
Date Wed, 29 Apr 2015 10:08:40 GMT

I have been trying to programmatically register an object in the 
registry and I got the following exception:
javax.naming.NoInitialContextException: Need to specify class name in 
environment or system property, or as an applet parameter, or in an 
application resource file:  java.naming.factory.initial
     at org.apache.camel.impl.JndiRegistry.bind(

The line in my code called is:

The problem is that according to the code of getRegistry, if an initial 
context can be created, then camel would fallback to the SimpleFactory 

Apparently, this code fails to do so because the JNDI registry fails not 
when the context is created but when bind is called!

I guess this is not the desired behaviour of getRegistry, is it?

On a side note: am I wrong to try to register something in the registry 
like that programmatically? Is there a different way of registering 
things in the registry?
My initial objective was to able to inject an object to a camel 
component without passing it as a constructor argument.

Thank you


View raw message