Category: Railo

Jun 27 2008

Deploying Railo WAR on JBoss 4.2.2

Beta 2 of Railo 3.0 is available, and one of its download options is as a WAR suitable for any JEE server. In the Hiberailooving series, I'm building up a Hibernate + Railo + Groovy + Spring platform, and JBoss will be its intended deployment platform.

When you download the WAR, all you get is (literally) the WAR itself. To get it up and running in JBoss, you'll want to:

  1. Unzip the WAR and deploy to your /deploy directory. I used a new Dynamic Web Project in Eclipse to make this easier to manage, calling my project Railo and running in the context-root of Railo.
  2. Write a web.xml that configures the proper servlets/filters to start serving up CFML. I ripped and modified the one from the Railo Express distribution, modifying the Jetty-style filters to suit JBoss. For your convenience, it follows.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
   <display-name>Railo</display-name>
      
   <servlet>
      <servlet-name>CFMLServlet</servlet-name>
      <servlet-class>railo.loader.servlet.CFMLServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>   
   
   <servlet>
      <servlet-name>AMFServlet</servlet-name>
      <servlet-class>railo.loader.servlet.AMFServlet</servlet-class>
      <load-on-startup>2</load-on-startup>
   </servlet>
         
   <servlet-mapping>
      <servlet-name>CFMLServlet</servlet-name>
      <url-pattern>*.cfm</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>CFMLServlet</servlet-name>
      <url-pattern>*.cfml</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
      <servlet-name>CFMLServlet</servlet-name>
      <url-pattern>*.cfc</url-pattern>
   </servlet-mapping>

   <welcome-file-list>
      <welcome-file>index.cfm</welcome-file>
      <welcome-file>index.cfml</welcome-file>
   </welcome-file-list>
</web-app>

Conclusion

Deploy the unzipped WAR, drop the XML above into WEB-INF/web.xml, and you should have a running CFML server. No admin, though, so I'm not too sure how to add a datasource....

3 comments - Posted by Joe Rinehart at 3:22 PM - Categories: Hiberailooving | Railo