1 Reply Latest reply: May 28, 2012 11:41 AM by Andy Taylor RSS

Context lookup with JBoss AS7

Laura delli Paoli Apprentice

Hello Everybody,

Im' trying to develop a simple producer consumer application with JBoss and HornetQ.

My problem is that I get a "Class not found exception" when I perform the "lookup" method.

Here are some lines from my init() method:

 

  Hashtable<String, String> env = new Hashtable<String, String>();

                              env.put(Context.INITIAL_CONTEXT_FACTORY          , "org.jnp.interfaces.NamingContextFactory");

                              env.put(Context.PROVIDER_URL                              , "jnp://localhost:1099");

 

                              //Jboss context reference

                              initContex_ = new InitialContext(env);

                              queue_ = (javax.jms.Queue)initContex_.lookup(HelloQueue);

 

I read that in JBoss AS7 i cannot use jnp.

Can anyone suggest me how to create a working initial context?

 

Thanks

Laura

 

I attached my JBoss Configuration.