7 Replies Latest reply: May 5, 2012 4:41 PM by EJP RSS

    Problem with the JNDI properties while executing a client test

      Hello Everybody,
      I'm trying to learn Jdeveloper, and I have followed the tutoriel " Learn Oracle Fronn Oracle" Volum 2, so i am trying to create a simple oriented bean message with EJB 3.0, and a client test to deliver a message, and the problem is that i can't display my message in the Embedded OC4J WINDOW.

      This is the errors displayed:


      D:\jdevstudio10132\jdk\bin\javaw.exe -client -classpath D:\jdevstudio10132\EJB30MDB\SimpleMDB\classes;D:\jdevstudio10132\j2ee\home\lib\ejb30.jar;D:\jdevstudio10132\j2ee\home\lib\activation.jar;D:\jdevstudio10132\j2ee\home\lib\ejb.jar;D:\jdevstudio10132\j2ee\home\lib\jms.jar;D:\jdevstudio10132\j2ee\home\lib\jta.jar;D:\jdevstudio10132\j2ee\home\lib\mail.jar;D:\jdevstudio10132\j2ee\home\lib\servlet.jar;D:\jdevstudio10132\rdbms\jlib\aqapi.jar;D:\jdevstudio10132\toplink\jlib\toplink-essentials.jar;D:\jdevstudio10132\j2ee\home\oc4j.jar;D:\jdevstudio10132\j2ee\home\oc4jclient.jar;D:\jdevstudio10132\j2ee\home\lib\javax77.jar -Dhttp.proxyHost= -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=localhost||doi-sonia -Dhttps.proxyHost= -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=localhost||doi-sonia oracle.mdb.jmsclient.TestJMSClient
      Looking up TCF
      javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
           at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:292)
           at com.evermind.server.rmi.RMIClientContext.lookup(RMIClientContext.java:51)
           at com.evermind.naming.FilterContext.lookup(FilterContext.java:126)
           at com.evermind.server.ApplicationClientContext.lookup(ApplicationClientContext.java:63)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at oracle.mdb.jmsclient.TestJMSClient.main(TestJMSClient.java:20)
      Caused by: java.net.ConnectException: Connection refused: connect
           at java.net.PlainSocketImpl.socketConnect(Native Method)
           at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
           at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
           at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
           at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
           at java.net.Socket.connect(Socket.java:507)
           at java.net.Socket.connect(Socket.java:457)
           at java.net.Socket.<init>(Socket.java:365)
           at java.net.Socket.<init>(Socket.java:207)
           at com.evermind.server.rmi.RMIClientConnection.createSocket(RMIClientConnection.java:682)
           at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(ClientSocketRmiTransport.java:58)
           at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(ClientRmiTransport.java:78)
           at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(ClientSocketRmiTransport.java:68)
           at com.evermind.server.rmi.RMIClientConnection.connect(RMIClientConnection.java:646)
           at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(RMIClientConnection.java:190)
           at com.evermind.server.rmi.RMIClientConnection.lookup(RMIClientConnection.java:174)
           at com.evermind.server.rmi.RMIClient.lookup(RMIClient.java:283)
           ... 5 more
      Process exited with exit code 0.


      and and there is the TestJMSClient code:


      package oracle.mdb.jmsclient;

      import javax.jms.Connection;
      import javax.jms.ConnectionFactory;
      import javax.jms.Destination;
      import javax.jms.Message;
      import javax.jms.MessageProducer;
      import javax.jms.Session;
      import javax.jms.Topic;
      import javax.naming.InitialContext;

      public class TestJMSClient {

      public static void main(String[] args) {

      try {
      System.out.println("Looking up TCF");
      ConnectionFactory connectionFactory =
      (ConnectionFactory) new InitialContext()
      Connection connection = connectionFactory.createConnection();
      System.out.println("Starting Topic Session");
      Session topicSession = connection.createSession(false,
      Destination topic = (Destination)new InitialContext().lookup("jms/demoTopic");
      MessageProducer publisher = topicSession.createProducer(topic);
      Message message = topicSession.createMessage();
      message.setLongProperty("time", System.currentTimeMillis());
      message.setStringProperty("subject", "Test EJB 3.0 MDB");
      "Test message Send to first EJB 3.0 MDB");
      .println("Message Sent to JMS Topic, Check Server Console to See whether MDB got activated!");
      }catch (Throwable ex) {



      I am not sure if the JNDI properties should have a correct configuration to make this application work:




      Above, it's the code given by the tutoriel, i change welcome by my pass word, but the problem still existing.

      Any idea or help would be greatful
        • 1. Re: Problem with the JNDI properties while executing a client test
          javax.naming.CommunicationException: Connection refused: connect [Root exception is java.net.ConnectException: Connection refused: connect]
          This exception has exactly one meaning. Nothing is listening at the host:port you specified.
          • 2. Re: Problem with the JNDI properties while executing a client test
            Thanks for answering, did you mean: 23891, mentioned in this line:


            Could 'i specify another one and what can i put rather than it?
            • 3. Re: Problem with the JNDI properties while executing a client test
              Not being able to see your system and know what is or isn't listening at every port, I don't see how you can reasonably expect anyone here to answer that.
              • 4. Re: Problem with the JNDI properties while executing a client test
                I use Oracle Jdeveloper , Oracle 10g(10.2) Express Edition and PL/SQL Developer V:, XP as OS .
                this is my netstat-a cmd, i expect you can answer, if you want any information about my system, ask me and i will answer you, thanks a lot:

                Connexions actives

                Proto Adresse locale Adresse distante Etat
                TCP est-tatia:epmap est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:microsoft-ds est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1053 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1110 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1521 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:8888 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:9127 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:19780 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:23791 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:23943 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:netbios-ssn est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1056 est-tatia.ABL.local:1521 ESTABLISHED
                TCP est-tatia:1059 ESTABLISHED
                TCP est-tatia:1387 TIME_WAIT
                TCP est-tatia:1388 TIME_WAIT
                TCP est-tatia:1390 TIME_WAIT
                TCP est-tatia:1391 TIME_WAIT
                TCP est-tatia:1521 est-tatia.ABL.local:1056 ESTABLISHED
                TCP est-tatia:1038 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1044 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:1132 localhost:1521 ESTABLISHED
                TCP est-tatia:1137 localhost:1138 ESTABLISHED
                TCP est-tatia:1138 localhost:1137 ESTABLISHED
                TCP est-tatia:1139 localhost:1140 ESTABLISHED
                TCP est-tatia:1140 localhost:1139 ESTABLISHED
                TCP est-tatia:1385 localhost:1386 ESTABLISHED
                TCP est-tatia:1386 localhost:1385 ESTABLISHED
                TCP est-tatia:1389 localhost:23791 ESTABLISHED
                TCP est-tatia:1521 localhost:1132 ESTABLISHED
                TCP est-tatia:8080 est-tatia.ABL.local:0 LISTENING
                TCP est-tatia:23791 localhost:1389 ESTABLISHED
                TCP est-tatia:30523 est-tatia.ABL.local:0 LISTENING
                UDP est-tatia:microsoft-ds *:*
                UDP est-tatia:isakmp *:*
                UDP est-tatia:1025 *:*
                UDP est-tatia:1026 *:*
                UDP est-tatia:1151 *:*
                UDP est-tatia:4500 *:*
                UDP est-tatia:15000 *:*
                UDP est-tatia:15001 *:*
                UDP est-tatia:ntp *:*
                UDP est-tatia:netbios-ns *:*
                UDP est-tatia:netbios-dgm *:*
                UDP est-tatia:1900 *:*
                UDP est-tatia:ntp *:*
                UDP est-tatia:1027 *:*
                UDP est-tatia:1048 *:*
                UDP est-tatia:1287 *:*
                UDP est-tatia:1289 *:*
                UDP est-tatia:1900 *:*
                • 5. Re: Problem with the JNDI properties while executing a client test
                  this is my netstat-a cmd
                  In which port 23891 does not appear.

                  My case rests.
                  • 6. Re: Problem with the JNDI properties while executing a client test
                    Excuse me but i dont understand what you mean by "In which port 23891 does not appear".
                    Did you want to ask me why the port 23891 is not appear? if that is your question, my answer will be: i dont know.
                    • 7. Re: Problem with the JNDI properties while executing a client test
                      I didn't 'want to ask you' anything. I noted that the port number in your source code does not appear in the netstat output, so there is nothing listening at that port, which bears out my initial answer. Either the service you are trying to connect to isn't running at all, or it's listening at a different port, or it's running and listening at that port in a different host.