<?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</title>
	<atom:link href="http://www.abm.id.au/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abm.id.au/blog</link>
	<description>Web Development with ColdFusion and Java</description>
	<lastBuildDate>Mon, 14 Dec 2009 03:11:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iBatis and ColdFusion</title>
		<link>http://www.abm.id.au/blog/2009/12/14/ibatis-and-coldfusion/</link>
		<comments>http://www.abm.id.au/blog/2009/12/14/ibatis-and-coldfusion/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 03:05:58 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.abm.id.au/blog/?p=75</guid>
		<description><![CDATA[One of my colleagues has been writing Java web apps using Spring, Struts and the iBatis Data Mapper.
A lot of his code would be very useful to use in my ColdFusion apps, so I wanted to find out if there was a way to integrate ColdFusion and iBatis.
Back in July 2006, Charlie Arehart blogged about [...]]]></description>
			<content:encoded><![CDATA[<p>One of my colleagues has been writing Java web apps using Spring, Struts and the <a href="http://ibatis.apache.org/">iBatis Data Mapper</a>.</p>
<p>A lot of his code would be very useful to use in my ColdFusion apps, so I wanted to find out if there was a way to integrate ColdFusion and iBatis.</p>
<p>Back in July 2006, <a href="http://www.carehart.org/blog/client/index.cfm/2006/7/1/ibatis_for_cfml">Charlie Arehart blogged about this possibility</a> however as far as I am aware no-one provided a working solution.</p>
<p>However with the help of <a href="http://www.compoundtheory.com/?action=javaloader.index">Mark Mandel&#8217;s Javaloader</a>, and a <a href="http://stannard.net.au/blog/index.cfm/2009/11/3/Hello-World-with-ColdFusion-and-Spring">blog post on integrating ColdFusion and Spring from Kevan Stannard</a> I have been able to put together a demo of iBatis and ColdFusion working together.</p>
<p>My sample app code can be downloaded from <a href="http://www.abm.id.au/downloads/cfibatisdemo.zip">http://www.abm.id.au/downloads/cfibatisdemo.zip</a></p>
<p>To get this to work you need to download a few dependencies:</p>
<ul>
<li><a href="http://www.compoundtheory.com/?action=javaloader.index">Javaloader</a> (version 1.0 beta)</li>
<li><a href="http://ibatis.apache.org/">iBatis</a> (version 2.3.4.726)</li>
<li><a href="http://commons.apache.org/logging/">Commons Logging</a> (version 1.1.1)</li>
<li><a href="http://www.springsource.org/">Spring Framework</a> (version 2.5.6.SEC01)</li>
<li><a href="http://ant.apache.org/">Apache Ant</a> (version 1.7.1)</li>
</ul>
<p>Once you&#8217;ve downloaded these extract them to an appropriate place in your file system (I put them all at c:\javadev).  Then update the build.xml in my sample app to reference where you put these libraries.  You should also ensure ant is on your path.</p>
<p>You will also need to set up a sample database and connection to run this demo.  A mysql script is included in the db/ directory of the sample code.</p>
<p>Setting up the database connection is a bit more complicated.  My solution was to set up a datasource using JNDI.  I have ColdFusion 8 installed in a multiserver config so this had to be set up in the JRun Management Console.</p>
<p>The following screenshot shows the settings I used to create this datasource.  Note that I had to change the MySQL Driver Class Name from the default to get it to work with MySQL 5.x.  Also note that you will need to update web/beans.xml to use the correct name you give this datasource.</p>
<p><a href="http://www.abm.id.au/blog/wp-content/uploads/2009/12/JNDI-datasource2.jpg"><img class="alignnone size-thumbnail wp-image-83" title="JNDI Datasource settings" src="http://www.abm.id.au/blog/wp-content/uploads/2009/12/JNDI-datasource2-150x150.jpg" alt="JNDI Datasource settings" width="150" height="150" /></a></p>
<p>If you are using another server, you will need to check your app server documentation to find out how to set up a JNDI datasource in your environment.</p>
<p>A couple of gotcha&#8217;s I found with the JNDI datasource are that if the database is not running when you start the server, it doesn&#8217;t seen to initialise the datasource correctly.  Similarly if the database is stopped and restarted, I found you need to restart the JRun server to get things working again.  Obviously this would be a problem in a production environment, and needs further investigation.</p>
<p>Finally to get things up and running you need to install Javaloader into your ColdFusion root directory or create an appropriate mapping.</p>
<p>Then build the sample app by issuing the command following command in the directory where you extracted the sample code:</p>
<p>ant dist</p>
<p>You can then copy the contents of the /dist dir from the sample app over to your ColdFusion server, and run the sample.</p>
<p>Please feel free to leave comments on this post if you have any problems or suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abm.id.au/blog/2009/12/14/ibatis-and-coldfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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 I learnt [...]]]></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>&lt;JBOSS_HOME&gt;/server/web</strong> to <strong>&lt;JBOSS_HOME&gt;/server/railo</strong></p>
<p>This will become our railo server instance.</p>
<p><strong>NB:</strong> &lt;JBOSS_HOME&gt; 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>&lt;JBOSS_HOME&gt;/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>&lt;JBOSS_HOME&gt;/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 &lt;JBOSS_HOME&gt; 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>&lt;JBOSS_HOME&gt;/server/railo/conf/bootstrap/profile.xml</strong>.</p>
<p>The change I made to this file is shown below:</p>
<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="BootstrapProfileFactory"&gt;
 &lt;property name="bindingsURI"&gt;${jboss.server.home.url}conf/bindingservice.beans&lt;/property&gt;
 &lt;property name="bootstrapURI"&gt;${jboss.server.home.url}conf/jboss-service.xml&lt;/property&gt;
 &lt;property name="deployersURI"&gt;${jboss.server.home.url}deployers&lt;/property&gt;
 &lt;property name="applicationURIs"&gt;
 &lt;list elementClass="java.net.URI"&gt;
 &lt;value&gt;${jboss.server.home.url}deploy&lt;/value&gt;
<span style="color: #ff0000;"> &lt;value&gt;file:///C:/www/railo-deploy&lt;/value&gt;</span>
 &lt;/list&gt;
 &lt;/property&gt;
 &lt;property name="attachmentStoreRoot"&gt;${jboss.server.data.dir}/attachments&lt;/property&gt;
 &lt;property name="profileFactory"&gt;&lt;inject bean="ProfileFactory" /&gt;&lt;/property&gt;
 &lt;/bean&gt;</pre>
<p>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>&lt;JBOSS_HOME&gt;/server/railo/deploy/jbossweb.sar/server.xml</strong> to have two more &lt;Host&gt; nodes:</p>
<pre> &lt;Host name="web1.local"&gt;
 &lt;Alias&gt;web1.local&lt;/Alias&gt;
 &lt;/Host&gt;

 &lt;Host name="web2.local"&gt;
 &lt;Alias&gt;web2.local&lt;/Alias&gt;
 &lt;/Host&gt;</pre>
<p>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></p>
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;

&lt;!DOCTYPE web-app
 PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd"&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>
<p><strong>c:/www/railo-deploy/web1.war/WEB-INF/jboss-web.xml</strong></p>
<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>
<p><strong>c:/www/railo-deploy/web2.war/WEB-INF/web.xml</strong></p>
<pre>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;

&lt;!DOCTYPE web-app
 PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd"&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>
<p><strong>c:/www/railo-deploy/web2.war/WEB-INF/jboss-web.xml</strong></p>
<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>
<p>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)
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 [...]]]></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><code><br />
2009-09-07 20:20:09,354 ERROR [org.jboss.web.tomcat.service.deployers.JBossContextConfig] (main) XML error parsing: context.xml<br />
org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser<br />
at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)<br />
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processContextConfig(JBossContextConfig.java:549)<br />
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.init(JBossContextConfig.java:536)<br />
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)<br />
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)<br />
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5436)<br />
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4148)<br />
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)<br />
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)<br />
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)<br />
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)<br />
at org.jboss.web.deployers.WebModule.start(WebModule.java:97)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:597)<br />
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)<br />
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)<br />
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<br />
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<br />
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)<br />
at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)<br />
at $Proxy38.start(Unknown Source)<br />
</code></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><code>&lt;classloading xmlns="urn:jboss:classloading:1.0"<br />
name="railo.war"<br />
domain="railo_Domain"<br />
export-all="NON_EMPTY"<br />
import-all="false"&gt;<br />
&lt;/classloading&gt;</code></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>
