Converting a java resultset into a Railo CF query

It's pretty easy:

q = createObject("java", "railo.runtime.type.QueryImpl").init(resultset,"YourQueryName");

And that's it!

Binding to an IP : Railo on Jetty

If you're running Railo with Jetty, and are wondering how to bind Jetty to a specific port, look no further!

Well, guess you should look further than that, as hell, how would you actually find out if you had stopped up there, around the exclamation mark.

Anyways, nothing super hard -- edit the server.xml file (in the root folder of your install, probably) and add this line:

<Set name="Host">your.ip.address</Set>
To the two connectors -- you'll know the ones, they've already got settings for ports, so it's logical, sorta, right?

Right.

Zat's it.

Deploying Railo as an EAR under JBoss 5

If you've done it with CF, all you need to do is copy a couple of files and make a couple of edits, but basically it goes like this:

Download the railo.war archive.

Create a sub-directory under the jboss server's deploy directory called railo.ear.

In the railo.ear directory, create a sub-directory called META-INF

Create a file called application.xml within the META-INF directory. Here is an example application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">

<display-name>Railo3</display-name>
<module id="WebModule_1">
<web>
<web-uri>railo.war</web-uri>
<context-root>/railo</context-root>
</web>
</module>
</application>

Move the railo.war file to the railo.ear directory, and rename it to railo.war.zip, and unzip it there.

You should now have a sub-directory called railo.war in the railo.ear directory.

Delete railo.war.zip.

Fix the nested zip errors [link to fix] by adding a file in WEB-INF/jboss-classloading.xml that contains:

<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
  name="mywar.war"
  domain="DefaultDomain"
  export-all="NON_EMPTY"
  import-all="true">

</classloading>
Start up jboss, browser to your /railo context (If you've got a default jboss install, it will be: http://localhost:8080/railo), and bada-bing, you should be singing right along.

Running Railo 3 on JBoss 5

Edit: Better way of fixing the classloading errors (credit to http://nagpals.com/blog/post.cfm/classloader-conflicts-in-railo-on-jboss for the solve, and other good stuff):

The correct way to fix this issue is to make JBoss isloate classes loaded for different applications, thereby removing the possibiiity of conflicts. On JBoss 5 you can do this if you add a file in WEB-INF/jboss-classloading.xml that contains:

<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"
  name="mywar.war"
  domain="DefaultDomain"
  export-all="NON_EMPTY"
  import-all="true">

</classloading>

FWIW, I like to keep everything in an EAR, and use an application.xml file to define the context, etc..

Eventually I'll post an entry on creating an EAR deployment with CF/Railo, as it's pretty easy.

BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.000. Contact Blog Owner