Hi,

We are having the following error when we try to communicate to Jboss 4.0 via 
JNDI. Here is my code. Can anybody help me out with this ?
public SimpleSender() {
                
                try {
                        
                        QueueConnectionFactory myQConnFactory;
                        Queue myQueue;
                        Properties properties = new Properties();
                        
properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
                        
properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
                        
properties.put(Context.PROVIDER_URL,"jnp://localhost:1099");
                        Context ctx = new InitialContext(properties);
                        myQConnFactory = (QueueConnectionFactory) 
ctx.lookup("java:/ConnectionFactory");
                        myQueue = (Queue) ctx.lookup("queue/testQueue");
                        ctx.bind("SimpleSender",myQueue);
                        QueueConnection con = 
myQConnFactory.createQueueConnection();
                        QueueSession session = 
con.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
                        TextMessage textMessage = session.createTextMessage();
                        QueueSender sender = session.createSender(myQueue);
                        con.start();
                        for(int i=0;i<10;i++){
                                textMessage.setText("Hello World " + i );
                                sender.send(textMessage);  
                        }
                        con.close();
                        ctx.close();
                } catch(Exception ex) {
                        ex.printStackTrace() ;
                }
        }

Is there anything that I missing out. 

Jagdish

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to