Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB MDB project on jboss server issues  RSS feed

 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to create simple EJB MDB project.

I created EJB project and then one more separate dynamic web project. I am using JBoss 5 server.

I was looking for JMS folder under

C:\softwares\jboss-5.0.0.CR2\jboss-5.0.0.CR2\server\default\deploy

I could not see jms folder there.

I want to open
jbossmq-destinations-services.xml
under the jms folder to edit it.

I could not see that file as well .

In jboss4.2 there used to be jms folder and under that there used to be
jbossmq-destinations-services.xml

Not sure where can I find
jbossmq-destinations-services.xml


Alternately i found destinations-services.xml under below folder

C:\softwares\jboss-5.0.0.CR2\jboss-5.0.0.CR2\server\default\deploy\messaging

I modified that as below by adding mbean at the end



MDBs looks as below




I deployed both ejb project and web project.

My servlet sending text messages to topic on which 3 message driven beans(mdb) are listening.
When i go to servlet url
http://localhost:8080/GpWebProj/GPServlet

My console is not roling with the text messages instead i see some errors there as below

16:49:09,679 INFO [STDOUT] entering GpServlet do get method--------
16:49:09,745 INFO [ServerSessionEndpoint] Received send for ID:JBM-5099599c-6b94-408b-a5a5-b9c669f4cbb7 reliable: true
16:49:09,745 INFO [ServerSessionEndpoint] Done send
16:49:09,745 INFO [STDOUT] exiting GpServlet do get method--------



Instead I would like to see something like below


16:49:09,679 INFO [STDOUT] entering GpServlet do get method--------
GpMDB01 onMessage method received msg msg from GpServlet
GpMDB02 onMessage method received msg msg from GpServlet
GpMDB03 onMessage method received msg msg from GpServlet
16:49:09,745 INFO [STDOUT] exiting GpServlet do get method--------

I am not sure where is the issue. How can i fix this issue

Please advise. Any links, sample code, resources, ideas highly appreciated. thanks in advance
MDBProjStr.jpg
[Thumbnail for MDBProjStr.jpg]
EJB MDB project structure and console
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving as too difficult for “beginning”. I hope I have put it in the right place.
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1103
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not looked at your code in detail, but I can say one thing:
You cannot expect output in a certain order with topics/queues. You have to remember that queue/topic are for 'asynchronous' processing - your servlet posts a message and there is no guarantee that the message processor is going to take it up immediately. What if it is busy with other messages?

And using sysout is not the best way - instead you should use logging and periodically check the server log files to see if the processing has happened.
 
sai rama krishna
Ranch Hand
Posts: 530
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under C:\softwares\jboss-5.0.0.CR2\jboss-5.0.0.CR2\server\default\deploy\jbossmq-destinations-services.xml

I added last mbean element as below for topic at the end of the file







For configuring queue i added below mbean as last but one element













I was looking this link

http://grwebservice.blogspot.in/2009/06/message-driven-bean.html

do I need to configure prop file as below.

EJBJNDI.prop
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.namingrg.jnp.interfaces
java.naming.provider.url=localhost:1099

I am not configuring property file as above. Is that is issue. Can you please advise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!