Is it possible to run Railo on Heroku?

297 views
Skip to first unread message

Molnfront

unread,
Nov 2, 2011, 10:04:23 PM11/2/11
to Railo

I need advice on what the best way to deploy a Railo app on Heroku
would be? I know I need to change the pom file and ad the right
dependencies, and probably a lot of other things.

So my question is: is it possible to run a Railo app on Heroku?

I have not seen anyone else trying to do that , so maybe it´s not a
practical solution?

If it´s possible and I get the benefits of not having to manage
servers and hardware, my goal is to have a Railo app with MongoDB as a
database backend.

In this blog post I get the feeling that it could be possible:
http://ollivander.franzoni.eu/2011/10/deploy-any-java-webapp-via-war-to.html

Sean Corfield

unread,
Nov 2, 2011, 10:41:54 PM11/2/11
to Railo
On Nov 2, 7:04 pm, Molnfront <go...@molnfront.com> wrote:
> I need advice on what the best way to deploy a Railo app on Heroku
> would be? I know I need to change the pom file and ad the right
> dependencies, and probably a lot of other things.
>
> So my question is: is it possible to run a Railo app on Heroku?

Based on that blog post, yes, I expect it's possible but not very
practical.

You'd have to deploy Railo as a WAR locally on Jetty, add your code in
and then roll it back up into a WAR and then git commit / push that
(replacing mywebapp.war in the blog post) so you'd be committing and
pushing ~40MB or more each time... and using git on binary files is
not a great idea anyway.

I started looking at the dependencies Railo is built on to see if I
could figure out a Maven-based build process but some of the libraries
don't seem to be in Maven Central. It might be a more tractable
problem if someone sets up Nexus or Artifactory on a public server
somewhere with all the necessary Railo JARs and appropriate metadata.
Then you could point the pom.xml at that repo and just commit & push
CFML code and have Heroku pull the dependencies and deploy Railo
automatically.

There would still be some odd logistics to deal with - the Railo
config would have to be applied programmatically I suspect as part of
the app initialization process.

Heroku is really designed for lightweight apps and even tho' Railo is
much lighter weight than Adobe ColdFusion, it's really still too big a
set of JAR dependencies to be a realistic option for Heroku. IMO.

Sean

Mark Drew

unread,
Nov 3, 2011, 5:06:22 AM11/3/11
to ra...@googlegroups.com
Have you looked at cloudbees?

MD
Sent from one of my many iDevices

Molnfront

unread,
Nov 3, 2011, 1:29:21 PM11/3/11
to Railo
I got this reply from Heroku Support:

Hi,Yes, this is possible from the looks of it. I'm not familiar with
Railo, but I've taken a brief look at the configuration and it's using
Jetty under the hood. Heroku plays really nicely with Jetty, so I
think it's just a matter of bootstrapping the app correctly.
Railo has instructions for using it with Maven here: http://railo-repo.sourceforge.net/
I've put together a really simple example (based on Railo's sample
Maven project) that you should be able to push to Heroku without any
issue:https://github.com/naamannewbold/railo-heroku-example
The sample creates a WAR that deploys onto Jetty. Keep in mind that
this is just a sample -- there is clearly more to Railo and how to run
it based on a quick look at their startup scripts. It may be that this
is a sub-optimal solution, or that it works just fine. You might check
in their forums and bounce it off some of their devs as to whether or
not this is a good way to go.
I hope this helps. Let me know if you have any questions.
Thanks,Naaman

I haven´t got time to try it. But it sounds like a similar solution to
yours. I agree that it´s not very practical.

Molnfront

unread,
Nov 3, 2011, 1:37:56 PM11/3/11
to Railo
Yes I have had a breef look at Cloudbees, but have not tried it. I
have also tested Jelastic.
> >http://ollivander.franzoni.eu/2011/10/deploy-any-java-webapp-via-war-...

Mark Drew

unread,
Nov 3, 2011, 1:47:50 PM11/3/11
to ra...@googlegroups.com
Cloudbees is pretty awesome, since you don't have to upload your WAR all the time. of course, you have to make sure you are all setup when you upload it, since it uploads the config.

I haven't played with it in a while, but I did post about it
http://www.markdrew.co.uk/blog/post.cfm/running-railo-in-cloudbees

Regards

Mark Drew

Matthew Woodward

unread,
Nov 3, 2011, 1:43:13 PM11/3/11
to ra...@googlegroups.com
Cloudbees is the bees' knees. :-) Works really well.


On Thu, Nov 3, 2011 at 10:37 AM, Molnfront <go...@molnfront.com> wrote:
Yes I have had a breef look at Cloudbees, but have not tried it.  I
have also tested Jelastic.

On 3 Nov, 10:06, Mark Drew <mark.d...@gmail.com> wrote:
> Have you looked at cloudbees?
>
> MD
> Sent from one of my many iDevices

--
Matthew Woodward
ma...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Molnfront

unread,
Nov 3, 2011, 11:49:43 PM11/3/11
to Railo
I got it working. By using this Railo maven repo: http://railo-repo.sourceforge.net/.
The realy helpful support at Heroku built this:
https://github.com/naamannewbold/railo-heroku-example

And as Naaman points out:
Just to clarify: you're not committing a WAR file, you're building a
WAR file on our service from source.

So I only had to struggle with git and Heroku toolbelt. But in the end
it was a realy simple develop/deploy process.

Now it´s minor things such as the adminstrator, welcome file, database
access, user sessions and so on that has to be dealt with. I hope it´s
not a dead end.

The railo version is 3.1.2.007

The Compiled slug size is 72.0MB, wich is a bit heavy, but I have 28
MB left, wich will be more than enough for my app.

Here´s the url to my railo heroku app wich shows the time only:

http://stark-samurai-1774.herokuapp.com/index.cfm


So my next obvious question is: how do I add a web gui administrator?

Maybe there is no need for that if I can alter it programaticaly with
cfm code or an xml file or similar.


On 3 Nov, 18:43, Matthew Woodward <m...@mattwoodward.com> wrote:
> Cloudbees is the bees' knees. :-) Works really well.
>
> On Thu, Nov 3, 2011 at 10:37 AM, Molnfront <go...@molnfront.com> wrote:
> > Yes I have had a breef look at Cloudbees, but have not tried it.  I
> > have also tested Jelastic.
>
> > On 3 Nov, 10:06, Mark Drew <mark.d...@gmail.com> wrote:
> > > Have you looked at cloudbees?
>
> > > MD
> > > Sent from one of my many iDevices
>
> > --
>
> Matthew Woodward
> m...@mattwoodward.comhttp://blog.mattwoodward.com

Randy Merrill

unread,
Nov 3, 2011, 11:56:06 PM11/3/11
to ra...@googlegroups.com
You may want a password on there:


--
Randy Merrill

Randy Merrill

unread,
Nov 3, 2011, 11:56:48 PM11/3/11
to ra...@googlegroups.com
And don't forget the web admin:

Randy Merrill

unread,
Nov 4, 2011, 12:05:51 AM11/4/11
to ra...@googlegroups.com
That is cool that is running. You will probably need to test this, but my guess is that every time you push out to heroku it is going to overwrite your settings in the admin. So that may have to be part of the repository?

See your WEB-INF/railo-web.xml.cfm for the settings. I believe that one controls your web admin. Not sure where the server admin one would be?
--
Randy Merrill

Molnfront

unread,
Nov 4, 2011, 12:15:45 AM11/4/11
to Railo
Password set! Thanks for the url to them!

Had no idea where they where, I am more familiar with openbd.
I have no settings for that in /WEB-INF/ and the file that has the
name web.xml contains only servlet names and mappings.

> --
> Randy Merrill

Molnfront

unread,
Nov 4, 2011, 12:59:04 AM11/4/11
to Railo
I have examined the pom file more cloesly now, and the railo maven
source is pulled from sourceforge by heroku after I have commit it to
Heroku (Heroku builds it). Probably I will get more control if I build
a new railo maven project based on latest railo and add passwords and
other stuff before commit.

Gert Franz

unread,
Nov 4, 2011, 5:21:27 AM11/4/11
to ra...@googlegroups.com
Oh and the web admin is still open for me...

http://stark-samurai-1774.herokuapp.com/railo-context/admin/web.cfm

Greetings from Switzerland
Gert Franz
 
Railo Technologies      Professional Open Source
skype: gert.franz         ge...@getrailo.com
+41 76 5680 231           www.getrailo.com

-----Ursprüngliche Nachricht-----
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
Molnfront
Gesendet: Freitag, 4. November 2011 05:16
An: Railo
Betreff: [railo] Re: Is it possible to run Railo on Heroku?

Molnfront

unread,
Nov 4, 2011, 10:53:47 AM11/4/11
to Railo
I think that changes who occur after deployment is not persistent.
Because I added password and also upgraded to latest version from
within the administrator yesterday. All that was gone today. Not a big
problem if it´s possible to add it before I push it to Heroku.

On 4 Nov, 10:21, "Gert Franz" <g...@getrailo.com> wrote:
> Oh and the web admin is still open for me...
>
> http://stark-samurai-1774.herokuapp.com/railo-context/admin/web.cfm
>
> Greetings from Switzerland
> Gert Franz
>
> Railo Tec Not a big problem if hnologies      Professional Open Source
> skype: gert.franz         g...@getrailo.com

Denny

unread,
Nov 4, 2011, 4:28:05 PM11/4/11
to ra...@googlegroups.com
On 11/4/11 8:53 AM, Molnfront wrote:
> I think that changes who occur after deployment is not persistent.
> Because I added password and also upgraded to latest version from
> within the administrator yesterday. All that was gone today. Not a big
> problem if it�s possible to add it before I push it to Heroku.

This is *perfect* for cfdistro. You could have one build that has
debugging and whatnot on, for local testing, and another to configure
the heroku deployment (full caching, no debug, etc.).

You'd just set

war.target.dir=${src.dir}/main/webapp
server.sharedlibs=true

in build.heroku.properties, run "cfdistro build build.type=heroku", and
theoretically the only real things that would be created would be
railo-web.xml and railo-server.xml, and optionally an .rc file. Commit
those, and away we go.

But basically, without using cfdistro, you should be able to commit ONLY
the railo-*.xml files and any patches in lib/railo/patches, and ignore
the rest, and have your Railo server on heroku start up password
protected and configured how you like.

:Denny

--
Railo Technologies: getrailo.com Professional Open Source
Skype: valliantster (505)510.1336 de...@getrailo.com
GnuPG-FP: DDEB 16E1 EF43 DCFD 0AEE 5CD0 964B B7B0 1C22 CB62

Randy Merrill

unread,
Nov 4, 2011, 4:33:48 PM11/4/11
to ra...@googlegroups.com
This would make a really cool wiki page to have all the information on how to run Railo on Heroku.

PS... how is the cfdistro documentation going :)
--
Randy Merrill

Denny

unread,
Nov 4, 2011, 4:52:13 PM11/4/11
to ra...@googlegroups.com
On 11/4/11 2:33 PM, Randy Merrill wrote:
> This would make a really cool wiki page to have all the information on
> how to run Railo on Heroku.

Agreed! The maven repo has old libs, it would be nice to add 3.3. This
was actually the first I'd seen it, unless I'm mistaken... do we know
who's maintaining it?

> PS... how is the cfdistro documentation going :)

Piecemeal but there's a good bit actually, in my local wiki, which I'll
sync up with the public one Real Soon Now. :)

I'm *so* bad about getting stuff out there. I had a scare recently that
makes me VOW to change my ways! VOW! For someone who preaches VCS,
etc., I'm horrible about keeping stuff on one machine. It is BAD BAD!
Git that stuff out there, den!

Molnfront

unread,
Nov 5, 2011, 2:03:36 PM11/5/11
to Railo
I am in the process of preparing a railo maven 3.3.0 setup and are
creating the pom file.

Right now i am trying to find the right version numbers for the
dependencies. What is the easiest way to figure them out?
There is not much version numbers in the jars folder.

This is how a dependency look:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

Mark Drew

unread,
Nov 5, 2011, 2:49:39 PM11/5/11
to ra...@googlegroups.com
Dude, I had to replace my hard drive recently.

I also use TimeMachine and restored my machine on Friday after a freak crash, no problems. Get a 1TB external disk and you are set.

Oh and I have been using https://bitbucket.org/ for my private git repos. Just saying.


MD
Sent from one of my many iDevices

Sean Corfield

unread,
Nov 6, 2011, 2:58:58 PM11/6/11
to Railo
On Nov 5, 10:03 am, Molnfront <go...@molnfront.com> wrote:
> I am in the process of preparing a railo maven 3.3.0 setup and are
> creating the pom file.
>
> Right now i am trying to find the right version numbers for the
> dependencies. What is the easiest way to figure them out?
> There is not much version numbers in the jars folder.

This was where I got stuck trying to create a Maven setup for Railo
recently :(

Sean

Mark Drew

unread,
Nov 6, 2011, 3:06:13 PM11/6/11
to ra...@googlegroups.com
The way I found out is to loop through the jars and look in the META-INF folder. (off the top of my head) and there is a version number in there usually.,

Just treat them like zip files, I am sure we can quickly write a script to do this…

MD

Denny

unread,
Nov 6, 2011, 4:03:58 PM11/6/11
to ra...@googlegroups.com
Yeah, my main problem is organization/process. I hadn't been syncing up
with time machine every day (sometimes quite a bit more than a day),
hadn't been branching as much as I should've, pushing as much as I
should've, communicating as much as I should've, etc..

I've been rectifying all of this, but it can't happen soon enough!

Messing with git ATM, which is still a bit of an adventure. Dangerously
powerful stuff. :)

:Denny

Denny

unread,
Nov 6, 2011, 4:26:57 PM11/6/11
to ra...@googlegroups.com

If you use your own maven repo (like the one on sourceforge) you don't
have to worry about versions, per se (you put whatever you need in it),
but this bypasses one of the main reasons to use Maven. :-P

There's no way to get around using our own repo, or creating one on a
public provider (I submitted a request to sonatype the other day), as
we've got dependencies you won't find in maven central.

Personally, I think the easiest option would be to have our own maven
repo (slap nexus on a server somewhere, something like dev.getrailo.org?
Or create another sourceforge one managed by the team), vs. trying to
get all our dependencies into maven central-- but there's no reason to
not get as much as we can from central. (caveat: I use maven for some
stuff but am not an expert).

The reason I like the idea of getting as much as we can from maven
central, is that we're using a lot of older versions of various libs,
and maven does make getting newer ones easier (depending on the lib!).

For things like heroku, a separate repository is fine IMO-- you're not
really building railo, you're building a Railo war.

:Denny

Denny

unread,
Nov 6, 2011, 4:53:23 PM11/6/11
to ra...@googlegroups.com
On 11/6/11 1:06 PM, Mark Drew wrote:
> The way I found out is to loop through the jars and look in the META-INF folder. (off the top of my head) and there is a version number in there usually.,
>
> Just treat them like zip files, I am sure we can quickly write a script to do this�

LOL. Did that-ish ages ago for a discussion on updating libs for 4.0:

http://pastebin.com/wRaptqEs

Bit of an ugly thing, but it generates this, basically:

http://pastebin.com/bxjkV8Ue

:Denny

Mark Drew

unread,
Nov 6, 2011, 5:16:29 PM11/6/11
to ra...@googlegroups.com
Git rules sir!

MD

Molnfront

unread,
Nov 6, 2011, 5:26:06 PM11/6/11
to Railo
Yes, I found this solution:

http://www.bennadel.com/blog/1372-Listing-All-Classes-In-A-Jar-File-Using-ColdFusion.htm

Haven't tried it yet. I also found the versions file in /jars.

I am going to get admin rights on the repo ((http://railo-
repo.sourceforge.net/), so I can update it to 3.3.1. But I can't see
how it would be useful. I need to change the password before I git
push it to Heroku, and I don't want to have it in a public repo.

Right now I am trying to set up the folder structure.

I have this folder structure:

src
pom.xml
-- main
-- webapps
-- WEB-INF
-- lib (jar files)

On 6 Nov, 22:53, Denny <de...@getrailo.com> wrote:
> On 11/6/11 1:06 PM, Mark Drew wrote:
>
> > The way I found out is to loop through the jars and look in the META-INF folder. (off the top of my head) and there is a version number in there usually.,
>
> > Just treat them like zip files, I am sure we can quickly write a script to do this
>

Denny

unread,
Nov 6, 2011, 10:44:37 PM11/6/11
to ra...@googlegroups.com
On 11/6/11 3:16 PM, Mark Drew wrote:
> Git rules sir!

That it does!

Some of it is still a wee bit strange to me though. Take this for instance:

git fetch origin develop
git checkout -b test origin/test
git pull origin develop
git status
# On branch test
# Your branch is ahead of 'origin/develop' by 27 commits.
#
nothing to commit (working directory clean)

How am I ahead of origin/develop? Why did git pull, um, pull stuff that
git fetch+checkout didn't get?
...
Ah ha! git fetch doesn't do what I thought it did! When I added a
colon to git fetch origin develop:, it fetched more stuff.

Still seems a bit strange, but at least I know there's a difference!

Denny

unread,
Nov 6, 2011, 10:46:47 PM11/6/11
to ra...@googlegroups.com
On 11/6/11 3:26 PM, Molnfront wrote:
...

> I am going to get admin rights on the repo ((http://railo-
> repo.sourceforge.net/), so I can update it to 3.3.1. But I can't see
> how it would be useful. I need to change the password before I git
> push it to Heroku, and I don't want to have it in a public repo.

You shouldn't have to keep the passwords in a public repo, but you will
need to commit it to a private one at least, which you push to heroku,
as that's how you get stuff into heroku.

Of course what you'll actually be committing will be the config files,
which will contain the passwords.

I'm pretty sure cfdistro would work to generate just the stuff you need
to commit (2 files or so). After I give the kid a bath I can give it a
quick spin. Good for the brain to do something different :)

Denny

unread,
Nov 7, 2011, 12:08:56 AM11/7/11
to ra...@googlegroups.com
Here's what I came up with:

https://github.com/denuno/railo-heroku-cfdistro

That one doesn't include cfdistro itself (it would be a lot of useless
stuff to push to heroku, and by default cfdistro is installed in the
user's home directory, vs being in with the project), but it should show
you one way of doing this that doesn't leave you with a lot to manage.

Check out the pom.xml, where I have it copy my src and pub directory
content into the WAR as part of the build up on heroku. This allows me
to keep my preferred project structure (the pub dir is usually the
DocumentRoot for apache, or static resources we'd put in S3, etc.).

Basically what this means is that I can use the same source files for
local development, deployment to a "normal" server, or heroku. And the
heroku stuff is contained in one folder (./heroku).

Check out what's in heroku/WEB-INF to see what I was talking about as
far as very little to actually commit.

The admin password is defined in build/build.properties, and when the
config files are generated they'll contain it (encrypted).

I generated the stuff in heroku/WEB-INF by doing:

./railo-heroku-cfdistro build build.type=heroku

(./railo-heroku-cfdistro is an alias for cfdistro executable)

Of course you'd need to slap cfdistro in your home directory to actually
try that part out, or I could add it to the git repo (but it would be a
waste of heroku space to do so for anything "real").

I see they're using jetty-runner too, which is slick (cfdistro uses
jetty-runner for localdev testing by default).

And it looks like .rc patches are getting loaded OK, but I believe any
jars you add to WEB-INF/lib would be overwritten by heroku's maven
build, but I didn't test that (besides seeing that you can use H2
databases if you put the path in as ./myh2db which is awesome!).

:Denny

On 11/6/11 3:26 PM, Molnfront wrote:

Denny

unread,
Nov 7, 2011, 12:13:31 AM11/7/11
to ra...@googlegroups.com
The running heroku app is here:

http://sharp-waterfall-9836.herokuapp.com/

And I did *not* set the passwords manually, those are coming from the
config files in heroku/WEB-INF/*/railo-*.xml that cfdistro generated.

Basically I just uploaded the generated stuff in ./heroku, after moving
the css/images from there into pub (it's pretty), and that's it.

Molnfront

unread,
Nov 8, 2011, 11:43:36 AM11/8/11
to Railo
Great! I will try it tomorow!

Git has its pecularietes.

Have you any wiki docs written about it??

Right now I am being punished by Google and have lots of GAE to
optimize.

Molnfront

unread,
Nov 8, 2011, 7:02:25 PM11/8/11
to Railo
I checked your heroku app and saw this at the bottom:

Now we're going to test that src got in here too:
<cfset heroku = new herokucore.Heroku()>
<cfoutput>#heroku.getNow()#</cfoutput>

Is it cf script that has not been processed or?

Molnfront

unread,
Nov 8, 2011, 7:08:51 PM11/8/11
to Railo

Hm, src = pre

Denny

unread,
Nov 10, 2011, 4:51:59 AM11/10/11
to ra...@googlegroups.com
On 11/8/11 5:02 PM, Molnfront wrote:
> I checked your heroku app and saw this at the bottom:
>
> Now we're going to test that src got in here too:
> <cfset heroku = new herokucore.Heroku()>
> <cfoutput>#heroku.getNow()#</cfoutput>
>
> Is it cf script that has not been processed or?

No, that was just showing the code that was going to run (if you see the
date below, you know it's running).

The idea was to show that you don't have to stick to the heroku/maven
layout for your project.

DL

unread,
Sep 26, 2012, 1:36:43 AM9/26/12
to ra...@googlegroups.com
Hi Denny,

Where are you on this? I just saw that Heroku is supporting Java.  But I am guessing it has been supporting Java all along?  In case I missed it, could you please share your Git project for this demo?

Was it easy to set up data sources?  Are there any issues with file access?

Thanks,

Derek

Igal

unread,
Sep 27, 2012, 4:35:14 AM9/27/12
to ra...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages