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.
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.
"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.
posted 7 years ago
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??
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.
I think I'll just lie down here for a second. And ponder this tiny ad: