aspose file tools*
The moose likes Websphere and the fly likes Having problems finding mqseries queues in java bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Having problems finding mqseries queues in java bean" Watch "Having problems finding mqseries queues in java bean" New topic
Author

Having problems finding mqseries queues in java bean

Alan Rushforth
Greenhorn

Joined: Nov 15, 2002
Posts: 5
Hi,
I have written a java bean that puts a message onto an mqseries queue. I now want to be able to access this from a JSP. I have had a go but am having problems. I am using the file system context for the JNDI lookups and although they work when i use the bean in a java app it cannot find an initial context when accessed from a JSP.
I am fairly new to this so could someone give me a few pointers. Such as what needs to be done to make the bean accessible from a JSP. Does it need to be an EJB etc?
I have not deployed the bean as a web component or anything because i am not sure if i need to or why?
The code for my bean is as follows.

Thanks for any help.
Alan
Simon Song
Ranch Hand

Joined: Feb 01, 2002
Posts: 217
What's your exception? And have you put MQ JMS jars in your appserver's classpath, so your JSP can find it?
http://www-106.ibm.com/developerworks/ibm/library/i-jms2/


Simon Song
Certified Entperise Developer of Websphere
Alan Rushforth
Greenhorn

Joined: Nov 15, 2002
Posts: 5
My exception is as follows:

The fscontext is on the classpath as is the provider jar. The bean worked fine when called from an app so i dont think it is a problem with the class path unless the class path is inaccessible when the bean is called from a JSP.
Cheers for the help,
Alan
Alan Rushforth
Greenhorn

Joined: Nov 15, 2002
Posts: 5
Hi Again,
I have solved that problem.
I had the files in the system classpath but not in tomcat classpath.
Have copied all jar files to lib directory of tomcat and t works now.
I do however have a new problem.
It now sends the message ok but the JSP will not disconnect from the queue until i close down tomcat.
I receive the message
"Unable to load message catalog - mqji"
I have seen on the net that it is possible to get a more detailed error message if i add the directory that mqji.properties is in to the tomcat classpath but i dont know how to do this.
Currently tomcat is loading the jar files itself but i dont know how to get it load the whole directory.
Any ideas?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Having problems finding mqseries queues in java bean