Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Standalone JMS client in SJS App Server 8.0

843833May 11 2005 — edited Jun 1 2005
Hi

I am trying to retrieve a message from a JMS queue from astandalone client.

The code the client uses to lookup JMS resources is:
try
{
/* Create the object of InitialContext interface */
Properties env = new Properties( );

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL,"iiop://localhost:3700");


jndiContext = new InitialContext(env);


/* Find the connection factory object */
QConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("jms/QConnectionFactory");


/* Find the queue */
queue = (Queue) jndiContext.lookup("jms/Queue");
}
catch (NamingException e)
{
System.out.println("Error: " + e.toString());
}

The code throws the following exception:
Error: javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.N
amingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
Exception in thread "main" java.lang.NullPointerException
at QReceiver.main(QReceiver.java:51)

What might be the problem? Pls help. The code works fine when executed as an Application client of SJS Appserver without using the JNDI Context part.

Thanks in advance
JLRocky
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2005
Added on May 11 2005
2 comments
154 views