A recent discussion with a colleague in San Diego led me to realize that, while I have a lot of seperate snippets of how to setup CF/JBoss, I never published a nice comprehensive, step-by-step post to show how to do it from start to finish.
This post is going to cover how to set up your server to run the JBoss Application Server – parsing ColdFusion code in its web apps. Future posts will cover how to set up JBoss AS/Apache/ColdFusion, and JBoss AS/JBoss WS/ColdFusion.
The first thing you need to do is download and/or run the ColdFusion installation package. During the installation wizard, ensure that you choose to install the J2EE/WAR installation type. When the installer is done, go to the installation directory in which you will see a cfusion.war file.
A WAR file (Web Application aRchive) is simply a ZIP archive, which means you can use whichever program you have for unzipping files. Simply unzip the archive into any location you choose. When done, you will have three directories:
The only two you will be interested in are the WEB-INF and CFIDE directories. You can safely delete the META-INF directory.
Now you can download and install the version of JBoss that you want to run your applications. Installation is as easy as unzipping the downloaded ZIP file to the directory from which you want to run JBoss. When done, you’ll have the following directory structure:

Notice the SAR and WAR directories under the deploy directory. You need to create one for your new web application. For example, if your application is the website for www.widgets.com, simply create a widgets.war directory.

Remember the WEB-INF and CFIDE directories you unpacked previously, well now we need them. Copy them from their current location to your new widgets.war web application directory. Amazingly, you are almost done! These two directories are all that is needed to get a JBoss web app to parse ColdFusion files.

Now, here’s where you need to determine how JBoss is going to serve your Widgets application. This is done by creating a jboss-web.xml file inside the widgets.war\WEB-INF directory.

If the Widgets application is the only application you want to server from JBoss, or it is going to be your root application – in both cases, what you want served when someone hits www.widgets.com – you specify this application as the root application. This is what the jboss-web.xml file would look like.

However, if you want this application to be a subdirectory off of your root, you would specify that subdirectory name in the jboss-web.xml file.

The last thing you might need to do – if JBoss is functioning as your main web server – is change the port on which JBoss is listening. For this, you need to look inside the deploy\jbossweb-tomcat50.sar\server.xml file.

The very first setting in this file is the port on which Tomcat is listening for HTTP requests. The default value is 8080, but if JBoss is your default web and application server, you will need to change the port attribute value to 80.

This is the most basic configuration for JBoss / ColdFusion. After completing these steps, you can start your JBoss instance and hit your designated URL and ColdFusion files will light up.
For more advanced configurations of JBoss, here are some links to other relevant posts.
Running multiple ColdFusion instances
Securing your JBoss web applications
Hosting multiple domains in JBoss
Flexible ColdFusion deployment – serving from anywhere
48 Responses for "Setting up ColdFusion on JBoss: A Standalone Primer"
Steve – thanks for a great piece of documentation.
I have just followed these instructions and it was very very simple. Love your work!
Andrew.
Thanks for putting this together. I’ve been trying to install CF on top of Tomcat. It works fine with one big exception: I cannot create datasources in administrator. Have you experienced any such problems with the install on JBoss?
By the way, “He may look dumb, but that’s just a disguise” is a Charlie Daniels quote from Uneasy Rider. Is that also in a Willie Nelson song?
Thanks!
Nat
I am trying to do what you have achieved, however, I am trying to deploy EAR file with WAR files in it. I am trying to deploy expanded archive files where the cfusion.ear file is a folder rather than a compressed file. The same is true of the cfusion.war and rds.war folders within.
I have successfully made this work on jboss 4.0.4 on Linux however, having some conflicts with commons-logging related versions on Mac OSX. Have you run into this at all?
Thanks in advance for your help.
Taskin
I haven’t done any installations on a Mac, but I suspect the problem you’re running into isn’t just isolated to Mac systems. It’s a fairly common problem, and one I ran into when I did my first ColdFusion/Jboss installation. However, it usually involved the LOG4J library and not the commons-logging, so I hope this fix will work for your problem as well.
The conflict arises because the library that is provided with JBoss (\jboss-4.0.3\server\default\lib\commons-logging.jar) conflicts with the one provided by ColdFusion (\jboss-4.0.3\server\default\deploy\app.war\WEB-INF\cfusion\lib\commons-logging-1.0.2.jar).
The conflict can usually be eliminated by making sure that the cfusion/lib directory is not on the server’s CLASSPATH. That way, ColdFusion apps use the logging provided in their own WEB-INF instead of the one provided by the server.
I have put my cfusion and cfclasses directories outside of the jboss folder, but am still getting logger errors – is there anything else you needed to do? If not, can you send me an email and let me email you some more details?
Daniel, I responded to your email yesterday. Check your spam or junk filter to make sure it wasn’t caught there. I just sent the email again. Let me know if you don’t get one soon.
Steve, by any chance have you tried to install CF within JBoss portal? I followed your instructions to get CF to work within JBoss but I haven’t got it to work within the portal application. Thanks.
Hi Steve,
Thank you for this primer – it’s very well explained. I’m running into a small problem and i was wondering if you might have some insight. Here i s my setup : Xserve (quad Xeon 64-bit) running os X 10.4 and uses Java version 1.5.0_06 from Apple – so i deploy CFIDE and WEB-INF from cfusion.war in a new .war directory that i created under “deploy”. If i run a pretty basic cf page within that directory it works (cfloop for example) but trying to access the administrator webapp to set up my cf server i get the following error from java :
13:25:35,388 ERROR [[CfmServlet]] Servlet.service() for servlet CfmServlet threw exception
java.lang.ExceptionInInitializerError
at org.apache.catalina.connector.Response.addCookie(Response.java:947)
Maybe i need to change something about the java library it uses or something like that – have you ever heard about this or know what i could do to fix it?
Thank you in advance.
Sorry, I have no experience on the OSX platform, and unfortunately have never seen that error before.
Not sure why adding a cookie would cause an error. I don’t think it’s a problem with your JRE. Perhaps try deleting your CFIDE folder and then copying over a fresh copy. Restart your server and try again.
First off, thanks for putting this walk-thru toghether! Freaking awesome.
You say you’ll cover how to share one instance of CF with various CF apps in another post– Could you perhaps give a sneak preview as to how to do it?
A virtual directory, some type of context magic, perhaps?
A virtual host with a modified web.xml, jboss-web.xml, and that’s it? Closer?
Any clue?
Thanks again for the great resource! Yer blog rocks!
Hi Steve.
Thanks for this article. It seems like Jboss can’t serve me anything but .cfm files… All images, css and js files are simply not found. Any ideas?
(I’m serving from port 8080 – its a development environment)
Thanks
Harel
Wow that WAS easy… thanks for the write up. I’m getting the same results as Harel.
I’m not very familiar with JBoss/Tomcat but I’m assuming that because images are being served in other applications like the jboss admin, it must be a configuration issue with the coldfusion application.
Could some one point me in the right direction??
So I changed the port from 8080 to 80 and now it works. Not really sure why this is??
hmmm….
-Aaron
I’ve gotten CFMX 6.1 to run well under JBoss, only problem I’m having is with webservices. CF creates the java source in cfc-skeletons, but can’t compile to a java class. JBoss throws this error:
ERROR [STDERR] error: compiler message file broken: key=compiler.err.file javax/servl
et/jsp/PageContext.class not found arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}
I’m assuming there may be a conflict similar to the log4j stuff mentioned above. Anyone else seen this problem?
Hi Steve,
I have apache 2.2 and want to use Coldfusion MX7 and Scorpio together on Jboss. I created the directories from the WAR files as you described. Put them in the C:\jboss-4.2.0\server\default\deploy\scorpio.war (for scorpio) and C:\jboss-4.2.0\server\default\deploy\cfmx7.war (for CF 7). That’s where I’m lost. How do I connect apache to JBoss? What do I have to setup in the JBoss server.xml file to tell JBoss to use both Coldfusion applications?
Hope you can shed some light since documentation on JBoss is sparse.
Marc
[...] I downloaded CF8 and followed my typical procedures for deploying on JBoss. Everything worked fine. JBoss started up without any errors and I could hit my applications. Then I decided to see if I could still customize the deployment by moving the core ColdFusion files outside the deployment directory and that went without a hitch. I don’t know why, but I was concerned that they might take that option away. [...]
[...] The only thing you need to change on JBoss to have Apache act as a proxy to it is ensure that is it not listening on port 80 (which you may have set if it was acting as your web server). Read step 5 in my standalone primer article for instructions on how to change your HTTP port if you haven’t done this before. [...]
Hi Steve,
Sorry if this is a general question, but do you have a quick few points on why you’d be using JBoss instead of the embedded JRun?
Well, it all started a few years ago when I was working for a company in Pittsburgh. All of the corporate Java apps were deployed on JBoss and when our department’s app was planned to be folded into the automated build/deploy system, we had to roll over to JBoss deployment.
Now, years later, that I’ve had an opportunity to run CF on both JRun and JBoss, I’ll pick JBoss every time for a few reasons.
1. JBoss is constantly getting updates and improvements while JRun development has been stopped.
2. JBoss is more easily configured to run multiple domains.
3. I can customize the JBoss deployment much more to my liking than JRun
4. JBoss has been more reliable in my experience than JRun.
[...] I have a JBoss 4.05 Server running Tomcat and ColdFusion 8, basically following the easy instructions at Steve Brownlee’s blog when I had first set it up with ColdFusion7, then updating it with ColdFusion 8, using the advice from Adobe.? When I attempted to use the Flex application deployed in a “bin” folder which was *not* in the root, that is it was several subfolders away from the root, the server acted as if the html container and the swf file were simply not there.? I tried several things before eventually simply renaming the deploy folder to “out”.? Immediately, the server recognized the deployed html and swf.? I haven’t yet determined what exactly is going on, but I know the bin folder has various application specific uses for JBoss and Tomcat.? It seems as though this is interefering, once again, with the default “bin” folder output for Flex deployment.? I’ve updated the project, locally, to build to “out” and mapped the application to “out” and it is all working just fine. [...]
Steve, great article, i had working with CF since 1997 always with proper application server. Today i am doing CF with J2EE Application Server with JBoss. This article was great for getting and idea about what i do need for getting work CF in JBoss. Thanks for this support.
Hi Steve,
Iam new bie to JBOSS.
I need to deploy multiple applications in JBOSS.
how do i do.whether i need to create complete folder structure for each application. or can we deploy both the application in same ‘deploy’ folder.i need to configure my each application to separate dataSource.
Thanks in Advance.
Hi, I’m working on a coldfusion code right now, and I would wish to know if anybody have tried, calling JBOSS objects from coldfusion codes… like really running the workflow from CF codes?
hope somebody could help… thanks
Many thanks Steve for the great article. I had been using JBOSS for my J2EE work and decided to install CF8 on my MacBook. Your instructions made the install very easy. Have a great new year.
larry
Hi Steve,
This is probably a dumb question, but do you have to redeploy the entire cf war directory each time you make a change on a template? Or can you just make the change on the template or cfc in question in the deploy directory and not have to redeploy everything?
thx,
larry
Steve, I installed CF 8 as .ear file over jboss 4.3 and it worked. I moved my app root directory under deploy dir and I can access it but now I’m trying to do a url redirect so I don’t have to access my site like
http://localhost:8080/cfusion/portals/mysite. I want to access like http://localhost:80 or http://localhost:80/mysite. I followed ur instructions and created a mysite.war dir under deploy and then copied the cfide and web-inf and created a jboss-web.xml with / as context root and even /mysite. Also I changed server.xml under C:\jboss-eap-4.3\jboss-as\server\default\deploy\jboss-web.deployer so it has the port as 80 but it doesn’t work the way I expected. I guess I’m missing something but don’t know what. I can access admin like http://localhost:80/mysite/cfide/administrator which isn’t surprising since cfide dir was there but how will it recognize the app files since they were under different dir and how can I access them like http://localhost:80/mysite. I’m sure I’m missing something simple. Any help?..
Thx
Francis
Well Just like as I thought I was missing something simple. I moved my app code to mysite.war and it worked. duh me :-)
@Francis, sorry I didn’t respond earlier, but I’m glad you got it solved. Duh!! :)
Steve, Thanx for responding. Now that I got my app working like http://localhost:8080/mysite, I was wondering how to make it work like http://localhost?. Any help or suggestion is appreciated.
I tried Apache with mod_jk but I don’t think I’m doing it correctly. I have setup Apache correctly since I got the default html page when I access like http://localhost:80 but not sure how to tie coldfusion,Tomcat and Apache.
It looks like I was trying complicate things by bringing in Apache and mod_jk. Anyway I was able to get it working just using Tomcat using your instructions. Also I used your article about basic authentication for directories. Very simple but a great article. Thanx Steve.
It’s unsupported, but I was able to run CF8 under JBoss 5 by disabling the JSafe JCE stuff:
You can do this by setting the “coldfusion.disablejsafe” System property to “true” by adding the following to ColdFusion’s JVM arguments:
“-Dcoldfusion.disablejsafe=true”
I’m running the CF8 64 bit version under OS X 10.5, and it hauls, man! JBoss 5 starts a good bit quicker too. I’m sooooo happy.
[...] installation was dumb simple … check out this blog post for general directions. It’s kinda old but the steps are the same, but don’t pay too [...]
[...] Setting up ColdFusion on JBoss: A Standalone Primer http://www.fusioncube.net/?p=94 [...]
[...] Setting up ColdFusion on JBoss: A Standalone Primer http://www.fusioncube.net/?p=94 [...]
This is a great article. Any chance you have deployed a CF app with a Seperate J2EE app on JBOSS that need to share the same session? How did you accomplish this? Without Cookies.
Ok, I have the cfm files rendering in on JBOSS with above configuration. It would appear that the application.cfc is being ignored though. When I hit a component the APPLICATION.DNS that is set in the application.cfc on on Application startup was not set. I get the “Element DSN is undefined in APPLICATION.” error message.
Hi Steve,
We were following your install guide and noticed your directory structure for 4.0.4 is MUCH different than what is in the JBoss 4.2.x package. (4.2.3 to be exact)
We’re lost as to where to put things after Step 2.
Any light you can shed on this?
Thanks!
Dan
Dan:
I’m actually deployed on 4.2.2 and the directory structure is exactly the same as my instructions. I suspect that not much changed between 4.2.2 and 4.2.3. Perhaps you could be more specific in what is different in your deployment.
Here’s the directories I see under our jboss-4.2.3.GA-src directory (expanded from the JBoss download site):
This is the first level of directories we see:
aspects
build
cluster
connector
console
deployment
docbook-support
ejb3
ejb3x
hibernate-int
iiop
j2ee
jaxrpc
jms
jmx
management
messaging
naming
remoting-int
security
server
system
test
testsuite
thirdparty
tomcat
tools
transaction
varia
webservices
Dan
Nevermind. We downloaded the non-jems version (source). Once we got the jems installer, we now have the right files. :-)
Hi guys,
i followed the instructions to the letter (it was a struggle as i am new to linux/unix) and im still having problems with accessing the cf application.
The strange thing is, i had it working yesterday afternoon (i dont think i changed anything in the JBoss/CF configuration) and i was able to get access to the cf administrator. Today though (even after a clean install of cf8) i am still not able to contact pages on the cf server.
The JBoss log file says that cf has started and it is using the context root i have set.
Please let me know if there is anything you need to know for me to help you help me.
Cheers,
Barry
Hey Steve,
Have you had any problems invoking webservices with jboss and coldfusion, I am having an issue where i cant register webservices in the coldfusion administrator or pull them up through pages but they work when i go to them directly in the browser.
Hi Guys,
I am trying to deploy CF7 onto JBoss and preferably version 5.1. Based on your experience, what is the latest version of JBoss that I can deploy CF7 onto?
Thanks.
@Farhad: Nope, haven’t had any problems with Web Services and JBoss.
@Kenny: 4.2.2 is the version on which I can easily deploy ColdFusion 7. Some folks have said that they have made it work with higher versions, but it’s a pain.
Thanks Steve. I was able to deploy CF8 on 4.2.2.
No luck with CF7. Although the application works, I see lots of errors in the log.
Hey Steve,
I have multiple instances of cold fusion running under jboss, I was wandering if there was a to restart just one instead of restarting jboss altogether incase one goes down.
Hi Steve
Have you managed to run coldfusion 8 or 9 on Jboss 7 or 6
Leave a reply