Create a scheduled task that runs every minute in Railo

So, this is probably confusing to some and I thought I'd try to clear this up. It's possible to setup Railo to run a task every x hour, minute and/or even seconds. You'll want to log into your machine and go to the Scheduled Task page ( e.g.: http://{your server}/railo-context/admin/web.cfm?action=services.schedule )

[More]

Random Friday Railo tip: this.datasource

Andy Jarret recently blogged about the usage of this.datasource in Application.cfc. Just goes to show, it pays off reading the patch notes sometimes because it has been there for awhile ( since version 3.1.0.018 ):

[000059] add support for default datasource to cfapplication/application.cfc
Go visit Andy's blog post for more details on how to use this.application. :) Another brief note is that this may be changing slightly in the future, but will always support the ACF Style ( this.datasource = "[some string]" ).

Railo Tip: CreateObject('java')

I'm actually hesitant to post this because the Railo team is actually trying to make progress on documentation and we have some new documentation policies in place. However, I know if I don't post this and people eventually find out about it, they'll wonder why they didn't know sooner. This tip pertains to Railo's createObject('java') implementation. I'm told that it has been there for awhile, but I couldn't tell you what build it came from. I'll share the code and go from there.

<cfset object = createObject('java','path.to.package.classtoinvoke','/path/to/jar/file/on/system')>

Read that line 2 or 3 times and let it sink in a little. Yes, Railo's createObject('java') has a 3rd (and 4th) argument. This is the full documentation on this from Michael is:

createObject('java',String className,String paths, String delimiter )
- 'java' (required)
- className (required) - the full class name (class and package) of the class to invoke.
- path (optional) - a list of jar files and directory that contains class files
- delimiter (optional) - delimiter used for the path list (default is comma ",")

Sean Corfield will be presenting this to the opemcfml.org advisory board, whether it gets voted on or not remains to be seen. Also, please note that I'm making Documentation/Wiki a high priority for the year 2010.

Railo 3.1.2 and Transfer

If you've installed or upgraded to Railo 3.1.2+ and you're also using Transfer, you may (or may have already) bumped into this error:

Message: Bean creation exception during init() of transfer.TransferFactory
Detail: read acccess is protected:to access the configuration without a password, you need to change the read access to [open] in the Server Administrator

To get around this issue, you'll need to do the following:

  1. Log into your server admin:
    • http://{hostname}/railo-context/admin/server.cfm?action=security.access
  2. Change "Access Read" to "Open" and save.

Nothing has changed in regards to code, but a decision was made to tighten down security.

Resetting password for the Railo admin

A question came up on the mailing list about how to reset passwords if you've forgotten them. This entry will cover both the server context and the local web context.

Server Context (e.g. http://{hostname}/railo-context/admin/server.cfm )

  1. You'll want to open up the railo-server.xml in your {railo installation}/railo-server/context/ directory.
  2. Look for the line that has "<railo-configuration" and blank out the value of password="".
  3. Restart the railo instance and when you reload, you'll be asked for a new password.

Local Web Context (e.g. http://{hostname}/railo-context/admin/web.cfm )

  1. If you've forgotten the password for a local web context, you'll want to make sure you have a default password first.
    • Log into http://{hostname}/railo-context/admin/server.cfm?action=security.password - Look for "Set default password" and set it.
  2. Open up {host root}/WEB-INF/railo/railo-web.xml.cfm
  3. Look for the line that has "<railo-configuration" and blank out the value of password="".
  4. Restart the railo instance and when you reload, you can type in the default password.
  5. Once inside the local web admin, you can click on password on the sidebar and change that local web context password.

Update (Dec 8th, 2009)

Heh. Shortly after this post, Micha pinged me as to why I didn't just point people to the password reset option in the server context. Truth be told, I forgot about it. Scroll all the way down to the bottom of http://{hostname}/railo-context/admin/server.cfm?action=security.password and you'll see this:
Reset Password - That will reset the password back to the default.

Railo and Tomcat installation

A Railo user just pointed out that we don't have links to my series of blog posts about installing Railo on Tomcat anywhere on the Railo site or blog so I figured I'd rectify that! I started the series in March (before I joined Railo) and continued through June, beginning with the simplest way to get Railo running (Railo Express) and working up through increasingly sophisticated configurations. Here are links to each of the posts:

Most of the posts are for Mac OS X but the Apache/Tomcat configuration applies on Windows just the same.

What's in a WEB-INF directory?

A question came up on the mailing list, Doug Boude was asking for what all was actually in the WEB-INF/Railo folder and what is it used for? Gert took the time to write up some documentation and post it online. The documentation includes an explanation of web context, what's in the WEB-INF folder, additional files as well as some tips and tricks.

Updating Railo behind Proxy / Firewall

If you're attempting to update your Railo server and you're behind a firewall / proxy with restricted outbound access, you can manually download the patch and install yourself.

The patches can always be found at:
http://www.getrailo.org/railo/remote/download/{full patch number}/{full patch number}.rc

So, for example, 3.1.1 is found at:
http://www.getrailo.org/railo/remote/download/3.1.1.000/3.1.1.000.rc

Now, once you have the .rc file downloaded, what do you do with it?

Depending on how your Railo is setup, you're looking the /railo-server/patches folder. In resin, it can be found {resin install}/lib/railo-server/patches -- So, if you're on a different JEE engine other than Resin, just look around for your /railo-server/patches folder and drop it in place. Once in place, restart the Railo instance in the server context ( http://{hostname}/railo-context/admin/server.cfm ). This will drop your current session and you'll have to re-log in. When you do, you should be patched!

Always something new to find in Railo

Even for myself this was absolutely stunning. I decided to write a series of tips for Railo and by doing this I stumbled across a problem Andrea Campolonghi had, who writes the Railo AJAX tag extensions we will include very soon. The problem was or is that he needed to read the content of a zip file that is inside another zip archive. Now how to do that without unzipping it into a local folder.

[More]

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