Javax.naming.NameNotFoundException for foreign JMS Connection factory

I have a foreign jms server configured and when I try and test it I get a Name not found exception.
          javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms]; remaining name 'SSLQueueConnectionFactory'
          The config.xml looks ok
          <ForeignJMSServer
          ConnectionURL="ssl://eaid1-jms.ges.symantec.com:7243"
          JNDIProperties="" Name="JMS Proxy Dev" Targets="TeamWorksServer">
          <ForeignJMSConnectionFactory
          LocalJNDIName="jms.SSLQueueConnectionFactory"
          Name="MyForeign JMS Connection Factory"
          PasswordEncrypted="{3DES}Es94ikW1TZzBFyDp+3/gktRtDaHWI6j/"
          RemoteJNDIName="SSLQueueConnectionFactory" Username="weblogicUser"/>
          <ForeignJMSDestination LocalJNDIName="jms.WEBLOGIC.TEST.QUEUE"
          Name="MyForeign JMS Destination" RemoteJNDIName="WEBLOGIC.TEST.QUEUE"/>
          </ForeignJMSServer>
          The code i took from the QueueSend example
          package com.symantec.utils.jms;
          import java.io.BufferedReader;
          import java.io.IOException;
          import java.io.InputStreamReader;
          import java.util.Hashtable;
          import javax.jms.*;
          import javax.naming.Context;
          import javax.naming.InitialContext;
          import javax.naming.NamingException;
          /** This example shows how to establish a connection
          * and send messages to the JMS queue. The classes in this
          * package operate on the same JMS queue. Run the classes together to
          * witness messages being sent and received, and to browse the queue
          * for messages. The class is used to send messages to the queue.
          * @author Copyright (c) 1999-2006 by BEA Systems, Inc. All Rights Reserved.
          public class QueueSend
          // Defines the JNDI context factory.
          public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
          // Defines the JMS context factory.
          public final static String JMS_FACTORY="jms.SSLQueueConnectionFactory";
          // Defines the queue.
          public final static String QUEUE="WEBLOGIC.TEST.QUEUE";
          private QueueConnectionFactory qconFactory;
          private QueueConnection qcon;
          private QueueSession qsession;
          private QueueSender qsender;
          private Queue queue;
          private TextMessage msg;
          * Creates all the necessary objects for sending
          * messages to a JMS queue.
          * @param ctx JNDI initial context
          * @param queueName name of queue
          * @exception NamingException if operation cannot be performed
          * @exception JMSException if JMS fails to initialize due to internal error
          public void init(Context ctx, String queueName)
          throws NamingException, JMSException
          qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
          qcon = qconFactory.createQueueConnection();
          qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
          queue = (Queue) ctx.lookup(queueName);
          qsender = qsession.createSender(queue);
          msg = qsession.createTextMessage();
          qcon.start();
          * Sends a message to a JMS queue.
          * @param message message to be sent
          * @exception JMSException if JMS fails to send message due to internal error
          public void send(String message) throws JMSException {
          msg.setText(message);
          qsender.send(msg);
          * Closes JMS objects.
          * @exception JMSException if JMS fails to close objects due to internal error
          public void close() throws JMSException {
          qsender.close();
          qsession.close();
          qcon.close();
          private static void readAndSend(QueueSend qs)throws IOException, JMSException
               BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
          String line=null;
          boolean quitNow = false;
          do {
          System.out.print("Enter message (\"quit\" to quit): \n");
          line = msgStream.readLine();
          if (line != null && line.trim().length() != 0) {
          qs.send(line);
          System.out.println("JMS Message Sent: "+line+"\n");
          quitNow = line.equalsIgnoreCase("quit");
          } while (! quitNow);
          private static InitialContext getInitialContext(String url)
          throws NamingException
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
          env.put(Context.PROVIDER_URL, url);
          return new InitialContext(env);
          /** main() method.
          * @param args WebLogic Server URL
          * @exception Exception if operation fails
          public static void main(String[] args) throws Exception
          InitialContext ic = getInitialContext("t3://tus1bpmappdin01.ges.symantec.com:7501");
          QueueSend qs = new QueueSend();
          qs.init(ic, QUEUE);
          readAndSend(qs);
          qs.close();
          Any suggestions would be appreciated
          Regards

I have a foreign jms server configured and when I try and test it I get a Name not found exception.
          javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'jms.SSLQueueConnectionFactory' Resolved jms]; remaining name 'SSLQueueConnectionFactory'
          The config.xml looks ok
          <ForeignJMSServer
          ConnectionURL="ssl://eaid1-jms.ges.symantec.com:7243"
          JNDIProperties="" Name="JMS Proxy Dev" Targets="TeamWorksServer">
          <ForeignJMSConnectionFactory
          LocalJNDIName="jms.SSLQueueConnectionFactory"
          Name="MyForeign JMS Connection Factory"
          PasswordEncrypted="{3DES}Es94ikW1TZzBFyDp+3/gktRtDaHWI6j/"
          RemoteJNDIName="SSLQueueConnectionFactory" Username="weblogicUser"/>
          <ForeignJMSDestination LocalJNDIName="jms.WEBLOGIC.TEST.QUEUE"
          Name="MyForeign JMS Destination" RemoteJNDIName="WEBLOGIC.TEST.QUEUE"/>
          </ForeignJMSServer>
          The code i took from the QueueSend example
          package com.symantec.utils.jms;
          import java.io.BufferedReader;
          import java.io.IOException;
          import java.io.InputStreamReader;
          import java.util.Hashtable;
          import javax.jms.*;
          import javax.naming.Context;
          import javax.naming.InitialContext;
          import javax.naming.NamingException;
          /** This example shows how to establish a connection
          * and send messages to the JMS queue. The classes in this
          * package operate on the same JMS queue. Run the classes together to
          * witness messages being sent and received, and to browse the queue
          * for messages. The class is used to send messages to the queue.
          * @author Copyright (c) 1999-2006 by BEA Systems, Inc. All Rights Reserved.
          public class QueueSend
          // Defines the JNDI context factory.
          public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
          // Defines the JMS context factory.
          public final static String JMS_FACTORY="jms.SSLQueueConnectionFactory";
          // Defines the queue.
          public final static String QUEUE="WEBLOGIC.TEST.QUEUE";
          private QueueConnectionFactory qconFactory;
          private QueueConnection qcon;
          private QueueSession qsession;
          private QueueSender qsender;
          private Queue queue;
          private TextMessage msg;
          * Creates all the necessary objects for sending
          * messages to a JMS queue.
          * @param ctx JNDI initial context
          * @param queueName name of queue
          * @exception NamingException if operation cannot be performed
          * @exception JMSException if JMS fails to initialize due to internal error
          public void init(Context ctx, String queueName)
          throws NamingException, JMSException
          qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
          qcon = qconFactory.createQueueConnection();
          qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
          queue = (Queue) ctx.lookup(queueName);
          qsender = qsession.createSender(queue);
          msg = qsession.createTextMessage();
          qcon.start();
          * Sends a message to a JMS queue.
          * @param message message to be sent
          * @exception JMSException if JMS fails to send message due to internal error
          public void send(String message) throws JMSException {
          msg.setText(message);
          qsender.send(msg);
          * Closes JMS objects.
          * @exception JMSException if JMS fails to close objects due to internal error
          public void close() throws JMSException {
          qsender.close();
          qsession.close();
          qcon.close();
          private static void readAndSend(QueueSend qs)throws IOException, JMSException
               BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
          String line=null;
          boolean quitNow = false;
          do {
          System.out.print("Enter message (\"quit\" to quit): \n");
          line = msgStream.readLine();
          if (line != null && line.trim().length() != 0) {
          qs.send(line);
          System.out.println("JMS Message Sent: "+line+"\n");
          quitNow = line.equalsIgnoreCase("quit");
          } while (! quitNow);
          private static InitialContext getInitialContext(String url)
          throws NamingException
          Hashtable env = new Hashtable();
          env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
          env.put(Context.PROVIDER_URL, url);
          return new InitialContext(env);
          /** main() method.
          * @param args WebLogic Server URL
          * @exception Exception if operation fails
          public static void main(String[] args) throws Exception
          InitialContext ic = getInitialContext("t3://tus1bpmappdin01.ges.symantec.com:7501");
          QueueSend qs = new QueueSend();
          qs.init(ic, QUEUE);
          readAndSend(qs);
          qs.close();
          Any suggestions would be appreciated
          Regards

Similar Messages

  • Foreign jms connection factory username and password

    I have to connect to TIBCO as the foreign JMS. I have created a foreign JMS server and configured JNDI properties including username and password. I configured a connection factory and specified username and password as well. Finally, I configured foreign destination.
              In web.xml and corresponding welogic.xml, I am using the resource-ref with Container authentication.
              With the above, I always get the following exception.
              javax.jms.JMSSecurityException: Not permitted
                   at com.tibco.tibjms.Tibjmsx.buildException(Tibjmsx.java:499)
                   at com.tibco.tibjms.TibjmsSession._createProducer(TibjmsSession.java:697)
                   at com.tibco.tibjms.TibjmsQueueSession.createSender(TibjmsQueueSession.java:123)
              The above code works fine under the following circumstances:
              * If I don't use any username and passwords.
              * If I pass the username and password to the connection factory when creating the connection. According to the documentation here (http://e-docs.bea.com/wls/docs81/jms/j2ee_components.html#1033768) doing so in an error:(
              Any ideas or suggestions?

    Even though I had configured things in the web.xml and weblogic.xml, I didn't use them. So, instead of using global JNDI, I used java:comp/env JNDI. Once, I used the correct JNDI, the connection is working... I will continue to do further testing.
              > I have to connect to TIBCO as the foreign JMS. I
              > have created a foreign JMS server and configured JNDI
              > properties including username and password. I
              > configured a connection factory and specified
              > username and password as well. Finally, I configured
              > foreign destination.
              >
              > In web.xml and corresponding welogic.xml, I am using
              > the resource-ref with Container authentication.
              >
              > With the above, I always get the following exception.
              >
              >
              > javax.jms.JMSSecurityException: Not permitted
              > at
              > t
              > com.tibco.tibjms.Tibjmsx.buildException(Tibjmsx.java:4
              > 99)
              > at
              > t
              > com.tibco.tibjms.TibjmsSession._createProducer(TibjmsS
              > ession.java:697)
              > at
              > t
              > com.tibco.tibjms.TibjmsQueueSession.createSender(Tibjm
              > sQueueSession.java:123)
              >
              > The above code works fine under the following
              > circumstances:
              > * If I don't use any username and passwords.
              > * If I pass the username and password to the
              > connection factory when creating the connection.
              > According to the documentation here
              > e
              > (http://e-docs.bea.com/wls/docs81/jms/j2ee_components.
              > html#1033768) doing so in an error:(
              >
              > Any ideas or suggestions?

  • Javax.naming.NameNotFoundException: jms/QueueConnectionFactory not found

    Hi,
    I wrote a Java JMS client that connect to Oracle9iAs 9.0.2.1
    using OC4J 9.0.3.
    I got the error javax.naming.NameNotFoundException: jms/QueueConnectionFactory not found?
    first I'm a bit confused about which rmi port to use to connect
    to Oracle9ias, I found there is 7 ports open from 3101 to 3107?
    How could I I know which port my OC4J_Home is using??
    thanks
    Ahmed

    thanks for your help, I know now that i'm connecting to the right port, however, i'm still getting the error message
    error javax.naming.NameNotFoundException: jms/QueueConnectionFactory not found?
    note that i'm not getting such message on OC4J standalone.
    I know that Oracle donestn't recommend the use of ligth
    JMS only AQ, becouse light oracle JMS have some bugs,
    is this one of the bugs?
    any body have a idea what could be the probelm?
    Ahmed

  • Javax.naming.NameNotFoundException: No object bound for java:comp/env/...

    Help, help! I have a problem:
    javax.naming.NameNotFoundException: No object bound for java:comp/env/configuratorDataSource
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:127)
    at javax.naming.InitialContext.lookup(InitialContext.java:355)
    at oracle.toplink.jndi.JNDIConnector.connect(Unknown Source)
    at oracle.toplink.sessions.DatabaseLogin.connect(Unknown Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connect(Unknown Source)
    at oracle.toplink.threetier.ConnectionPool.buildConnection(Unknown Source)
    at oracle.toplink.threetier.ConnectionPool.startUp(Unknown Source)
    at oracle.toplink.threetier.ServerSession.connect(Unknown Source)
    at oracle.toplink.publicinterface.DatabaseSession.login(Unknown Source)
    at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
    at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
    at com.configurator.datasource.ToplinkClientSessionManager.<init>(ToplinkClientSessionManager.java:18)
    at com.configurator.datasource.ToplinkClientSessionManager.getInstance(ToplinkClientSessionManager.java:33
    at com.configurator.persistence.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:16)
    at com.configurator.ConfiguratorServiceMediatorImpl.getModelsFromDB(ConfiguratorServiceMediatorImpl.java:3
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:384)
    at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:281)
    at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:319)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:450)
    at org.apache.axis.server.AxisServer.invoke(AxisServer.java:285)
    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:653)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:301)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:595)
    code:
    initialContext = new InitialContext();
    LocalStatelessREHome localHome = (LocalStatelessREHome)initialContext.lookup("java:comp/env/StatelessREBean");
    in web.xml:
    <ejb-local-ref>
    <ejb-ref-name>StatelessREBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.re.stateless.ejb.LocalStatelessREHome</local-home>
    <local>com.re.stateless.ejb.LocalStatelessRE</local>
    <ejb-link>StatelessREBean</ejb-link>
    </ejb-local-ref>
    Any help will be appreciated! Thanks in advance.

    Try removing the JNDI fully qualified name (i.e. java:comp\env\) Use the name of your bean to lookup.
    It worked for me when i used to get a similar exception.

  • Javax.nameing.NameNotFoundException when connection to Standalone OC4J

    I have installed a standalone OC4J 10.1.3 for a testing purposes.
    It is an out-of-the-zip-file installation, so I have not configured anything except for the administrator password.
    I can start/stop the serveren and access the Oracle Enterprise Manager from both the local server and remote PC's. I can browse the instance as expected and everything seems to work.
    When creating a testing a connection from JDeveloper on a remote PC I receive the following exception:
    Error while getting remote MBeanServer for url: ormi://<the correct server name>:23791/default
    Error reading application-client descriptor: Error communication with server oc4j:internal/ResourceFinder not found; nested exception is:
    javax.nameing.NameNotFoundException: oc4j:internal/ResourceFinder not found
    -- Regards Flemming

    I have installed a standalone OC4J 10.1.3 for a testing purposes.
    It is an out-of-the-zip-file installation, so I have not configured anything except for the administrator password.
    I can start/stop the serveren and access the Oracle Enterprise Manager from both the local server and remote PC's. I can browse the instance as expected and everything seems to work.
    When creating a testing a connection from JDeveloper on a remote PC I receive the following exception:
    Error while getting remote MBeanServer for url: ormi://<the correct server name>:23791/default
    Error reading application-client descriptor: Error communication with server oc4j:internal/ResourceFinder not found; nested exception is:
    javax.nameing.NameNotFoundException: oc4j:internal/ResourceFinder not found
    -- Regards Flemming

  • Javax.naming.NameNotFoundException while trying to lookup for the Datasourc

    I get following exception when the datasource is looked up after redeployment.
    javax.naming.NameNotFoundException: Unable to resolve 'jdbc.oracleDS' Resolved: '' Unresolved:'jdbc' ; remaining name 'jdbc.oracleDS'
    But after redeployment if I restart the application server, this problem gets resolved automatically and I am able to get the connection.
    So is there any specific configuration, so that I can access the Database connections without restarting the servers after re-deployment?
    Connection Pool and DataSource are targetted to a Cluster.
    Please let me know if there is any solution for this.
    Thanks in advance !

    there are multiple option of creating data source.which one i should use.
    should i use generic one. what is URL information for oracle xe client.what is driver name?

  • WLS 7.0.4 - JMS connection Factory for RMI queues - server affinity issues help pls

    We are using WLS 7.0.4 - One of JMS connection factory setting in admin
    console we selected "Server Affinity" options.
    We see this messages appear in Weblogic log file,
    ####<Apr 24, 2006 1:56:53 AM EDT> <Error> <Cluster>
    <liberatenode4.dc2.adelphia.com> <node4_svr> <ExecuteThrea
    d: '4' for queue: '__weblogic_admin_rmi_queue'> <kernel identity> <>
    <000123> <Conflict start: You tried to bi
    nd an object under the name sbetrmi2 in the JNDI tree. The object you have
    bound from liberatenode2.dc2.adelp
    hia.com is non clusterable and you have tried to bind more than once from
    two or more servers. Such objects ca
    n only deployed from one server.>
    and then,
    ####<Apr 24, 2006 1:58:12 AM EDT> <Error> <Cluster>
    <liberatenode5.dc2.adelphia.com> <node5_svr> <ExecuteThrea
    d: '7' for queue: '__weblogic_admin_rmi_queue'> <kernel identity> <>
    <000125> <Conflict Resolved: sbetrmi2 for
    the object from liberatenode5.dc2.adelphia.com under the bind name sbetrmi2
    in the JNDI tree.>
    Should we use 'load balancing option' instead of 'server affinity' ?
    Any thuoghts?
    Thanks in adv.
    Vijay

    Test Reply
              <Vijay Kumar> wrote in message news:[email protected]..
              > <b>WLS 7.0.4 - JMS Connection Factory - Server Affinity - issues in log
              > file</b>
              >
              > We are using WLS 7.0.4 - One of JMS connection factory setting in admin
              > console we selected "Server Affinity" options.
              >
              > We see this messages appear in Weblogic log file,
              > ####<Apr 24, 2006 1:56:53 AM EDT> <Error> <Cluster>
              > <liberatenode4.dc2.adelphia.com> <node4_svr> <ExecuteThrea
              > d: '4' for queue: '__weblogic_admin_rmi_queue'> <kernel identity> <>
              > <000123> <Conflict start: You tried to bi
              > nd an object under the name sbetrmi2 in the JNDI tree. The object you have
              > bound from liberatenode2.dc2.adelp
              > hia.com is non clusterable and you have tried to bind more than once from
              > two or more servers. Such objects ca
              > n only deployed from one server.>
              >
              > and then,
              > ####<Apr 24, 2006 1:58:12 AM EDT> <Error> <Cluster>
              > <liberatenode5.dc2.adelphia.com> <node5_svr> <ExecuteThrea
              > d: '7' for queue: '__weblogic_admin_rmi_queue'> <kernel identity> <>
              > <000125> <Conflict Resolved: sbetrmi2 for
              > the object from liberatenode5.dc2.adelphia.com under the bind name
              > sbetrmi2 in the JNDI tree.>
              >
              >
              > Should we use 'load balancing option' instead of 'server affinity' ?
              >
              > Any thuoghts?
              >
              > Thanks in adv.
              > Vijay

  • JNDI lookup failed:javax.naming.NameNotFoundException

    Hello:
    I have a application (not web) that publish messages to a specific topic, i want to receive these messages in a Web Service, but when the web service make the call to a class that is the JMS Client it can't find the Connection factory Name that i create in the aplication.
    I want to know what i have to do,
    I work with J2EE1.3.1 and JMS1.0.2 for the application that publish the messages
    and Jwsdp1.1, tomcat 4 and j2sdk 1.4.0 for the web service.
    I create the connection factory with this command:
    j2eeadmin -addJmsFactory jms/DurableTopicB topic -props clientID=IdTopicB
    Then in the class that the web service invoke i trying to join with this:
    try {
    jndiContext =new InitialContext();
    }catch (NamingException e){
    System.err.println("Could not create JNDI API "+
    "context:"+e.toString());
    return;
    *Look up connection factory and topic.If either  
    *does not exist,exit.                            
    try {
    topicConnectionFactory =(TopicConnectionFactory)
    jndiContext.lookup(conFacName);
    }catch (NamingException e){                      
    System.err.println("JNDI API lookup failed:"+
    e.toString());
    return;
    //System.exit(1);
    But i receive a error message in the log of Tomcat:
    JNDI API lookup failed:javax.naming.NameNotFoundException: El nombre DurableTopicB no este asociado a este contexto
    Thanks

    Hello:
    I display the full context of the connection factory in the application that publish the message:
    Full context is :
    Enviroment is : {java.naming.corba.orb=com.sun.enterprise.iiop.POAEJBORB@ec4a87}
    And in the web service when i create the initial context the full context is:
    Full context is : java:
    Enviroment is : {java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, java.naming.factory.url.pkgs=org.apache.naming}
    How can i see the connection factory in the Web Service, because the connection factory was created in other Application?

  • Trying to look up a JMS Connection Factory in WebLogic 10.3.3

    Actually I'm just trying to get started with JMS and the new version of B2B integrated into weblogic. I can't even get the lookup to the connection factory to work.
    Properties env = new Properties( );
    env.put(Context.SECURITY_PRINCIPAL, "weblogic");
    env.put(Context.SECURITY_CREDENTIALS, "xxxxxx");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    "t3://realHostName:7001");
    InitialContext jndi = new InitialContext(env);
    ConnectionFactory conFactory =
    (ConnectionFactory)jndi.lookup("jms/b2b/B2BQueueConnectionFactory");
    I am looking at the what I think is the connection factory jndi name. I'm looking at the settings for the SOAJMSModule and I see in the table the following information:
    Name: B2BQueueConnectionFactory     
    Type:Connection Factory     
    JNDI: jms/b2b/B2BQueueConnectionFactory     
    Sub Deployment: Default Targetting     
    Targets: soa_server1
    Do I need to use the sub deployment somehow maybe? Is the JNDI name somewhere else?
    I keep getting: "javax.naming.NameNotFoundException: Exception in lookup.: `jms/b2b/B2BQueueConnectionFactory' could not be found."
    Thanks,
    Dan

    Hi Dan,
    As u have targeted the ConnectionFactory to "soa_server1" which is running on "realHostName:7001" ....Can u please check from the AdminConsole that the JNDI name ""jms/b2b/B2BQueueConnectionFactory" is present in the JNDI Tree?
    AdminConsole---->Servers---soa_server1 (click) ---> in this general configuration page you will see a link "View JNDI Tree" please ckick on that link to see the JNDI tree entries.
    If you dont see any JNDI entry there then it means there is something wrong while setting up the Connection Factory in that case please refer to the Screenshots of Creating and Targeting the Connection Factory: *http://middlewaremagic.com/weblogic/?p=1987*
    Thanks
    Jay SenSharma
    *http://middlewaremagic.com/weblogic (Middleware magic Is Here)*

  • Failed:javax.naming.NameNotFoundException: QueueConnectionFactory

    hi all
    I have the problem how to solve this problem? when i was lookup through jndiname it was error but i declared it in a descriptor.
    Error :
    init:
    deps-jar:
    compile-single:
    run-single:
    Jndi lookup failed:javax.naming.NameNotFoundException: QueueConnectionFactory not found
    Java Result: 1
    BUILD SUCCESSFUL (total time: 4 seconds)
    Here is the code...
    That is Main....
    public static void main(String[] args) {
    Context jndiContext = null;
    ConnectionFactory connectionfactory = null;
    Connection connection = null;
    Session session = null;
    Destination destination = null;
    MessageProducer messageProducer = null;
    TextMessage message = null;
    final int NUM_MSGS = 3;
    try{
    jndiContext = new InitialContext();
    }catch(NamingException ex){
    System.err.println("Could not Create JNDI.");
    System.exit(1);
    try
    connectionfactory = (ConnectionFactory)jndiContext.lookup("jms/QueueConnectionFactory");
    destination = (Queue)jndiContext.lookup("jms/SimpleMessageBean");
    }catch(NamingException e){
    System.err.println("Jndi lookup failed:" + e.toString());
    System.exit(1);
    try{
    connection = connectionfactory.createConnection();
    session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    messageProducer = session.createProducer(destination);
    message = session.createTextMessage();
    for(int i=0; i < NUM_MSGS; i++){
    message.setText("This is a message " + (i+1));
    System.out.println("Sending message " + message.getText());
    messageProducer.send(message);
    }catch(javax.jms.JMSException e){
    System.err.println("Exception occured: " + e.toString());
    }finally
    if(connection == null){
    try{
    connection.close();
    }catch(JMSException e){                    
    System.exit(0);
    In Message Bean....
    @MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "connectionFactoryJndiName", propertyValue="jms/QueueConnectionFactory")
    public class SimpleMessage implements MessageListener {
    public static final Logger logger = Logger.getLogger("SimpleMessage");
    /** Creates a new instance of SimpleMessage */
    public SimpleMessage() {
    public void onMessage(Message message){
    TextMessage msg = null;
    try{
    if(message instanceof TextMessage)
    msg = (TextMessage)message;
    logger.info("Message Bean: Message Received:" + msg.toString());
    }else{
    logger.warning("Wrong Type:" + msg.getClass().getName());
    }catch(Throwable te){
    te.printStackTrace();
    In descriptor...
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd">
    <sun-ejb-jar>
    <enterprise-beans>
    <name>SimpleMessage</name>
    <ejb>
    <ejb-name>SimpleMessage</ejb-name>
    <mdb-connection-factory>
    <jndi-name>jms/QueueConnectionFactory</jndi-name>
    </mdb-connection-factory>
    </ejb>
    <cmp-resource>
    <jndi-name>jms/SimpleMessage</jndi-name>
    </cmp-resource>
    </enterprise-beans>
    </sun-ejb-jar>
    Thank you for reply..
    Chris

    Connection Factories and Queues are global resources that must be created through either
    the admin console or the asadmin CLI command. Those global resources are then referred to
    by your application code. Please see the JMS portion of the Java EE 5 tutorial :
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javax.naming.NameNotFoundException: Name java:comp is not bound in this Con

    Hi
    I have developed a search servlet and deployed it in tomcat 4.0.3 and connected to mysql database through jdbc by specifying jndi.
    I have coded JNDI lokkup name as "java:comp/env/jdbc/KgoogleDB"
    I have added a context in server.xml file of tomcat for DBCP connection pooling .I have tested this in windows and it is running well in it.
    But when i hosted this in linux i got error like this
    INIT OF SEARCH SERVLET
    Error in file reading Connection refused
    File Not Found
    javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
    at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
    at javax.naming.InitialContext.lookup(InitialContext.java:354)
    at DbConnect.getConnection(DbConnect.java:35)
    at QueryDetails.Query(QueryDetails.java:32)
    at Search.doPost(Search.java:66)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:446)
    at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.warp.WarpRequestHandler.handle(WarpRequestHandler.java:217)
    at org.apache.catalina.connector.warp.WarpConnection.run(WarpConnection.java:194)
    at java.lang.Thread.run(Thread.java:536)
    Connection ID null
    Entered FINALLY
    =================================
    What would be the cause of this error?.Please help me.
    My server.xml context is
    - <Host className="org.apache.catalina.connector.warp.WarpHost" name="www.keralagoogle.com" debug="0" appBase="/domains/www.yy.com/tomcat/webapps" unpackWARs="true">
    - <Context path="/yyjava" docBase="/domains/www.yy.com/tomcat/webapps/yyjava" debug="0" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_KgoogleDB." suffix=".txt" timestamp="true" />
    <Resource name="jdbc/KgoogleDB" auth="Container" type="javax.sql.DataSource" />
    - <ResourceParams name="jdbc/KgoogleDB">
    - <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    - <!--
    Maximum number of dB connections in pool. Make sure you
              configure your mysqld max_connections large enough to handle
              all of your db connections. Set to 0 for no limit.
    -->
    - <parameter>
    <name>maxActive</name>
    <value>500</value>
    </parameter>
    - <!--
    Maximum number of idle dB connections to retain in pool.
              Set to 0 for no limit.
    -->
    - <parameter>
    <name>maxIdle</name>
    <value>300</value>
    </parameter>
    - <!--
    Maximum time to wait for a dB connection to become available
              in ms, in this example 10 seconds. An Exception is thrown if
              this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    - <parameter>
    <name>maxWait</name>
    <value>12000</value>
    </parameter>
    - <!-- MySQL dB username and password for dB connections
    -->
    - <parameter>
    <name>username</name>
    <value>pratap</value>
    </parameter>
    - <parameter>
    <name>password</name>
    <value>ky67yumXg</value>
    </parameter>
    - <!-- Class name for mm.mysql JDBC driver
    -->
    - <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    - <!--
    The JDBC connection url for connecting to your MySQL dB.
              The autoReconnect=true argument to the url makes sure that the
              mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
              connection. mysqld by default closes idle connections after 8 hours.
    -->
    - <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/kgoogle?</value>
    </parameter>
    </ResourceParams>
    </Context>
    ==============================
    Please help me find if i have to change the syntax for linux in the above code.
    Thanks in Advance
    Prathap

    hi
    Thanks for your advise.
    But when i chenged my web.xml and jndi name in my servlet file i got error like this
    javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
    at org.apache.naming.NamingContext.lookup(NamingContext.java:811)
    at org.apache.naming.NamingContext.lookup(NamingContext.java:194)
    at org.apache.naming.SelectorContext.lookup(SelectorContext.java:183)
    at javax.naming.InitialContext.lookup(InitialContext.java:354)
    at DbConnect.getConnection(DbConnect.java:35)
    at QueryDetails.Query(QueryDetails.java:32)
    at Search.doPost(Search.java:66)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServl
    et.java:446)
    at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.jav
    a:216)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
    torBase.java:475)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve
    .java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:
    2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatche
    rValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
    468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline
    .java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcesso
    r.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.ja
    va:1107)
    at java.lang.Thread.run(Thread.java:536)
    Connection ID null
    Entered FINALLY
    Please help me
    Thanks in Advance
    Prathap

  • Error in looking up the JMS Connection Factory

              Hi,
              I am using weblogic6.1. I created a JMS Connection factory from administrator
              console with the name QueueConnectionFactory..But when i restart the server and
              try to look up that factory its giving an NameNotFoundException...This is the
              entry of the factory in config.xml
              <JMSConnectionFactory JNDIName="QueueConnectionFactory"
              Name="QueueConnectionFactory" Targets="myserver"/>
              But if i change reapply the target server to myserver from admin console whenever
              restart the server it works fine..
              I dont know where is the problem..Can u please update me on the problem if u people
              have any idea.
              The trace of the exceptions i got is as below:
              java.rmi.RemoteException: javax.naming.NameNotFoundException: Unable to
              resolve QueueConnectionFactory. Resolved
              : '' Unresolved:'QueueConnectionFactory' ; remaining name ''
              java.rmi.RemoteException: javax.naming.NameNotFoundException: Unable to resolve
              QueueConnectionFactory. Resolved: '' Unr
              esolved:'QueueConnectionFactory' ; remaining name ''
              Thanx
              Regards,
              Narayan
              

              Hi Zach,
              No, I dont think ur interpretation is right..Once the entry corresponding
              to JMS Connection Factory is there in config.xml, the server should automatically
              bind it at the time of booting.. right. Why should this administrator server come
              into the picture.
              Thanx
              "Zach" <[email protected]> wrote:
              >Don't know. Sounds like the admin server is not notifying JMS of the
              >changes under certain situations. You might post in the management.console
              >newsgroup.
              >
              >_sjz.
              >
              >"Narayan" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Hi,
              >> I am using weblogic6.1. I created a JMS Connection factory from
              >administrator
              >> console with the name QueueConnectionFactory..But when i restart the
              >server and
              >> try to look up that factory its giving an NameNotFoundException...This
              >is
              >the
              >> entry of the factory in config.xml
              >>
              >> <JMSConnectionFactory JNDIName="QueueConnectionFactory"
              >> Name="QueueConnectionFactory" Targets="myserver"/>
              >> But if i change reapply the target server to myserver from admin console
              >whenever
              >> restart the server it works fine..
              >> I dont know where is the problem..Can u please update me on the problem
              >if
              >u people
              >> have any idea.
              >> The trace of the exceptions i got is as below:
              >> ****************
              >> java.rmi.RemoteException: javax.naming.NameNotFoundException:
              >Unable to
              >> resolve QueueConnectionFactory. Resolved
              >> : '' Unresolved:'QueueConnectionFactory' ; remaining name ''
              >> java.rmi.RemoteException: javax.naming.NameNotFoundException: Unable
              >to
              >resolve
              >> QueueConnectionFactory. Resolved: '' Unr
              >> esolved:'QueueConnectionFactory' ; remaining name ''
              >>
              >> **********************
              >>
              >> Thanx
              >> Regards,
              >> Narayan
              >>
              >>
              >
              >
              

  • LDAP Newbie:    javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031522C9, problem 2001 (NO_OBJECT)

    Hi,
    I am getting the following error when I try to do a search on an ldap (AD LDS) database:
    javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031522C9, problem 2001 (NO_OBJECT), data 0, best match of:
    'DC=AppPartFE,DC=com'
    ]; remaining name 'cn=Users,dc=AppPartFE,dc=com'
    at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.searchAux(Unknown Source)
    at com.sun.jndi.ldap.LdapCtx.c_search(Unknown Source)
    at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(Unknown Source)
    at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(Unknown Source)
    at javax.naming.directory.InitialDirContext.search(Unknown Source)
    at Test.<init>(Test.java:70)
    at Test.main(Test.java:118)
    I can bind successfully using either the userPrincipalName (UPN) or the Distinguished Name (DN), however my search is failing.
    It is almost as if I am connected to the db tree at the wrong place.  Do I need a different search scope?
    I appreciate any assistance you can provide.
    Here is my code:
    import java.util.*; 
    import static java.lang.System.err;
    import javax.naming.Context;
    import javax.naming.NamingEnumeration;
    import javax.naming.NamingException;
    import javax.naming.directory.DirContext;
    import javax.naming.directory.SearchControls;
    import javax.naming.directory.SearchResult;
    import javax.naming.ldap.InitialLdapContext;
    import javax.naming.ldap.LdapContext;
    public class Test 
    public Test() 
      Properties prop = new Properties(); 
      prop.put("java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory"); 
      prop.put("java.naming.provider.url", "ldap://MyHost.Mydomain.labs.CompanyX.com:50004");
      String strProviderUrl = "ldap://MyHost.Mydomain.labs.CompanyX.com:50004";
      // Can successfully bind with the userPrincipalName in AD LDS
      //prop.put("java.naming.security.principal", "[email protected]");
      // Can successfully bind with Distinguished Name
      // Note: the string is case insensitive and embedded blank after a comma is not a problem
       prop.put("java.naming.security.principal", "cn=tst0001,cn=Users,dc=AppPartFE,dc=com"); 
      prop.put("java.naming.security.credentials", "password"); 
      try { 
        LdapContext ctx = new InitialLdapContext(prop, null); 
        System.out.println("Bind successful");
    //I am successful to this point....
       //now try doing a search on another user
         String strFilter = "(&(objectClass=userProxy)(sAMAccountName=tst0001))";
        SearchControls searchControls = new SearchControls();
        searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); //works with object class=* to find top partition node
        NamingEnumeration<SearchResult> results = ctx.search("cn=Users,dc=AppPartFE,dc=com", strFilter, searchControls);
        SearchResult searchResult = null;
        if(results.hasMoreElements()) {
             searchResult = (SearchResult) results.nextElement();
            //make sure there is not another item available, there should be only 1 match
            if(results.hasMoreElements()) {
                System.err.println("Matched multiple users for the accountName");
      catch (NamingException ex) { 
        ex.printStackTrace(); 
    public static void main(String[] args) 
      Test ldaptest = new Test(); 

    Because you are specifiying a base distinguished name in your ldap url, the ldap context will be rooted at that context and all subsequent objects will be relative to that base distinguished name.//connect to my domain controller
    String ldapURL = "ldaps://rhein:636/dc=bodensee,dc=de";andString userName = "CN=verena bit,OU=Lehrer,OU=ASR,DC=bodensee,DC=de";results in an fully distinguished name of:CN=verena bit,OU=Lehrer,OU=ASR,DC=bodensee,DC=de,dc=bodensee,dc=deEither specify your ldap url asString ldapURL = "ldaps://rhein:636";and leave your username as is, or specify the user object relative to the base distinguished name in the ldapurlString userName = "CN=verena bit,OU=Lehrer,OU=ASR";

  • MDB for Foreign JMS server

    I am trying to access MQ que with Message Driven bean in weblogic 8.1.
              I have defined Foreign JMS server in weblogic pointing to MQ JNDI name.
              I am not sure what to define in "weblogic-ejb-jar.xml" and "ejb-jar.xml" to refer to que connection factory and que.
              Error message that I am getting while deploying is as follows:
              <The Message-Driven EJB: MesssageHandlerBean is unable to connect to the JMS destination: jms.MediaQueue. The Error was:
              [EJB:011010]The JMS destination with the JNDI name: jms.MediaQueue could not be found. Please ensure that the JNDI name in the weblogic-ejb-jar.xml is correct, and the JMS destination has been deployed.>
              Looks like it weblogic is not able to identify JNDI name that I have defined in foreign server for remote que.
              Please let me know how i can reference foreign JMS server JNDI names.
              Thanks a bunch for help.
              Please find attached configuration files.
              weblogic-ejb-jar.xml
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>MesssageHandlerBean</ejb-name>
              <message-driven-descriptor>
              <destination-jndi-name>
              jms.MediaQueue
              </destination-jndi-name>
              <initial-context-factory>
              com.sun.jndi.fscontext.RefFSContextFactory
              </initial-context-factory>
              <provider-url>file://localhost/d:/mqm</provider-url>
              <connection-factory-jndi-name>
              jms.MediaQcf
              </connection-factory-jndi-name>
              </message-driven-descriptor>
              <jndi-name>MesssageHandlerBean</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ejb-jar.xml
              <enterprise-beans>      
              <message-driven>
              <ejb-name>MesssageHandlerBean</ejb-name>
              <ejb-class>com.ejb.MesssageHandlerBean</ejb-class>
              <transaction-type>Container</transaction-type>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              </message-driven-destination>
              </message-driven>
              </enterprise-beans>
              weblogic "config.xml" for foeign JMS server.
              <ForeignJMSServer ConnectionURL="file://localhost/d:/mqm" InitialContextFactory="com.sun.jndi.fscontext.RefFSContextFactory"
              JNDIProperties="" Name="MQJMS Server" Targets="cgServer">
              <ForeignJMSConnectionFactory LocalJNDIName="jms.MediaQcf"
              Name="MQ JMS Connection Factory" PasswordEncrypted=""
              RemoteJNDIName="jms/lMediaQcf" Username=""/>
              <ForeignJMSDestination LocalJNDIName="jms.MediaQueue"
              Name="MQJMS Destination" RemoteJNDIName="jms/IMediaQueue"/>
              </ForeignJMSServer>
              Message was edited by:
              [email protected]
              Message was edited by:
              [email protected]

    Thanks for going over the problem it is resolved now by changing weblogic-ejb-jar.xml. To point to weblogic initial context factory. Since weblogic has a foreign server defined so MDB is able to read from MQ que.
              Thanks
              Akash
              <weblogic-enterprise-bean> <ejb-name>MesssageHandlerBean</ejb-name> <message-driven-descriptor> <destination-jndi-name>jms.MediaQueue</destination-jndi-name> <initial-context-factory> weblogic.jndi.WLInitialContextFactory</initial-context-factory> <provider-url>t3://localhost:7001</provider-url> <connection-factory-jndi-name>jms.MediaQcf</connection-factory-jndi-name> </message-driven-descriptor> <jndi-name>MesssageHandlerBean</jndi-name> </weblogic-enterprise-bean>

  • Can't deploy a jms connection factory

    I am getting errors when trying to deploy a jms connection factory.  Here is the xml file jms-factories.xml:
    <?xml version="1.0" encoding="utf-8"?>
    <jms-factories>
    <application-name>MyApplicationName</application-name>
    <connection-factory>
      <connection-factory-type>QueueConnectionFactory</connection-factory-type >
         <factory-name>MyQueueConnectionFactory</factory-name>
      <context-factory-type>
      <link-factory-name>jmsfactory/default/MyConnectionFactory</link-factory-name>
      <initial-context-factory>
          com.sap.engine.services.jndi.InitialContextFactoryImpl
      </initial-context-factory>
      <provider-url>localhost</provider-url>
      <security-principal>Administrator</security-principal>
      </context-factory-type>
    </connection-factory>
    </jms-factories>
    Below is the error:
    java.rmi.RemoteException: Error occurred while starting application in whole cluster and wait.; nested exception is:
         com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Clusterwide exception: server ID 5215450:com.sap.engine.services.jmsconnector.exceptions.BaseDeploymentException: Class loading error: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of MyConnectionFactory.
         at com.sap.engine.services.jndi.implserver.ServerContextImpl.lookup(ServerContextImpl.java:650)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:344)
         at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:638)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.sap.engine.services.jmsconnector.container.JmsContainerImpl.loadFactory(JmsContainerImpl.java:1306)
         at com.sap.engine.services.jmsconnector.container.JmsContainerImpl.prepareStart(JmsContainerImpl.java:577)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:233)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepare(StartTransaction.java:193)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:380)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesImpl(ParallelAdapter.java:421)
         at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhasesImpl(StartTransaction.java:539)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:171)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:315)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3163)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:674)
         at com.sap.engine.services.deploy.server.DeployCommunicatorImpl.startApplicationAndWait(DeployCommunicatorImpl.java:658)
         at com.sap.engine.services.jmsconnector.container.JmsManagerImpl.deployJmsResource(JmsManagerImpl.java:281)
         at com.sap.engine.services.jmsconnector.command.DeployJmsResource.exec(DeployJmsResource.java:81)
         at com.sap.engine.services.shell.processor.environment.CommandBase.exec(CommandBase.java:132)
         at com.sap.engine.services.shell.processor.Interpreter.applyLineCommand(Interpreter.java:391)
         at com.sap.engine.services.shell.processor.Interpreter.apply(Interpreter.java:150)
         at com.sap.engine.services.shell.processor.Shell.work(Shell.java:148)
    I am actually trying to do an automated deploy but I kept getting this error so I am trying to manually deploy it with the J2EE Engine Console tool.  The command is:
    deploy_jms_resource d:\jay\jms-factories.xml
    Anybody have any ideas?  At the top of the stack trace it mentions Class loading error but it is not the InitialContextFactoryImpl that is causing the problem because if I enter a totally bogus class name I get a nice ClassNotFound exception.

    Hi Jay,
    Which Reference guide do you mean? You find the jms-resources.xsd here: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/55e7d51e-0e01-0010-7b84-a95ee55eadeb">Java Messaging</a>, pages 52-58.

Maybe you are looking for

  • Objects don't appear in PDF

    Am using Acrobat Professional 9.2.0 with Mac OSX 10.6.5. After saving files, when re-opening in Preview 5.0.3 as a pdf file only, some objects fail to appear.  When re-opening in Acrobat, all objects appear as originally created. My callout objects a

  • Motion blur options?

    Hello! I'm working on a new project. Footage is being recorded from a game at 300 fps (then resampled to 30). I'd like to achieve the same motion blur as for footage take with a normal camera. I tried a few things but I'd like to see if there are som

  • Change Image from the library method

    Hi guys, I am new to this plateform and I am working on a library in objective-c for iPhone application. I am facing one problem in this, In my application a view is going to create on the click of the button and the code to create the view has been

  • User not receiving Email

    I have a user that can not receive email the emails just sit in the queue. The error I see is DBERROR: error fetching user.user: cyrusdb error I have ran mailbfr -m twice and restarted the server with no success. What is the next step.

  • Adobe email query

    I have a query - I am trying to email a PDF file (not an FDF file) to a email address entered dynamically at run time in a PDF file from a Input field, this email address entered I would like to encapsulate in a button such that the PDF file gets sen