Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

packaging webservices with MDB  RSS feed

 
Ashwin Raghavan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have created a web serivce server side. I take the xml from the client and pass the children of the root node into a JMS queue, whihc is an destinatin for an MDB.

I have two questions

1) I have exported the project as war and deployed on jboss 7.1.1. Everythign works fine. The request from teh client is recived and is send on the JMS queue. but for some reason the message is not reaching to the OnMessage() part of the queue. Doesn;t MDB (EJB) work when it is deployed inside war file?

2) if at all EJB does not work inside a war file. how shall i proceed. Shall i create a war file consisting only of web.xml and the endpoint classes (interface and implementation class) and create a jar file which consists of the all the other files and the war file created above.

 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ashwin Raghavan wrote:
Shall i create a war file consisting only of web.xml and the endpoint classes (interface and implementation class) and create a jar file which consists of the all the other files and the war file created above.

I think separation between components is the right way to go. Main reason is both of your components will be loaded by different class-loaders, second is you can easily deploy any of them to another server if needed.
 
Amir Keibi
Ranch Hand
Posts: 49
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Separation of concerns" is the right term. EJBs and web services serve two different purposes and handled by two different containers in your application servers. As for packaging, package them separately (.war & .jar) and if you're deploying them onto one application server repackage them into an EAR file.
 
Ashwin Raghavan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application was small. so i packaged both of them in a war file and deployed them. it worked well. Thanks for the solution. although i wanted to ask. If i pack my webservices into war and ejb into jar and them package both of them to ear. when i deploy it on the server would the war file get self extracted and be hosted on the server automatically??

right now my war gets extracted and wsdl file gets created automatically. which is what i want. would it be possible if package them seperately and put them in ear??
 
Amir Keibi
Ranch Hand
Posts: 49
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The only thing is that when you deploy them with an EAR file, both EJB and web application become part of the same APPLICATION in your application server. This would be a requirement if you're using features of EJB 3 like Dependency Injection.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!