Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI Context problem

 
Ram Kas
Ranch Hand
Posts: 83
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to do a lookup of JMS Queue , I get the following error:

Could not create JNDI API context: javax.naming.NoInitialContextException: Cannot instantiate class: com.ibm.websphere.naming.WsnInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.ibm.websphere.naming.WsnInitialContextFactory]

My Code is as follows:



Can any body let me know where I am going wrong? Do I need to set any classpath for it to work?

Thanks
Dinakar.K
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar containing this file seems to not be on your classpath:

com.ibm.websphere.naming.WsnInitialContextFactory

Find that class, and you should be good.

-Cameron McKenzie
 
Ravi Nikam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which server version you are using there? if 6.1 then check properties might be you need this :

< !-- IBM ORB Properties -->
property name="org.omg.CORBA.ORBClass" value="com.ibm.CORBA.iiop.ORB"

else check for that perticular class and load thar JAR to classpath.

good luck ...
[ January 30, 2008: Message edited by: Ravi Nikam ]
 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have this problem too, and I am trying to configure WAS 6 and 7 to use Apache ActiveMQ to create and use a Queue.
The code I am using is pretty similar to the one posted here in the first post, and I get an error when the code reaches this line:



This is the error:



The code above runs on Websphere where I have defined a QueueConnectionFactory and a Queue named "jms/systemMessageQueue" which exists on ActiveMQ (up and running).

I really don't understand why this happens, even if I tried to add the jar file to the classpath as suggested.

Can somebody help me please?
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add MQ client jars to your app classpath. You can find some MQ client jars inside the MQ connector in WebSphere at ${WEBSPHERE_HOME}/AppServer/installedConnectors the MQ libs are inside the .rar file called: wmq.jmsra.rar



 
Francesco Bellini
Ranch Hand
Posts: 38
Linux Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, it seems that it was a bug of activemq. The snapshot version 5.8.0 seems to be bug free as regard such problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic