• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Having problems finding mqseries queues in java bean

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
and POOF! You're gone! But look, this tiny ad is still here:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic