aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes MDB not recieving the message not throwing any exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "MDB not recieving the message not throwing any exception" Watch "MDB not recieving the message not throwing any exception" New topic
Author

MDB not recieving the message not throwing any exception

hashmukh punamia
Greenhorn

Joined: Aug 14, 2007
Posts: 22
Hi Reza and Ranchers,

This is my MDB code




and below is my JMS message sender code




I have added the following entry in jbossmq-destinations-service.xml



My JMS sender sends the message but my MDB never reads the message not I am getting any exceptions

You help would be appreciated.

Thanks,
Hash
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
In your MDB code, you are not doing lookup for Destination. :idea:


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
hashmukh punamia
Greenhorn

Joined: Aug 14, 2007
Posts: 22
Hi Amandeep,

The destination is already there in the activationConfig.
I dont think we will have to do that explictly when one is using annotations for the same

Thanks,
Hash
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Hash,

Not sure exactly what might be going wrong. Try taking a look at our JBoss example code/build scripts for the book. Perhaps the MDB is not packaged/deployed correctly?

Cheers,
Reza


Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

Which version of JBossAS? Please post the entire console logs. How do you start the JBoss server and how do you deploy the application and the queue?


[My Blog] [JavaRanch Journal]
hashmukh punamia
Greenhorn

Joined: Aug 14, 2007
Posts: 22
Hi Reza and Pai,

Thanks for your quick reply.

I am using Netbeans6.1RC2 to create a independant EJB module with the MDB code. My EJB module only consists of a MDB.
Then I deploy the ejb module in JBoss4.2.2GA.





Now I create a seperate web application project to which I have added a java class (MessageProd.class) running the JMS code similar to the sample code provided in EJB3 in action book.
I am adding the jar file to my library just to get the TestMessage.class.



When I execute the client code I dont get any output on the server.

I have added the following entry in jbossmq-destinations-service.xml




Also my server startup logs


Please let me know if I am wrong somewhere

Thanks in advance

Thanks,
Hash
hashmukh punamia
Greenhorn

Joined: Aug 14, 2007
Posts: 22
Hi Reza,

Its working now.
Able to see the messgae on the console now.

1)
session = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);

The first param should be false

and 2) havent started the connection

Thanks & Regards,
Hash
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Hash,

Glad it worked out.

Best regards,
Reza

P.S.: Please do me a big favor and kindly avoid addressing questions to me directly (especially in the thread starter ) on the JavaRanch forums. The reason is that I am merely just another "Rancher" here, so it looks a little out-of-place and makes me a tiny bit uncomfortable. I try my best to keep an eye on posts anyway and respond when I think it is needed :-). That being said, you can address me directly all you want on the Manning EJB 3 in Action Author Online Forum: http://www.manning.com/panda/. And I understand and appreciate the gesture :-).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB not recieving the message not throwing any exception
 
Similar Threads
Not able to get output for MDB code...
MDB: Message id is null Error
mdb doesn't catch messages in point2point
Getting very strange exception: JMS in EJB3, JBoss
Associate Same Mdb file to multiple queue in Ejb3 jboss 5.x server