javajmsweblogic12cwildfly-8

Unable to perform JNDI lookup in WebLogic 12 server from JBoss Wildfly 8


I am trying to put a message in JMS queue in WebLogic server. My application is running in Wildfly 8 AS. I have written the code for the JNDI lookup and then putting message in JMS queue. I am using the following code for initializing the InitialContext:

private static InitialContext getInitialContext(String url) throws NamingException {
        Hashtable<String, String> env = new Hashtable<>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
        env.put(Context.PROVIDER_URL, url);
        return new InitialContext(env);
    }

I have added the following Maven dependencies for adding the WebLogic jar

<dependency>
        <groupId>weblogic</groupId>
        <artifactId>weblogic</artifactId>
        <version>12.2.1</version>
    </dependency>
    <dependency>
        <groupId>weblogic</groupId>
        <artifactId>webservices</artifactId>
        <version>12.2.1</version>
    </dependency>

But the maven dependencies are not getting resolved. Do I need to add any maven repository?

If anything else is required, can anyone please guide me on that?

Regards, Anirban.


Solution

  • Weblogic does not provide client jar artifact in maven repository. You must get the wlthint3client.jar located in the WL_HOME\server\lib directory of your weblogic server. This jar contains all classes needed by clients calling the weblogic server.

    Then you can install it manually in your maven repository and use it as a maven dependency in your pom.xml

    Finally, you can lookup the InitialContext using the weblogic.jndi.WLInitialContextFactory factory.