开发者

Modular JSF applications with Jboss

开发者 https://www.devze.com 2023-03-17 17:59 出处:网络
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 face

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 th开发者_开发百科at 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号