4 Replies Latest reply on May 14, 2012 8:32 PM by Tom B

    What jar files are required to lookup weblogic connection factory

      What jar files are required to use jars:

      import javax.naming.*;
      import javax.jms.*;

      I am basically trying to lookup the connection factory created in weblogic 10g. Found the following code but could not execute, seems missing some runtime jars.

      Please suggest.

      Sample code snippet trying:

      public static void sendMessage(String url, String user, String password,
      String cf, String queue, String messageText) { 
      // create InitialContext
      Context ctx = null;
      Hashtable ht = new Hashtable();
      ht.put(Context.PROVIDER_URL, "t3://localhost:7101");
      ht.put(Context.SECURITY_PRINCIPAL, user);
      ht.put(Context.SECURITY_CREDENTIALS, password);

      System.out.println("Getting context");
      try {
      ctx = new InitialContext(ht);
      System.out.println("Context: "+ctx);
      // Use the context in your program
      catch (NamingException e) {
      // a failure occurred
      finally {
      try {ctx.close();}
      catch (Exception e) {
      // a failure occurred