0
votes

We are trying to build a modular jsf application. The application consists of a war file and several jar files. Each jar file contains .xhtml pages , associated beans and configuration files like faces-config.xml, web-fragment.xml and pretty-config.xml. When those jar files are placed inside WEB-INF/lib everything works fine.

However, we need to deploy the jar files independently of the war (like a plugin system).

In jboss 6, we tried placing the jar files in the deploy folder. We were able to view the .xhtml pages that were located inside the jar (all the deployed applications share the same classloading domain). However, the jar was not scanned for jsf annotations and the FacesContext was not properly initialized.

We also tried to deploy our application with a similar configuration in jboss 7 but we ran into other issues. The properties files that are located in the jar were not loaded and for some reason the CDI beans resolved always to null.

It would be nice if we could create a web application composed of reusable modules that are not packaged inside the war.

Any suggestions are welcome.

Thank you in advance.

1
We also use CDI and we have included a custom ResourceResolver. The only difference is that we place the jar files outside the WEB-INF/lib folder of the war.dimitra

1 Answers

0
votes

Does your application have its own class loader? It really seems like you'd need to tell Java how to find the JARs in order to accomplish this, which means either going OSGi or some other variety of custom class loader arrangement.

This isn't an uncommon problem incidentally, and there are several implementations of custom class loader plugin systems. You might want to read up on existing implementations such as https://developer.atlassian.com/display/PLUGINFRAMEWORK/Plugin+Framework