<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Craig Andrews]]></provider_name><provider_url><![CDATA[http://candrews.integralblue.com]]></provider_url><author_name><![CDATA[Craig Andrews]]></author_name><author_url><![CDATA[http://candrews.integralblue.com/author/candrews/]]></author_url><title><![CDATA[Install JBoss 4.2 on Centos/RHEL 5]]></title><type><![CDATA[link]]></type><html><![CDATA[I was recently tasked with installing JBoss 4.2 on Centos/RHEL 5. I found the experience remarkably difficult, so I figured I should share it for my own future reference, and hopefully to also save the sanity of whatever other poor souls are tasked with the same project.
<ol>
	<li>Start off with RHEL 5 or Centos 5</li>
	<li>Install <a href="http://candrews.integralblue.com/wp-content/uploads/2009/07/jpackage50.repo">jpackage50.repo</a> into /etc/yum.repos.d/ (instructions for how to make this file can be found at <a href="http://jpackage.org/yum.php">jpackage.org</a>)</li>
	<li>run "yum update"</li>
	<li>run "yum install jbossas"</li>
	<li>If you see this message: " --&gt; Missing Dependency: /usr/bin/rebuild-security-providers" then download <a href="http://candrews.integralblue.com/wp-content/uploads/2009/07/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm">jpackage-utils-compat-el5-0.0.1-1.noarch</a> and install it by using  rpm -i jpackage-utils-compat-el5-0.0.1-1.noarch.rpm , then run "yum install jbossas" again. See <a href="https://bugzilla.redhat.com/show_bug.cgi?id=497213">this bug at Red Hat</a> for details, and <a href="http://www.zarb.org/pipermail/jpackage-discuss/2008-July/012751.html">http://www.zarb.org/pipermail/jpackage-discuss/2008-July/012751.html</a> for how the rpm was built.</li>
	<li>run "/sbin/chkconfig jbossas on" to start JBoss automatically at startup</li>
	<li>Until <a href="https://www.jpackage.org/bugzilla/show_bug.cgi?id=324">this bug</a> is resolved , run this command: "ln -s /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar"</li>
	<li>If you want JBoss to listen to requests from systems other than localhost, edit /etc/jbossas/jbossas.conf. Create a new line that reads "JBOSS_IP=0.0.0.0".</li>
	<li>put your .ear's, .war's, ejb .jar's, *-ds.xml's into /var/lib/jbossas/server/default/deploy</li>
	<li>Start JBoss by running "/etc/init.d/jbossas start"</li>
</ol>
JVM args can be found in /etc/jbossas/run.conf.

Note that if your web application (war, ear, whatever) depends on JNDI, you need to edit /var/lib/jbossas/server/default/deploy/jboss-web.deployer/META-INF/jboss-service.xml and a line for each JNDI data source like this: "&lt;depends&gt;jboss.jca:service=DataSourceBinding,name=jdbc/whatever&lt;/depends&gt;". This little detail cost me quite a few hours to figure out... an explanation as to why this is necessary can be found at <a href="http://confluence.atlassian.com/display/DOC/Known+Issues+for+JBoss">http://confluence.atlassian.com/display/DOC/Known+Issues+for+JBoss</a>. Basically, JBoss will start applications before JNDI data sources unless told otherwise, so your application will error out on startup with an exception like this: "Caused by: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: jdbc not bound]".

Some may argue that I should have simply downloaded the tar from jboss.org and manually installed JBoss without a package manager. However, the package manager offers a lot of advantages, such as dependency resolution/management, automatic updates for security and/or new features, clean and easy uninstall, and a lot more. When given the choice, I always choose to use a package manager, and will even create packages if ones are not available, and I report package bugs so others, and my future self,will have a better experience.

A lot of the pain in installing JBoss is due to bugs in the packaging. I hope that jpackage.org / Red Hat solves these problems soon - I wouldn't really want anyone to have to live through the trouble I went through to figure all this out again.]]></html></oembed>