문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top