File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having problems finding mqseries queues in java bean

 
Alan Rushforth
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 217
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
Alan Rushforth
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic