Jndi properties for sasl, external mechanism

We're having trouble connecting to an LDAP server over SSL. We have created the client/trust keystores, but do not know what the jndi properties should be. We want the authentication to come from the certificate not simple name/password. Do we leave principals, credentials and authorizationId with null values?

If this to perform external authentication against Active Directory, have a look at the post titled "JNDI, Active Directory & Authentication (part 4) (SASL EXTERNAL)" available at
http://forum.java.sun.com/thread.jspa?threadID=641047&tstart=0
Good luck.

Similar Messages

  • Why ican't I find jndi.properties for TopicConnectionFactory lookup?

    I have a problem with IPlanetMessageQueue3.0 . Why i can't find jndi.properties for TopicConnectionFactory lookup ? Like this Context ctx = new
    InitialContext();TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("TopicConnectionFactory"); What is value of
    Context.INITIAL_CONTEXT_FACTORY and Context.PROVIDER_URL ( I home jmqbroker://localhost:7676 ) for default configuration ?

    Have you used the object manager to create the ConnectionFactory object(s) in the JNDI store? If not, you need to use the tool to create the
    object(s) and store them in the JNDI server before you may use them.
    There is a simple help for this in the IPlanetMessageQueue3.0 installation bin directory. In the MQ installation bin directory, type the following
    command:
    imqobjmgr -H
    you will get examples on how to create JNDI objects and the values that you need to set up JNDI Context.

  • JNDI properties for JCAPS

    Hi I have installed the Logical Host of JCAPS .Also I can explore the different
    MBeans of it using JConsole.
    If I want to access those MBeans programmatically what would be the
    JNDI properties ?
    For examplke if I want to access JBoss 3.2.5 MBeans My sample code would be something like ....
    InitialContext ctx = null;
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
    env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
    ctx = new InitialContext(env);
    So what would be my INITIAL_CONTEXT_FACTORY,PROVIDER_URL,URL_PKG_PREFIXES etc
    in this case ?
    If somebody has any idea please reply . When I was working with JBoss 3.2.5, I got all the related information from JBoss Administration Guide .
    Does JCAPS has any specific doc which can help me in this regard ?
    Regards,
    Ayan

    I use the following properties to connect to the jndi tree.
            env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
            env.put("java.naming.provider.url", "iiop://localhost:18002");But!
    I don't see any of my jcd's when I walk this tree.
    Can anyone tell me why? I'm expecting to see a list of jcds.
    When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
    ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty?

  • Sample weblogic jndi.properties for 7.0...

    I am looking for 2 things:
    1. what weblogic jars are required on the client to make a jndi lookup ?
    ( jndi specific jars )
    2. A sample jndi.properties file for weblogic.
    Thanks
    -- padhu

    I use the following properties to connect to the jndi tree.
            env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
            env.put("java.naming.provider.url", "iiop://localhost:18002");But!
    I don't see any of my jcd's when I walk this tree.
    Can anyone tell me why? I'm expecting to see a list of jcds.
    When I look into the sun-ejb-jar.xml file, I see that I should be able to lookup the deployed service with the following name;
    ic.lookup("java:comp/env/ejb/local/stc/testHarness3Deployment1/deployedServices/CMap1_Collaboration_11")Are my assumptions correct, or is my jndi knowledge faulty?

  • Jndi.properties for WAR trouble

    Hi All.
    To access a remote enterprise bean, I have to populate the required JNDI properties in my web-tier code, when creating the context.
    Trouble how to do this using jndi.properties file ? When I append path of file to CLASSPATH obviously it works (tested using simple session client) but when I deploy my war – properties file is invisible for my delegate. So question : How to include jndi.properties file in classpath for that WAR, or where I have to place it ?

    InitialContext takes care of that already.
    Do you use InitialContext to connect to your own components in the same container too? If so, specify the content of jndi.properties explicitely.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                               

  • Jndi.properties usage

    Hi,
    I've developed an EJB application and a WAR to access it with JBoss which uses the jndi.properties to lookup the "java.naming.provider.url". Everything works fine for now but I don't like including the jndi.properties file inside the War.
    For ease of use I'd like to have as an extra deployment step so you deploy both the WAR and the jndi.properties file so I can change what server it looks at for the EJBs.
    I'm sure this is simple to do through an XML file but I can't seem to find much online about how to go about it.
    Could someone point me in the right direction?
    Cheers,
    Joe.

    Sorry, that was badly worded.
    Basically I want to be able to do something similar to this deployment:
    jboss/server/<instance>/deploy/myWebApp.war
    jboss/server/<instance>/deploy/jndi.properties (for webapp)
    So I can change the server listed in the jndi.properties easily.
    What I have proposed above is obviously wrong as only XML and compressed files can exist in the deploy directory. This leads me to believe that there is an XML solution similar to the way DataSources can be deployed in the JBoss deploy directory.
    At the moment I'm thinking about putting a homemade XML file somewhere are reading it off disk with the jndi information. I want to know if there is a more standard way of doing this.
    Thanks for your response,
    Joe.

  • External JNDI Client, jndi.properties/connection

    How can I lookup up a object
    jms/ConnectionFactory, which I've confirmed is in this namespace with a external java program client.
    I have the Client jars in the class path. It connects, tries to lookup jms/ConnectionFactory.
    But I get
    javax.naming.NameNotFoundException. Root exception is
    org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
         at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
         at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
         at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
         at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
    jndi.properties are:
    java.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
    java.naming.provider.url=iiop://localhost:3700
    java.naming.factory.url.pkgs=com.sun.enterprise.naming
    If I connect from a web-app, I can lookup the object via java:comp/env/jms/ConnectionFactory

    one way is to not use the java:comp/env context and use the <jndi-name> listed in
    a sun-[ejb/web].jar.
    example of ejb lookup from rich standalone client.
    Properties env = new Properties();
    //Sun App server 7 specific
         env.put("java.naming.factory.initial",
              "com.sun.jndi.cosnaming.CNCtxFactory");
         env.put("java.naming.provider.url", "iiop://localhost:3700");
    System.out.println("ENV stuff done");
         Context initial = new InitialContext(env);
    System.out.println("new initial env done");
         Object objref = initial.lookup("ConfigManager"); <---- this is the actual
    jndi name in sun-ejb-jar.xml.
    <ejb>
    <ejb-name>ConfigManager</ejb-name>
    <jndi-name>ConfigManager</jndi-name>
    a datasource resource would be
    <resource-ref>
    <res-ref-name>jdbc/OracleDS</res-ref-name>
         <jndi-name>jdbc/OracleDS</jndi-name>
    so Object objref = initial.lookup("jdbc/OracleDS"); would work for a datasource.

  • Jndi.properties in the class path

    Hi,
    i deployed a webservice to the embedded oc4j in JDEV(10.1.3).
    Form this webservice an external oc4j (9.0.4) is looked up.
    First problem:
    I have some problems to initial the InitialContext. It seems to me that the jndi.properties file is not found.
    I think its perhaps a classloader problem.
    Second problem:
    If i hardcode the props, the extarnal oc4j is connected, but the lookup hangs up.
    May be it a the different versions are the problem.
    Any help appriciated.
    Thanks and regads
    Chris

    Ok. I finally i found a solution for the second problem, after i could take a look into the logs of the external oc4j.
    Thanks to heimberger and his blog.
    In 10.1.3 there where some changes to ormi (new protocol version 1.3). For a communication between 10.1.3 and older versions of oc4j a patch is needed. Its metalink 4676768. The older version must be able to negotiate the version of ormi.
    Hope that will do the job.
    But i still can not make the 10.1.3 embedded oc4j take the jndi.properties from the application classpath.
    I wonder if nobody has had the same problem.
    Regards
    Chris

  • Problem in Jndi lookup for  ITaskService

    HI,
    I am trying to initiate oracle bpm Human task programatically by using Java remotely.
    for this I am using following JNDI lookup for ITaskService.
    Hashtable ht = new
                  Hashtable<IWorkflowServiceClientConstants.CONNECTION_PROPERTY,java.lang.String>();
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY, 
                     "weblogic.jndi.WLInitialContextFactory");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:7001");
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "username"); 
              ht.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "password");
              Context ctx  = new InitialContext(ht);
    ITaskService taskService = (ITaskQueryService)ctx.lookup("ejb/bpel/services/workflow/TaskServiceBean");
    taskService.initiateTask(task);
    It the right approach or not.
    Please help.

    To access human workflow api remotely try using the following code :
    Map properties = new HashMap();
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL, "t3://localhost:8001");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_CREDENTIALS, "welcome1");
      properties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_SECURITY_PRINCIPAL, "weblogic");
    IWorkflowServiceClient wfSvcClient =
      WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT, properties, null);
      //Get the task query service
      ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
      //Login as weblogic
      IWorkflowContext ctx = querySvc.authenticate("weblogic","welcome1".toCharArray(),null);
    after getting the workflow context, you can call any method like query task list. perform actions etc. just see the api doc.
    Regards,
    Anshul

  • Application specific key-value pairs in jndi.properties

    Hello,
    Can I specify my application specific key-value pair in jndi.properties?
    I tried something like this
    java.naming.factory.initial=.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    myVar=myVal
    When i tried looking up "myVar" from my client program, I got an error.
    The other parameters like weblogic.jndi.WLInitialContextFactory are picked up.
    Anyhelp will be appreciated
    Vasim

    We have a similar problem.
    We would like to configure our PROVIDER_URL for a specific web application - not
    for the entire server. Since the URL should be different in development, test
    and production environments, we would prefer to just set it in the deployment
    descriptor. And we have a lot of code that just uses
    ctx = new InitialContext();
    when looking up EJBs, queues etc.
    Actually, to take the problem one step further, it should be expected that later
    we will have EJB's deployed on different machines/clusters - so we will actually
    need specific urls for each EJB.
    Is there a good way to do this? Or will we have to custom-develop our own jndi
    configuration standard using application parameters to set which JNDI provider
    each EJB should be looked up with?
    Alternativaely, can we "import" the JNDI trees of the app server in the JNDI tree
    of the web servers?
    So, how should we go about this?
    Robert Patrick <[email protected]> wrote:
    Vasim wrote:
    Hi Robert,
    You are right. But The object "myVar" which I am trying to look upis not in
    the JNDI tree nor am I interesed in binding it . But my requirementis that
    I have one application specific variable which I am trying to lookup and I
    dont want to have a separare config file for this..and hence the question..So, put the properties you want in the jndi.properties file and load
    the properties
    file from your code by doing something like this:
    Properties props = new Properties();
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null)
    cl = System.getSystemClassLoader();
    InputStream is = cl.getResourceAsStream("jndi.properties");
    props.load(is);
    Personally, I would not use this file and would create an application-specific
    file
    or, as Daniel suggested, define your properties as a System property
    and use
    System.getProperty("myVar").
    btw, is jndi.properties only for those objects which are bound to jnditree?
    jndi.properties is only used for creating the JNDI InitialContext. The
    whole idea
    of this file is that in remote client code (without the jndi.properties
    file), you
    need to do something like this to tell the JNDI classes how to connect
    to the JNDI
    provider:
    Properties props = new Properties();
    props.put(Context.PROVIDER_URL, "t3://myservername:7001");
    props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    InitialContext ctx = new InitialContext(props);
    but inside the server, you only need to do this because the server is
    the provider
    and already knows how to connect to itself:
    InitialContext ctx = new InitialContext();
    Therefore, the jndi.properties file allows you to externalize this property-setting
    code that sets up the properties to be passed to the InitialContext constructor
    so
    that the remote client code can now look exactly like the code inside
    the server.
    The InitialContext constructor will look for this jndi.properties file
    in your
    classpath and load it to get the necessary configuration information
    to determine
    how to connect to the JNDI provider.
    Hope this helps,
    Robert

  • What needs to be in my jndi.properties file to get oracle accessed by a jndi client

    I am trying to write a connection pool class that use jndi
    to locate the data base. I use "bindds" bind my OracleDataSource
    object with the name of 'test/jdbc/test'. I should then be able to do a lookup like: OracleDataSource ods =
    (OracleDataSource) ctx.lookup (test/jdbc/test)
    All Oracle code examples use (Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.fscontext.RefFSContextFactory");
    Is this correct? And what other things should be in my jndi.properties file to access the naming service with comes with
    Oracle (Jserver)? For example to I need to include a Context.PROVIDER_URL value. I would think Oracle would have some
    standard way of accessing its own Naming service. Thanks David

    This implies that ODP.NET does NOT need to be installed on a client. However, I cannot find OraOPs9.dll on a machine with Client Release 9.2 installed. Should OraOps?.dll automatically come with a Client installation of 9.2 or higher?
    ODP.NET needs to be installed on the client. OraOps9.dll is part of ODP.NET, not the Oracle Client.
    Also, if an application is built with the 10g ODP.NET, can it be run from a machine with OraOps9.dll?
    If an application is built with 10g ODP.NET, it can be run with 9.2 ODP.NET as long as you do not use any 10g APIs. The new features in 10g ODP.NET are included in the doc and the ODP.NET FAQ for your reference.

  • Connection Properties for the BI JDBC Connector

    Hi
    I am trying to configure BW 3.5 java component. In the Connection Properties for the BI JDBC Connector, there are four required properties. (UserName, Password, URL and DRIVERNAME) What should I enter for the URL and DRIVERNAME? I am using Oracle920.
    Please help,
    JW

    I found this info at
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
    Oracle is replacing the SID mechanism for identifying databases with a new services approach. This has been available in the database since 8.1.7. JDBC now supports services in the connect URL. 
    The basic format of a service URL is:
    jdbc:oracle:thin:[<user>/<password>]@//<host>[:<port>]/<service>
    jdbc:oracle:oci:[<user>/<password>]@//<host>[:<port>]/<service>
    Examples:
    jdbc:oracle:thin:@//myserver.com/customer_db
    jdbc:oracle:oci:scott/tiger@//myserver.com:5521/customer_db

  • Authentication using userCertificate and SASL External

    hi!
    I try to authenticate using SASL "External" and SSL.
    The SSL connection works fine, also SASL when using "Digest-MD5" but when I try to authenticate using "External" I get connected as anonymous.
    Here is what I did:
    I created a self-signed certificate with owner "uid=xyz,ou=OrgUnit1,ou=OrgUnit2,o=Org".
    My client has this certificate in it's keystore.
    The server has an entry with "dn=uid=xyz,ou=OrgUnit1,ou=OrgUnit2,o=Org" an this entry has the userCertificate attribute, which also contains my self-signed certificate.
    I edited the "certmap.conf" file like this:
    certmap default default
    default:DNComps
    default:FilterComps uid
    default:verifycert on
    As I understood the manual, this means the server should search the directory for an RDN "uid=xyz" and check if the certificate of this user is the same as the one provided by the client. If it is, the client should get the permissions of this entry.
    But in the logfile I always get this message:
    conn=4 fd=1148 slot=1148 SSL connection from 172.16.0.190 to 172.16.0.190
    conn=4 SSL 128-bit RC4
    conn=4 op=0 BIND dn="" method=sasl version=3 mech=EXTERNAL
    conn=4 op=0 RESULT err=0 tag=97 nentries=0 etime=0 dn=""
    conn=4 op=1 SRCH base="uid=xyz,ou=OrgUnit1,ou=OrgUnit2,o=Org" scope=0 filter="(objectClass=*)" attrs="entryid"
    conn=4 op=1 RESULT err=0 tag=101 nentries=1 etime=0
    conn=4 op=2 fd=1148 closed - A1
    So, one possibility is I understood something completly wrong and the other is the server doesn't find the entry "uid=xyz,ou=OrgUnit1,ou=OrgUnit2,o=Org" because of any misconfiguration or I need a user certificate, which has been issued by a CA...
    Can anyone help me?
    Thanks a lot!
    Florian

    Nikolay,
    Assuming you mean authenticaion to your developed application and not the HTML DB facilities, yes you can do that. Take a look at the custom_page_sentry function that appears on this forum in several threads, e.g., Re: NTLM with Cookies ... - is someone there After you change this function to meet your requirements (cookie names, etc.) and compile it in your application's schema, you'd create a new authentication schema and type 'return custom_page_sentry;' into the page sentry function field. Then enter a URL to your site's login page into the Invalid Session URL field. Then make the new authentication scheme the current scheme. Of course, with this solution, you are responsible for making it as secure as you need it to be, preventing cookie forgery/theft, etc.
    Scott

  • Jndi.properties

    Hi Folks!
    First of all, please excuse my bad english ;-)
    Our problem:
    We have a Struts based web application running under OC4J 10g. We want to access our EJB's which are deployed on an other OC4J container. To do this, we have put our jndi.properties file in /WEB-INF/classes , but then we try to retrieve the initial context, the file is not loaded (this works this Tomcat etc.). The same, then we put this file into /WEB-INF/lib. After this, we monitored there the files has been searched: only at $J2EE_HOME/applib. Why??? Is there a way how we can say there to search for this file? We will pack the jndi.properties into the WAR file.
    Any suggestions?
    Thanks!

    Halil-Cem,
    Please excuse me for posting two years late, but I was searching the forum archives for "jndi.properties" and came across your post.
    You asked:
    Is there a way how we can say there to search for this file?Yes, through the "orion-web.xml" file. Mine has the following entry:
    &lt;!-- Uncomment this element to control web application class loader behavior.
        <web-app-class-loader search-local-classes-first="true"  include-war-manifest-class-path="true" />
    -->Hope it helps.
    Good Luck,
    Avi.

  • JMS destination and queue in jndi.properties

    I am using activemq to create a very simple jms application.
    But there is a point I have not understand.The administered connection factory object that I use is org.activemq.jndi.ActiveMQInitialContextFactory which is the ActiveMq specific object. Do I have to do the same with the destination object?I read that Destination is also an administered object so I have to use an object of the ActiveMq? Specifically in the jndi properties where I define the queue property the value must be:
    1.an activeMq object
    2.a java class that implements the javax.jsm.Queue interface
    3.a physical name of another server?
    and in the code where I look up the destination object
    Destination destination = (Destination) jndiContext.lookup(queueProp);What exactly will be the queueProp? I would appreciate an example
    Thanking you in advance.

    I've read the documentation but I am afraid I miss some points.
    First of all I use the following code from an example in the net where the <b> activemq.jar is >/b> used and the jndi.properties is not used at all and the following code is working:package jms;
    import org.activemq.ActiveMQConnectionFactory;
    import javax.jms.Connection;
    import javax.jms.DeliveryMode;
    import javax.jms.Destination;
    import javax.jms.ExceptionListener;
    import javax.jms.JMSException;
    import javax.jms.Message;
    import javax.jms.MessageConsumer;
    import javax.jms.MessageProducer;
    import javax.jms.Session;
    import javax.jms.TextMessage;
    * Hello world!
    public class App {
        public static void main(String[] args) throws Exception {
            thread(new HelloWorldBroker(args), true);
            Thread.sleep(1000);
            thread(new HelloWorldProducer(), false);
            thread(new HelloWorldProducer(), false);
            thread(new HelloWorldConsumer(), false);
            Thread.sleep(1000);
            thread(new HelloWorldConsumer(), false);
                   Thread.sleep(1000);
            thread(new HelloWorldConsumer(), false);
            thread(new HelloWorldProducer(), false);
                    Thread.sleep(1000);
                 thread(new HelloWorldProducer(), false);
            thread(new HelloWorldConsumer(), false);
        public static void thread(Runnable runnable, boolean daemon) {
            Thread brokerThread = new Thread(runnable);
            brokerThread.setDaemon(daemon);
            brokerThread.start();
        public static class HelloWorldBroker implements Runnable {
            private final String[] args;
            public HelloWorldBroker(String[] args) {
                this.args = args;
            public void run() {
                org.activemq.broker.impl.Main.main(args);
        public static class HelloWorldProducer implements Runnable {
            public void run() {
                try {
                    // Create a ConnectionFactory
                    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
                    // Create a Connection
                    Connection connection = connectionFactory.createConnection();
                    connection.start();
                    // Create a Session
                    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                    // Create the destination (Topic or Queue)
                    Destination destination = session.createQueue("TEST.FOO");
                    // Create a MessageProducer from the Session to the Topic or Queue
                    MessageProducer producer = session.createProducer(destination);
                    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
                    // Create a messages
                    String text = "Hello world! From: " + Thread.currentThread().getName() + " : " + this.hashCode();
                    TextMessage message = session.createTextMessage(text);
                    // Tell the producer to send the message
                    System.out.println("Sent message: "+ message.hashCode() + " : " + Thread.currentThread().getName());
                    producer.send(message);
                    // Clean up
                    session.close();
                    connection.close();
                catch (Exception e) {
                    System.out.println("Caught: " + e);
                    e.printStackTrace();
        public static class HelloWorldConsumer implements Runnable, ExceptionListener {
            public void run() {
                try {
                    // Create a ConnectionFactory
                    ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
                    // Create a Connection
                    Connection connection = connectionFactory.createConnection();
                    connection.start();
                    connection.setExceptionListener(this);
                    // Create a Session
                    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                    // Create the destination (Topic or Queue)
                    Destination destination = session.createQueue("TEST.FOO");
                    // Create a MessageConsumer from the Session to the Topic or Queue
                    MessageConsumer consumer = session.createConsumer(destination);
                    // Wait for a message
                    Message message = consumer.receive(1000);
                    if (message instanceof TextMessage) {
                        TextMessage textMessage = (TextMessage) message;
                        String text = textMessage.getText();
                        System.out.println("Received: " + text);
                    } else {
                        System.out.println("Received: " + message);
                    consumer.close();
                    session.close();
                    connection.close();
                } catch (Exception e) {
                    System.out.println("Caught: " + e);
                    e.printStackTrace();
            public synchronized void onException(JMSException ex) {
                System.out.println("JMS Exception occured.  Shutting down client.");
    }But I want to make it work with jndi.properties.
    So I am trying to use a code where connectionFactory and Destination are loaded from the jndi properties.After experimenting with code
    the following is working
         try {
                   connectionFactory = (ConnectionFactory) jndiContext.lookup("connectionFactory");               
                  Destination destination = (Destination) jndiContext.lookup("QUEUE/MYQUEUE");        
              Connection connection = connectionFactory.createConnection();
              Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);if only I go to the activeqm/bin folder and open the broker.If I did that in the previous code(with no jndi prop)
    there was an exception that was saying that the port was already used.So I do not understand why in the one case opening broker is necessary for the connection and on the other hand it causes a problem.
    Moreover in the case that I invoke broker from bin folder. In this case I would like to ask a question.The activemq.xml is necessary? If yes it is there where we define the queue?
    If not where else apart from the jndi.properties do we define queue?
    Please if is possible provide me with an example of the necessary places that we define a queue.
    Thank you

Maybe you are looking for

  • BDC issue

    Hi All, we have written a bdc for material upload for Tcode MMZ1. all works fine till the Accounting screen where we have to give the valuation type as D. (MBEW-BWTTY). and the Costing Screen we have to manually give enter to cross these screens and

  • How can I move my itunes purchases to a different computer?

    How can I move all of my itune purchases on my old computer to my new computer?

  • How exclude QM in certain cases

    1)In normal cases they are purchasing  a material and created inspection lot (with movement type 103) and taking usage decision(if accepted ,will go to unrestricted(105) otherwise returned with 124) How ever if the same material purchased from anothe

  • BATTERY DRAIN and CUSTOMER SERVICE UNACCEPTABLE

    I BOUGHT THE BLACKBERRY Z 10 AT 699,00 € BUT I'M DEFINITELY NOT SATISFIED. CUSTOMER SERVICE DOESN'T EXIST: ONLY VIA FORUM The battery lasts 5 HOURS I HAVE BOUGHT THIS SMARTPHONE FOR WORK I HAVE SPENT € 699 POOR SOFTWARE, APPLICATIONS FEW BUT THIS COU

  • How can I delete history and cookies without opening safari?

    seems like I may have virus, a website keeps popping up and says I may have an infection and I am to call a number. If I close safari, when I reopen it that same website automatically opens up. I can't get to the menu to delete cookies or history as