1) I have been trying to use a standalone JMS sender. 

import javax.jms.*;
import javax.naming.*;
              
public class MessageToQueue
{
   public static void main(String[] args) 
   throws NamingException,JMSException
   {
      InitialContext ctx;
      QueueConnectionFactory cf;
      QueueConnection connection;
      QueueSession session;
      Queue destination;
      QueueSender sender;
      TextMessage message;
      ctx = new InitialContext();
      cf = (QueueConnectionFactory)ctx.lookup("java:/QueueConnectionFactory");
      System.out.println("1");
      destination = (Queue)ctx.lookup("queue/testQueue");
      System.out.println("2");
      connection = cf.createQueueConnection();
      System.out.println("3");
      session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
      System.out.println("4");
      sender = session.createSender(destination);
      System.out.println("5");
      message = session.createTextMessage();
      System.out.println("6");
      message.setText("Hello World!");
      
      System.out.println("Sending Message.");
      sender.send(message);
   
      connection.close();
      System.out.println("Done.");
   
   }
}

2) I have the following in the JNDI properties in 
C:\jboss-4.0.3SP1\server\default\conf:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099

3) I have the following in the jboss-service.xml in 
C:\jboss-4.0.3SP1\server\default\conf:
  
    <!-- The listening port for the bootstrap JNP service. Set this to -1
      to run the NamingService without the JNP invoker listening port.
    -->
    1099
  

4) JBOSS server is on port 8080. Started the server

5) Executed this in command "java MessageSender"
Got this error:
Exception in thread "main" javax.naming.NameNotFoundException: 
QueueConnectionFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at java.naming.InitialContext.lookup(InitialContext.java:351)
at MessageToQueue.main(MessageToQueue.java:17)

Could you let me know what is the exact problem? Thanks

Regards
Shriram 







View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3937557#3937557

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3937557


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to