For proof of concept I needed to deploy large number of servlet containers. Because I’m lazy and most of the code for main application has already been written for JBoss AS (including Login modules and set of custom services) I really didn’t want to use standalone Jetty or Tomcat. To use different solution for one part of deployment would create significant duplication of some functionality and unnecessary increased administration.Instead of cleaning-up default configuration, I decided to use for first time minimal configuration and add JBossWeb (manually). This is an overview of what has been required to achieve it.
First copy the configuration and create new profile.
cd server/
cp -R minimal webserver
Obviously you need to copy original JBoss Web deployer.
cp -R ./default/deploy/jboss-web.deployer ./webserver/deploy/
And that’s where fun begins. By default JBoss Web relies on several JEE service that needs to be disabled. Edit file
webserver/deploy/jboss-web.deployer/META-INF/jboss-service.xml
and comment out (delete) following dependencies on unnecessary services:
<depends>jboss:service=TransactionManager</depends>
<depends>jboss.jca:service=CachedConnectionManager</depends>
This is based on assumption you don’t need them. Once CachedConnectionManager is gone, you need to delete CachedConnectionValve from
webserver/deploy/jboss-web.deployer/server.xml
Right now, your new webserver profile is stripped to it’s minimum and you have to add something. First necessary addsecurity related services into jboss-service.xml.
Last remaining task is to copy additional JAR files and that’s it!
cd default/lib/
cp jboss.jar jboss-j2ee.jar jbosssx.jar servlet-api.jar jsp-api.jar jbossws* el-api.jar jboss-ejb3x.jar ../../webserver/lib
Back in bin folder you can test new configuration profile
run -c webserver
Don’t expect miracles, you’ll get only what you configure. In this case is basic application server, with full support for customer services and webserver. To perform more tests you need to deploy some WAR file to deploy/ folder in order to get any output, as there are no context by default.This guide has been tested on JBoss AS 4.2.2
UPDATED. New post about details of JBoss Minimal is available.
3 Comments
What should I add on top to enable the jmx-console.war as well? How can I track the jmx-console dependencies on other libraries?
Hi Christian,
I’ve just tried it and I can deploy jmx-console.war, without new dependencies.
Radim
Used this recipe to add Tomcat to jboss-4.2.3.GA ‘minimal’
I did a couple of things differently:
Added security mbean to
jboss-4.2.3.GA\server\sdt-proto20090305m1\conf\jboss-service.xml
AND
added (forced to add)
jboss-4.2.3.GA\server\sdt-proto20090305m1\conf\login-config.xml
2 Trackbacks
[...] tagged minimalOwn a WordPress blog? Make monetization easier with the WP Affiliate Pro plugin. JBoss minimal configuration with Servlet Contraine… saved by 6 others stephiliz bookmarked on 06/04/08 | [...]
[...] the last three years and especially after publishing my post JBoss minimal configuration with Tomcat I’ve been asked many times what is actually the idea behind JBoss AS Minimal Configuration [...]