Forum Stats

  • 3,854,501 Users
  • 2,264,372 Discussions


Problem with the JNDI properties while executing a client test

934472 Member Posts: 4
edited May 5, 2012 5:41PM in Java Message Service (JMS)
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 Connection refused: connect]
at com.evermind.server.rmi.RMIClient.lookup(
at com.evermind.server.rmi.RMIClientContext.lookup(
at com.evermind.naming.FilterContext.lookup(
at com.evermind.server.ApplicationClientContext.lookup(
at javax.naming.InitialContext.lookup(
at oracle.mdb.jmsclient.TestJMSClient.main(
Caused by: Connection refused: connect
at Method)
at com.evermind.server.rmi.RMIClientConnection.createSocket(
at oracle.oc4j.rmi.ClientSocketRmiTransport.createNetworkConnection(
at oracle.oc4j.rmi.ClientRmiTransport.connectToServer(
at oracle.oc4j.rmi.ClientSocketRmiTransport.connectToServer(
at com.evermind.server.rmi.RMIClientConnection.connect(
at com.evermind.server.rmi.RMIClientConnection.sendLookupRequest(
at com.evermind.server.rmi.RMIClientConnection.lookup(
at com.evermind.server.rmi.RMIClient.lookup(
... 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


  • EJP
    EJP Member Posts: 32,920 Gold Crown
    javax.naming.CommunicationException: Connection refused: connect [Root exception is Connection refused: connect]
    This exception has exactly one meaning. Nothing is listening at the host:port you specified.
  • 934472
    934472 Member Posts: 4
    Thanks for answering, did you mean: 23891, mentioned in this line:


    Could 'i specify another one and what can i put rather than it?
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    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.
  • 934472
    934472 Member Posts: 4
    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 *:*
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    this is my netstat-a cmd
    In which port 23891 does not appear.

    My case rests.
  • 934472
    934472 Member Posts: 4
    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.
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    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.
This discussion has been closed.