<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrew's Blog &#187; railo</title>
	<atom:link href="http://www.abm.id.au/blog/tag/railo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abm.id.au/blog</link>
	<description>Web Development with ColdFusion and Java</description>
	<lastBuildDate>Thu, 05 Jan 2012 13:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Railo on JBoss (Multi-site configuration)</title>
		<link>http://www.abm.id.au/blog/2009/09/10/railo-on-jboss-multi-site-configuration/</link>
		<comments>http://www.abm.id.au/blog/2009/09/10/railo-on-jboss-multi-site-configuration/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 03:16:52 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.abm.id.au/blog/?p=69</guid>
		<description><![CDATA[Earlier this year Sean Corfield blogged about a &#8220;multi-web&#8221; install of Railo on Tomcat. I decided to see if I could set up a similar configuration on JBoss 5.1.0 and was able to do it successfully by following Sean&#8217;s steps with a few modifications. These modifications are documented below. My solution also includes some ideas [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this year <a href="http://corfield.org/blog/index.cfm/do/blog.entry/entry/Railo_on_Tomcat__multiweb">Sean Corfield</a> blogged about a &#8220;multi-web&#8221; install of Railo on Tomcat.</p>
<p>I decided to see if I could set up a similar configuration on JBoss 5.1.0 and was able to do it successfully by following Sean&#8217;s steps with a few modifications.  These modifications are documented below.</p>
<p>My solution also includes some ideas I learnt from this blog post &#8211; <a href="http://help.shadocms.com/blog/2009/running-railo-and-adobe-coldfusion-on-the-same-context-root-in-jboss.cfm">http://help.shadocms.com/blog/2009/running-railo-and-adobe-coldfusion-on-the-same-context-root-in-jboss.cfm</a></p>
<p>Firstly, I took a copy of the jboss &#8220;web&#8221; instance and named it railo, ie:</p>
<p>copy <strong><JBOSS_HOME>/server/web</strong> to <strong><JBOSS_HOME>/server/railo</strong></p>
<p>This will become our railo server instance.</p>
<p><strong>NB:</strong> <JBOSS_HOME> is the directory where I installed JBoss &#8211; in my case c:/jboss/jboss-5.1.0.GA</p>
<p>Now I started following Sean&#8217;s instructions.  The first issue I ran into was when I came to edit the conf/catalina.properties file.  I could not find the JBoss equivalent (there may be one, but I just couldn&#8217;t find it).  However I found that by putting the Railo JARs into <strong><JBOSS_HOME>/server/railo/lib</strong> this had the same effect.</p>
<p>Next Sean mentioned editing the Tomcat conf/web.xml file.  The corresponding JBoss file to edit is:</p>
<p><strong><JBOSS_HOME>/server/railo/deployers/jbossweb.deployer/web.xml</strong></p>
<p>At this point we we can start the server and have a look at the server administrator.  To do this (on windows at least) go into the command prompt, cd to <JBOSS_HOME> and run this command:</p>
<p>bin\run -c railo</p>
<p>Once it starts up, you can then browse to http://localhost:8080/railo-context/admin.cfm to view the Railo Server Administrator.</p>
<p>After confirming it runs, stop it again (I just use CTRL-C to stop the JBoss instances &#8211; there may be a cleaner way but I am not aware of it).</p>
<p>The next thing in JBoss that differs from the Tomcat instructions is adding your new host definitions.  In Tomcat this is done in conf/server.xml, but in JBoss 5.1.0 it is done in <strong><JBOSS_HOME>/server/railo/conf/bootstrap/profile.xml</strong>.</p>
<p>The change I made to this file is shown below:<br />
<pre><pre>&lt;!--
 The profile configuration
 This contains required properties:
 The uri to jboss-service.xml.
 The uri to the deployers folder.
 A list of uris to deploy folders. --&gt;
 &lt;bean name=&quot;BootstrapProfileFactory&quot;&gt;
 &lt;property name=&quot;bindingsURI&quot;&gt;${jboss.server.home.url}conf/bindingservice.beans&lt;/property&gt;
 &lt;property name=&quot;bootstrapURI&quot;&gt;${jboss.server.home.url}conf/jboss-service.xml&lt;/property&gt;
 &lt;property name=&quot;deployersURI&quot;&gt;${jboss.server.home.url}deployers&lt;/property&gt;
 &lt;property name=&quot;applicationURIs&quot;&gt;
 &lt;list elementClass=&quot;java.net.URI&quot;&gt;
 &lt;value&gt;${jboss.server.home.url}deploy&lt;/value&gt;
&lt;span style=&quot;color: #ff0000;&quot;&gt; &lt;value&gt;file:///C:/www/railo-deploy&lt;/value&gt;&lt;/span&gt;
 &lt;/list&gt;
 &lt;/property&gt;
 &lt;property name=&quot;attachmentStoreRoot&quot;&gt;${jboss.server.data.dir}/attachments&lt;/property&gt;
 &lt;property name=&quot;profileFactory&quot;&gt;&lt;inject bean=&quot;ProfileFactory&quot; /&gt;&lt;/property&gt;
 &lt;/bean&gt;</pre></pre><br />
Note that this is a URI, so it must include file:/// (this caught me out on my first attempt).  How I did this was to create a directory called c:/www/railo-deploy, then in that directory create new directories called web1.war and web2.war</p>
<p>Next (borrowing from the ShadoCMS blog) <strong><JBOSS_HOME>/server/railo/deploy/jbossweb.sar/server.xml</strong> to have two more <Host> nodes:<br />
<pre><pre> &lt;Host name=&quot;web1.local&quot;&gt;
 &lt;Alias&gt;web1.local&lt;/Alias&gt;
 &lt;/Host&gt;

 &lt;Host name=&quot;web2.local&quot;&gt;
 &lt;Alias&gt;web2.local&lt;/Alias&gt;
 &lt;/Host&gt;</pre></pre><br />
The final piece of the puzzle was then to create a web.xml and  jboss-web.xml in each of the WEB-INF dirs, ie:</p>
<p><strong>c:/www/railo-deploy/web1.war/WEB-INF/web.xml:</strong><br />
<pre><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;

&lt;!DOCTYPE web-app
 PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
 &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;

&lt;web-app&gt;
 &lt;display-name&gt;Web App 1&lt;/display-name&gt;
 &lt;description&gt;
 Railo Web 1
 &lt;/description&gt;
&lt;/web-app&gt;</pre></pre><br />
<strong>c:/www/railo-deploy/web1.war/WEB-INF/jboss-web.xml</strong><br />
<pre><pre>&lt;jboss-web&gt;
&lt;context-root&gt;/&lt;/context-root&gt;
&lt;virtual-host&gt;web1.local&lt;/virtual-host&gt;
&lt;/jboss-web&gt;</pre></pre><br />
<strong>c:/www/railo-deploy/web2.war/WEB-INF/web.xml</strong><br />
<pre><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;

&lt;!DOCTYPE web-app
 PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
 &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;

&lt;web-app&gt;
 &lt;display-name&gt;Web App 2&lt;/display-name&gt;
 &lt;description&gt;
 Railo Web 2
 &lt;/description&gt;
&lt;/web-app&gt;</pre></pre><br />
<strong>c:/www/railo-deploy/web2.war/WEB-INF/jboss-web.xml</strong><br />
<pre><pre>&lt;jboss-web&gt;
&lt;context-root&gt;/&lt;/context-root&gt;
&lt;virtual-host&gt;web2.local&lt;/virtual-host&gt;
&lt;/jboss-web&gt;</pre></pre><br />
All going well you should now have a working multi-web setup in JBoss.</p>
<p><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/au/"><img style="border-width: 0;" src="http://i.creativecommons.org/l/by-sa/2.5/au/88x31.png" alt="Creative Commons License" /></a><br />
This <span>work</span> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/au/">Creative Commons Attribution-Share Alike 2.5 Australia License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abm.id.au/blog/2009/09/10/railo-on-jboss-multi-site-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Railo 3 on JBoss 5</title>
		<link>http://www.abm.id.au/blog/2009/09/07/railo-3-on-jboss-5/</link>
		<comments>http://www.abm.id.au/blog/2009/09/07/railo-3-on-jboss-5/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 10:29:23 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.abm.id.au/blog/?p=67</guid>
		<description><![CDATA[Railo 3 will not run on JBoss 5 without some modifications, as some of the packaged jars conflict with the jars in Jboss&#8217;s classpath.  The error reported is similar to that below: 2009-09-07 20:20:09,354 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (main) XML error parsing: context.xml org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100) at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549) at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536) [...]]]></description>
			<content:encoded><![CDATA[<p>Railo 3 will not run on JBoss 5 without some modifications, as some of the packaged jars conflict with the jars in Jboss&#8217;s classpath.  The error reported is similar to that below:</p>
<p><pre><code>
2009-09-07 20:20:09,354 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (main) XML error parsing: context.xml
org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549)
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
at $Proxy38.start(Unknown Source)
</code></pre></p>
<p>One solution (which seems to work perfectly) is to remove the offending jars from &lt;railo_home&gt;/WEB-INF/lib, as described here:</p>
<p><a href="http://coldshen.com/blog/index.cfm/2008/8/2/Running-Railo-3-beta-on-JBoss-5">http://coldshen.com/blog/index.cfm/2008/8/2/Running-Railo-3-beta-on-JBoss-5</a></p>
<p>An alternative solution, is to create a file named jboss-classloading.xml and place this into &lt;railo_home&gt;/WEB-INF.  The contents of the file should be similar to that shown below:</p>
<p><pre><code>&amp;lt;classloading xmlns=&quot;urn:jboss:classloading:1.0&quot;
name=&quot;railo.war&quot;
domain=&quot;railo_Domain&quot;
export-all=&quot;NON_EMPTY&quot;
import-all=&quot;false&quot;&amp;gt;
&amp;lt;/classloading&amp;gt;</code></pre></p>
<p>More details are available from the JBoss wiki -  <a href="http://www.jboss.org/community/wiki/useJBossWebClassLoaderinJBoss5">http://www.jboss.org/community/wiki/useJBossWebClassLoaderinJBoss5</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abm.id.au/blog/2009/09/07/railo-3-on-jboss-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

