views:

32

answers:

1

I plan to deploy an EAR packaged application into JBoss v4.2 as a folder containing the content of the EAR. Until now the EAR is deployed as a single file. I hope to be able to replace single JARs without the need to restart the application.

Is there any kind of event listener or annotation that can be used to register those JAR files upon deployment? The idea is a plugin like deployment of some features implementing a known interface. The plugins shall be used in a Seam webapp environment and may be exchanged with updated versions on the fly.

Any ideas? Thanks.

+3  A: 

AFAIK, this is not possible/supported. When using an exploded EAR, touching an individual module would trigger the hot deployment of the whole EAR.

From Lightweight Java Web Application Development: Leveraging EJB3, JSF, POJO, and Seam:

3.4.2. Hot Deployment

Another JBoss feature that helps agile development is exploded archives. The EAR, EJB3 JAR and WAR files are not necessarily JAR files in the JBoss container. They can be directories containing the contents of the JAR file. For instance, instead of deploying the dvdcatalog.ear file as a single file, you can deploy it as directory.

With the exploded directories, you can make changes to any single JSP page or Java class file in the application while the server is running. Then you can touch the META-INF/application.xml file in the exploded directory (i.e., update the file's timestamp to current) to re-deploy the entire EAR application. This further saves significant amount of time for rapid turn-around agile developers.

What you're looking for doesn't sound simple. It would require detecting the change, unloading loaded class definitions coming from that JAR (assuming this information is known), reloading classes (something like that but I'm pretty sure I'm oversimplifying). Maybe more a job for an OSGI server.

See also

Pascal Thivent
Thanks for that first response... sounds like it's not as easy as I hoped for. We'll see.
Daniel Bleisteiner
@Daniel It's a very interesting question and I'm very curious to see if you'll get "more positive" answers. As you said, *we'll see* and I'm favoriting this question to follow this story.
Pascal Thivent
My main concern are plugin based imports. I'd love to add or remove those imports on the fly adding new ones and replacing others as needed. If necessary I'll scan deployed JARs myself and add them to the classloader as needed. But I'll give this request some days here until then.
Daniel Bleisteiner