• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Having Trouble Setting Up An MDB

 
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey folks,

I'm trying to get a Message Driven bean (and a simple servlet to test it) up and running in WSAD, but I'm having problems. I was hoping someone here would be able to help me out.

First of all, I know little about this stuff, but Jeanne Boyarsky pointed me to this article about setting up MDB's in WSAD. My version of WSAD is a little newer (5.1.2) so the screens weren't exactly the same in all cases, but they were pretty close.

Anyway, I went through that entire article and tried to do everything it said, but I'm not getting errors when I try to start my server and/or run the application.

Upon startup of the server, I see this in the console:



If I go ahead and try to run my servlet, which has this code in it:



I then end up with this output:



At that point, I get another exception:

com.ibm.websphere.naming.CannotInstantiateObjectException:
Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object.
Root exception is javax.naming.NameNotFoundException: jms/MyMDBQueue.
Root exception is org.omg.CosNaming.NamingContextPackage.NotFound

I know that this is a long post with a whole mess of stuff, but I'm quite lost with this stuff. Unfortunately, there's no one else in the office that has any experience with this stuff, either, so I guess it's up to me to get it figured out. Any advice you could give would be greatly appreciated.

Thanks,
Corey

[ November 18, 2004: Message edited by: Corey McGlone ]
[ November 19, 2004: Message edited by: Corey McGlone ]
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Corey,
Not sure what is causing the problem, but I have a troubleshooting suggestion. Try looking in the UTC (universal test client) and try to navigate to the JMS queue and connection factory entries. In particular, look if they are misplaced or spelled wrong.

If they are there and correct, that tells you there is a problem in the web resource references. If they are missing or incorrect, that tells you there is a problem in the server configuration.
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jeanne Boyarsky:
Corey,
Not sure what is causing the problem, but I have a troubleshooting suggestion. Try looking in the UTC (universal test client) and try to navigate to the JMS queue and connection factory entries. In particular, look if they are misplaced or spelled wrong.

If they are there and correct, that tells you there is a problem in the web resource references. If they are missing or incorrect, that tells you there is a problem in the server configuration.




Jeanne,

Thanks for all the help. I'm totally clueless as to what I'm doing here and, as is usually the case, I have a deadline looming for which I need to get this done.

I got into the UTC (also a first for me) and did my best to navigate to the JMS entries. I found this:



So it looks like the JMS entries are there and correct, right? However, if I put in the name "jms/MyMDBQueue" or "jms/MyMDBConnectionFactory" in the JNDI Name field and press Lookup, I get errors taht look like this:


IWAD0402E Could not perform lookup with the JNDI name: jms/MyMDBQueue

and

IWAD0401E Unknown type of JNDI object



Should that work? I have to say that I know nothing about the UTC so I don't even know if what I'm doing is correct. But, from what I see, it looks like the Connection Factory and Queue are there, but my lookup to those items fails. Any ideas?

Thanks.
[ November 19, 2004: Message edited by: Corey McGlone ]
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I think I might have found a problem...now I just need to figure out how to fix it.

If you look at the above screen shot, you can see that the type of MyMDBQueue is com.ibm.mq.jms.MQQueue. Meanwhile, in my Web Deployment Descriptor for my web project, the type of jms/MyQueueRef is javax.jms.Queue. My guess is that those classes should probably match and, right now, they don't.

Now, my only problem is that I can't figure out where to change the setting so that it uses javax.jms.Queue as the type for MyMDBQueue. Anyone know how to do that? I sure can't find it. The only place I ever defined a type for the Queue was in the web app deployment descriptor and that was javax.jms.Queue.
[ November 19, 2004: Message edited by: Corey McGlone ]
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Corey,
Typing in the JNDI name and pressing enter only works for looking up EJBs. If you are looking up any other type of resource, that message is expected. Your JNDI looks fine. I checked ours and we too have a class of com.ibm.mq.jms.MQQueue. I suspect it is a subclass of the Queue class (but not positive.)

I just want to confirm that you have the MQ stuff installed. (You should if you are getting this far though.) It should be in C:\Program Files\IBM\WebSphere MQ or something similar.

We use a common component that actually calls the queue, so we set it in a property file rather than using resources. In other words, I can't comment on what the deployment descriptor should say.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In response to Corey's problem when he is trying to lookup the JMS objects from the UTC, I can say that I also experienced the same problem while using the UTC. But, in my case, my samples with JMS Queue and Q-Connection-Factories ran fine! In fact, I have tried another example with Topic connection , and even that ran fine. Let me know if u want the value of any specific settings from my samples, which u would like to compare with urs.
 
Goutam Bhattacharjee
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne, I donot think the full-fledged MQ is required to run the example which Corey has mentioned. The Embedded MQ Client which comes as an optional pack with WSAD, is sufficient to run this example. IN fact, if u look at the trace printed by Corey, I guess he is using the embedded client.

----------------------------------------------

The startup trace state is *=all=disabled.AdminService initializedSuccessfully set JAAS login provider configuration class to com.ibm.ws.security.auth.login.Configuration.The Security component's FFDC Diagnostic Module com.ibm.ws.security.core.SecurityDM registered successfully: true.Java 2 Security is disabled.WCCM JAAS configuration information successfully pushed to login provider class.Security service initialization completed successfully
WebSphere Embedded Messaging Client only has been installed
Binding MyMDBConnectionFactory as jms/MyMDBConnectionFactoryBinding MyMDBQueue as jms/MyMDBQueue

-------------------------------------------------------
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Goutam,
You are correct. I didn't realize that's where my MQ folder came from!
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have configured JMS server for PubSub in WSAD5.1.
when i start the server it's giving error like


The Connection Manager received a fatal connection error from the Resource Adaptor for resource jms/TCF. The exception which was received is com.ibm.mq.jms.BrokerCommandFailedException: Broker command failed: 3008 Reason code 3008
[10/9/04 19:16:33:688 IST] 3ccc7031 MDBListenerIm W WMSG0019E: Unable to start MDB Listener Subscriber, JMSDestination jms/T : com.ibm.mq.jms.BrokerCommandFailedException: Broker command failed: 3008 Reason code 3008

this is only to Topic .not to the Queue
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Corey,

Its a long shot, but did u check if u are using the JMS interface? This can be configured along with the other MQ resource settings (Connection Factory or Destination) in the administrative console. For older interfacing app's u can choose MQ or JMS as the interface.

Hope it helps,

Jan
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too used the same article....
And faced the same error too....

The solution is not very elegant ... but it worked ...
Add the Queue connection factory and Queue settings under Server Settings ..
Instead of Node ....

It worked for me...

Let me know if you have found a better solution..

Regards,
Shailesh
 
Bras cause cancer. And tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic