[ 
https://issues.apache.org/jira/browse/CAMEL-5968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557066#comment-13557066
 ] 

Krishnan commented on CAMEL-5968:
---------------------------------

We'd then tried to load the classes(connectionfactory,desitinationresolver) 
invoking within the route's config method to resolve "Cause: 
JndiObjectTargetSource failed.."

private void initResolver() {
try { ConnectionFactory cf = (ConnectionFactory) 
getContext().getRegistry().lookup("jndiFactoryBean"); Connection con = 
cf.createConnection(); Session session = con.createSession(false, 
Session.AUTO_ACKNOWLEDGE); DestinationResolver resolver = (DestinationResolver) 
getContext().getRegistry().lookup("jndiDestinationResolver"); 
resolver.resolveDestinationName(session, "QueueBJNDI", false); session.close(); 
con.close(); } catch (JMSException e) { e.printStackTrace(); }
}

But this workaround is possible only when the server  <property name="cache" 
value="true" /> cache's enabled. Also when the server disconnects and 
reconnects (may be a shutdown or network issue), route doesn't work.
                
> ClassNotFoundException: weblogic.jndi.WLInitialContextFactory when starting 
> the route via Karaf start-route(camel:route-start) command.
> ---------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-5968
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5968
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-jms, karaf
>    Affects Versions: 2.9.2
>         Environment: Camel-core(2.9.2) in Karaf(2.2.6)
>            Reporter: Krishnan
>
> We have a simple camel route definied in Java DSL:
> from("wmq:queue:ESB_TEST_IN").routeId("IN").
> autoStartup(true).
> log("${body}");
> This route receives JMS messages from a WebLogicJMS queue with name 
> ESB_TEST_IN and logs the body to the log file.
> The route works fine when autoStartup is set to true. But when autoStartup is 
> set to false then the creation of the WebLogic InitialContext failed because 
> of an ClassNotFoundException regarding weblogic.jndi.WLInitialContextFactory 
> and the following message is written to the karaf log file:
> 2012-12-07 12:03:21,502 WARN : DefaultJmsMessageListenerContainer | Setup of 
> JMS message listener invoker failed for destination 'ESB_TEST_IN' - trying to 
> recover. Cause: Destination [ESB_TEST_IN] not found in JNDI; nested exception 
> is javax.naming.NoInitialContextException: Cannot instantiate class: 
> weblogic.jndi.WLInitialContextFactory [Root exception is 
> java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory] 
> [org.springframework.jms.listener.DefaultMessageListenerContainer | 
> mer[ESB_TEST_IN] | org.springframework.jms.3.0.7.RELEASE(id=135)]
> This issue's related to https://jira.talendforge.org/browse/TESB-7884

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to