Problem setting an index.cfm welcomeFile on a Jetty 6 or 7 install

2 views
Skip to first unread message

shrike71

unread,
Apr 15, 2009, 12:06:26 PM4/15/09
to Railo
Hi all,

Wondering if anybody had the same problem. I also don't know if it's
related to Jetty or Railo itself. I pretty much managed to get railo
running out of the box on Jetty 6 and 7 by just unpacking the
railo.war file into <JETTY_ROOT>/webapps/ and adding a minimal context
file called railo.xml as below:

snip---

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
"http://jetty.mortbay.org/configure.dtd">

<Configure class="org.mortbay.jetty.webapp.WebAppContext">


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<!-- Required minimal context configuration :
-->
<!-- + contextPath
-->
<!-- + war OR resourceBase
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Set name="contextPath">/railo.war</Set>
<!--<Set name="war"><SystemProperty name="jetty.home" default="."/>/
webapps/railo.war</Set>-->
<Set name="resourceBase"><SystemProperty name="jetty.home"
default="."/>/webapps/railo.war</Set>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<!-- Optional context configuration
-->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<Set name="extractWAR">false</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home"
default="."/>/etc/webdefault.xml</Set>
<Set name="welcomeFiles">
<Array type="String">
<item>index.cfm</item>
<item>index.cfml</item>
<item>index.html</item>
</Array>
</Set>

</Configure>

---end snip

The only extra items i added to webdefault.xml were entries for
index.cfm and index.cfml in the <welcome-file-list> clause

Now I can get to ANY cfm page by going to it directly (admin interface
included), i.e. this works:

http://localhost:8088/railo.war/index.cfm

but if i try using default document behaviour by going to :

http://localhost:8088/railo.war/

I get a

HTTP ERROR 500

Problem accessing /railo.war/. Reason:

/apps/jetty6/webapps/railo.war/ (Is a directory)

error.

Now this happens for both Jetty 6 and 7, and it's been driving me a
bit bananas... i had no problem deploying Quercius PHP on Jetty 6 with
an index.php file in more or less the same way. Can somebody tell me
what am i doing wrong, or if there might be an issue with Railo?

Thanks,

Shrike71

Gert Franz

unread,
Apr 16, 2009, 2:47:40 AM4/16/09
to ra...@googlegroups.com
Shrike,

can you post it to the Jetty forums? The problem lies in the error message.
It's a Jetty message and not a Railo one... The XML looks fine from my
perspective. If you have the solution, can you let us know here as well?

Thanks a lot.

Greetings from Switzerland
Gert Franz
Railo Technologies GmbH
ge...@getrailo.com
www.getrailo.ch

Join our Mailing List
german: http://de.groups.yahoo.com/group/railo/
english: http://groups.google.com/group/railo
linked in: http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
Bug tracker: http://jira.jboss.org/jira/browse/RAILO
Railo Blog: http://www.railo-technologies.com/blog


-----Ursprüngliche Nachricht-----
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
shrike71
Gesendet: Mittwoch, 15. April 2009 18:06
An: Railo
Betreff: [railo] Problem setting an index.cfm welcomeFile on a Jetty 6 or 7
install

shrike71

unread,
Apr 16, 2009, 5:48:44 AM4/16/09
to Railo
Interestingly enough, i got rid of the railo.xml file in the contexts/
dir and i dropped an unpacked openbluedragon.war dir into webapps and
restarted jetty. Railo was still not able to process an index.cfm
welcome file and bluedragon was! I chopped and swapped loads of system
settings in the railo web.xml file to get it to match the one from
openbluedragon as far as possible without breaking it, still to no
avail.

Any insights, anyone?

Thanks,

shrike71

On Apr 16, 7:47 am, "Gert Franz" <gert.fr...@railo.ch> wrote:
> Shrike,
>
> can you post it to the Jetty forums? The problem lies in the error message.
> It's a Jetty message and not a Railo one... The XML looks fine from my
> perspective. If you have the solution, can you let us know here as well?
>
> Thanks a lot.
>
> Greetings from Switzerland
> Gert Franz
> Railo Technologies GmbH
> g...@getrailo.comwww.getrailo.ch

Tim N

unread,
Apr 16, 2009, 10:59:08 AM4/16/09
to Railo
If you look at the Javadocs for the
org.mortbay.jetty.webapp.WebAppContext, you'll see there is no
setWelcomeFiles method. So, Jetty is ignoring your list.

I've always put my welcome file list in my web.xml file and never had
a problem:

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

shrike71

unread,
Apr 16, 2009, 11:25:58 AM4/16/09
to Railo
Yes, I saw that later ... but i also have my welcome files
set in web.xml. Didn't seem to make any difference

Thanks

shrike71

shrike71

unread,
Apr 17, 2009, 7:27:26 AM4/17/09
to Railo
Same effect in Windows XP... only the error is slightly different:

For URL http://localhost:8088/railo/

HTTP ERROR: 500

C:\downloads\jetty\jetty-assembly-7.0.0.pre5\jetty-7.0.0.pre5\webapps
\railo.war\ (The system cannot find the path specified)

RequestURI=/railo/
Caused by:

java.io.FileNotFoundException: C:\downloads\jetty\jetty-
assembly-7.0.0.pre5\jetty-7.0.0.pre5\webapps\railo.war\ (The system
cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at railo.commons.io.res.type.file.FileResource.getInputStream
(FileResource.java:198)
at railo.commons.io.IOUtil.copy(IOUtil.java:153)
at railo.runtime.engine.CFMLEngineImpl.serviceFile
(CFMLEngineImpl.java:260)
at railo.loader.servlet.FileServlet.service(FileServlet.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
502)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:365)
at org.mortbay.jetty.security.ConstraintsSecurityHandler.handle
(ConstraintsSecurityHandler.java:220)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:822)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
305)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle
(ContextHandlerCollection.java:229)
at org.mortbay.jetty.handler.HandlerCollection.handle
(HandlerCollection.java:113)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
550)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:876)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:535)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407)
at org.mortbay.io.nio.SelectChannelEndPoint.run
(SelectChannelEndPoint.java:421)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run
(QueuedThreadPool.java:520)

Gert Franz

unread,
Apr 17, 2009, 7:31:22 AM4/17/09
to ra...@googlegroups.com
Are you sure you do not need to call /railo.war/ ?

Gert

-----Ursprüngliche Nachricht-----
Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
shrike71
Gesendet: Freitag, 17. April 2009 13:27
An: Railo
Betreff: [railo] Re: welcome files work out of the box in openbluedragon but
still not in railo...

shrike71

unread,
Apr 17, 2009, 8:01:09 AM4/17/09
to Railo
If i use the railo.xml context, no. I can go to http://localhost/railo/index.cfm

If i delete the railo.xml file and let it autoload then i do have to
go to http://localhost/railo.war/index.cfm, but the effect is the same
if i leave the default document off the end of the URL

Thanks,

shrike71

On Apr 17, 12:31 pm, "Gert Franz" <gert.fr...@railo.ch> wrote:
> Are you sure you do not need to call /railo.war/ ?
>
> Gert
>
> -----Ursprüngliche Nachricht-----
> Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im Auftrag von
> shrike71
> Gesendet: Freitag, 17. April 2009 13:27
> An: Railo
> Betreff: [railo] Re: welcome files work out of the box in openbluedragon but
> still not in railo...
>
> Same effect in Windows XP... only the error is slightly different:
>
> For URLhttp://localhost:8088/railo/

shrike71

unread,
Apr 20, 2009, 4:43:18 AM4/20/09
to Railo
I need to get this sorted as soon as possible as it's starting to
annoy me (besides making it difficult for me to implement search-
friendly URLS!) Can anybody point me to a good Jetty forum? There
doesn't seem to be centralised community support at mortbay.org and
I've tried posting against the Nabble.com forum and it keeps rejecting
my post saying that i need to be subscribed (which I am!).

Thanks & regards,

shrike71

On Apr 17, 1:01 pm, shrike71 <shrik...@gmail.com> wrote:
> If i use the railo.xml context, no. I can go tohttp://localhost/railo/index.cfm
>
> If i delete the railo.xml file and let it autoload then i do have to
> go tohttp://localhost/railo.war/index.cfm, but the effect is the same

Tom Lenz

unread,
Apr 20, 2009, 5:48:56 AM4/20/09
to ra...@googlegroups.com

Michael Offner-Streit

unread,
Apr 20, 2009, 6:30:57 AM4/20/09
to ra...@googlegroups.com
for jetty the only setting is the "welcome-file-list" in the "app-default.xml" inside "<install>/conf"
for all contextes and the <context>/WEB-INF/web.xml for a single web.

it looks as follows:

  <welcome-file-list>
    <welcome-file>index.cfm</welcome-file>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>

but when you use apache/iis in front, you have to define welcome file list in this server as well.

greetings michael


Michael Offner-Streit
Technical Support
Railo Technologies GmbH
michael...@railo.ch
www.railo-technologies.com

Mailing List (english): http://groups.yahoo.com/group/railo_talk/
Mailing List  (german): http://de.groups.yahoo.com/group/railo/
Linked in: http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
Issue Tracker: http://jira.jboss.org/jira/browse/RAILO
Blog: http://www.railo-technologies.com/blog


shrike71 schrieb:

shrike71

unread,
Apr 20, 2009, 7:36:02 AM4/20/09
to Railo
Hi Michael,

Thanks for the reply, but i'm not exactly sure what you're referring
to;

In Jetty6, there's a webdefault.xml file that contains the following
clause:

<welcome-file-list>
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.cfml</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

then, in railo-war/WEB-INF/web.xml i also have:

<welcome-file-list>
<welcome-file>index.cfm</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

Still doesn't work.

Regards,

shrike71

On Apr 20, 11:30 am, Michael Offner-Streit <michael.str...@railo.ch>
wrote:
> for jetty the only setting is the "welcome-file-list" in the
> "app-default.xml" inside "<install>/conf"
> for all contextes and the <context>/WEB-INF/web.xml for a single web.
>
> it looks as follows:
>   <welcome-file-list>
>     <welcome-file>index.cfm</welcome-file>
>     <welcome-file>index.html</welcome-file>
>   </welcome-file-list>
>
> but when you use apache/iis in front, you have to define welcome file
> list in this server as well.
>
> greetings michael
>
> Michael Offner-Streit
> Technical Support
> Railo Technologies GmbH
> michael.off...@railo.chwww.railo-technologies.com
> ...
>
> read more »

Michael Offner-Streit

unread,
Apr 20, 2009, 7:52:08 AM4/20/09
to ra...@googlegroups.com
apache iis?
Michael Offner-Streit
Technical Support
Railo Technologies GmbH

shrike71

unread,
Apr 20, 2009, 8:07:10 AM4/20/09
to Railo
Nope.

At the moment i'm not front-ending it with Apache or IIS. I'm using
the built-in webserver on a custom port of 8088.

So i'm surfing to http://localhost:8088/railo.war/

I haven't even attempted to start connecting it to Apache yet!

Thanks & regards,

shrike71

On Apr 20, 12:52 pm, Michael Offner-Streit <michael.str...@railo.ch>
wrote:
> apache iis?
>
> Michael Offner-Streit
> Technical Support
> Railo Technologies GmbH
> ...
>
> read more »

shrike71

unread,
Apr 22, 2009, 7:09:03 AM4/22/09
to Railo
OK,

I have this partially sorted by front ending it with Apache2 as a
proxy. Still got one minor caveat... see below.

To get railo cfm default documents working with Jetty i followed
Mortbay's Apache recommendations (http://docs.codehaus.org/display/
JETTY/Configuring+mod_proxy) for proxying requests using a reverse
proxy, and modified them to suit.

I was using apache 2.2 and you'll need to load mod_proxy as a minimum
(other useful proxy modules exist for things like load balancing and
such)

Here's an apache virtual host config that works for all requests
except for one niggling case...

<VirtualHost *>
DirectoryIndex index.cfm
ServerName proto0.fardev.intmet.ie

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPassMatch ^(.*)/$ http://localhost:8088/railo.war$1/index.cfm
ProxyPassMatch ^/(.*)$ http://localhost:8088/railo.war/$1

ProxyPreserveHost On

</VirtualHost>

The DirectoryIndex entry is irrelevant. The above vhost setting for
proto0.fardev.intmet.ie
works for all types of URL requests EXCEPT the likes of the following:

If i go to http://proto0.fardev.intmet.ie/railo-context/admin/ the
index.cfm file is CORRECTLY appended to the end of the URL, however,
if i go to http://proto0.fardev.intmet.ie/railo-context/admin (note no
trailing slash) i get the familiar:

HTTP ERROR 500

Problem accessing /railo.war/railo-context/admin. Reason:

/apps/jetty6/webapps/railo.war/WEB-INF/railo/context/admin (Is a
directory)

Apache DOES append the / to the server base URL, so going to
http://proto0.fardev.intmet.ie IS rewritten as http://proto0.fardev.intmet.ie/
and hence proxied to http://localhost:8088/railo.war/index.cfm, but it
doesn't seem to provide this service to subdirectories on the URL

I hope somebody finds this useful enough, and any advice with the
issue above will be most welcome!

Cheers,

shrike71

On Apr 20, 1:07 pm, shrike71 <shrik...@gmail.com> wrote:
> Nope.
>
> At the moment i'm not front-ending it with Apache or IIS. I'm using
> the built-in webserver on a custom port of 8088.
>
> So i'm surfing tohttp://localhost:8088/railo.war/
> > >> forjettythe only setting is the "welcome-file-list" in the
> > >> "app-default.xml" inside "<install>/conf"
> > >> for all contextes and the <context>/WEB-INF/web.xml for a single web.
>
> > >> it looks as follows:
> > >>   <welcome-file-list>
> > >>     <welcome-file>index.cfm</welcome-file>
> > >>     <welcome-file>index.html</welcome-file>
> > >>   </welcome-file-list>
>
> > >> but when you use apache/iis in front, you have to define welcome file
> > >> list in this server as well.
>
> > >> greetings michael
>
> > >> Michael Offner-Streit
> > >> Technical Support
> > >> Railo Technologies GmbH
> > >> michael.off...@railo.chwww.railo-technologies.com
>
> > >> Mailing List (english):http://groups.yahoo.com/group/railo_talk/
> > >> Mailing List  (german):http://de.groups.yahoo.com/group/railo/
> > >> Linked in:http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
> > >> Issue Tracker:http://jira.jboss.org/jira/browse/RAILO
> > >> Blog:http://www.railo-technologies.com/blog
>
> > >> shrike71 schrieb:
>
> > >>> I need to get this sorted as soon as possible as it's starting to
> > >>> annoy me (besides making it difficult for me to implement search-
> > >>> friendly URLS!) Can anybody point me to a goodJettyforum? There
> > >>>>>>> setWelcomeFiles method. So,Jettyis ignoring your list.
>
> > >>>>>>> I've always put my welcome file list in my web.xml file and never had
> > >>>>>>> a problem:
>
> > >>>>>>> <web-app>
> > >>>>>>>  ....
> > >>>>>>>    <welcome-file-list>
> > >>>>>>>         <welcome-file>index.cfm</welcome-file>
> > >>>>>>>         <welcome-file>index.html</welcome-file>
> > >>>>>>>         <welcome-file>index.jsp</welcome-file>
> > >>>>>>>     </welcome-file-list>
> > >>>>>>> </web-app>
>
> > >>>>>>> On Apr 16, 4:48 am, shrike71 <shrik...@gmail.com> wrote:
>
> > >>>>>>>> Interestingly enough, i got rid of the railo.xml file in the contexts/
> > >>>>>>>> dir and i dropped an unpacked openbluedragon.war dir into webapps and
> > >>>>>>>> restartedjetty. Railo was still not able to process an index.cfm
> > >>>>>>>> welcome file and bluedragon was! I chopped and swapped loads of system
> > >>>>>>>> settings in the railo web.xml file to get it to match the one from
> > >>>>>>>> openbluedragon as far as possible without breaking it, still to no
> > >>>>>>>> avail.
>
> > >>>>>>>> Any insights, anyone?
>
> > >>>>>>>> Thanks,
>
> > >>>>>>>> shrike71
>
> > >>>>>>>> On Apr 16, 7:47 am, "Gert Franz" <gert.fr...@railo.ch> wrote:
>
> > >>>>>>>>> Shrike,
>
> > >>>>>>>>> can you post it to theJettyforums? The problem lies in the error
>
> > >>>>> message.
>
> > >>>>>>>>> It's aJettymessage and not a Railo one... The XML looks fine from
>
> > >>>>> my
>
> > >>>>>>>>> perspective. If you have the solution, can you let us know here as
>
> > >>>>> well?
>
> > >>>>>>>>> Thanks a lot.
>
> > >>>>>>>>> Greetings from Switzerland
> > >>>>>>>>> Gert Franz
> > >>>>>>>>> Railo Technologies GmbH
> > >>>>>>>>> g...@getrailo.comwww.getrailo.ch
>
> > >>>>>>>>> Join our Mailing List
> > >>>>>>>>> german:        http://de.groups.yahoo.com/group/railo/
> > >>>>>>>>> english:        http://groups.google.com/group/railo
> > >>>>>>>>> linked in:      http://www.linkedin.com/e/gis/71368/0CF7D323BBC1
> > >>>>>>>>> Bug tracker:    http://jira.jboss.org/jira/browse/RAILO
> > >>>>>>>>> Railo Blog:    http://www.railo-technologies.com/blog
>
> > >>>>>>>>> -----Ursprüngliche Nachricht-----
> > >>>>>>>>> Von: ra...@googlegroups.com [mailto:ra...@googlegroups.com] Im
>
> > >>>>> Auftrag von
>
> > >>>>>>>>> shrike71
> > >>>>>>>>> Gesendet: Mittwoch, 15. April 2009 18:06
> > >>>>>>>>> An: Railo
> > >>>>>>>>> Betreff: [railo] Problem setting an index.cfm welcomeFile on aJetty
>
> ...
>
> read more »

denstar

unread,
Apr 22, 2009, 12:27:15 PM4/22/09
to ra...@googlegroups.com
On Wed, Apr 22, 2009 at 5:09 AM, shrike71 <shri...@gmail.com> wrote:
...

Try:

ProxyPassMatch ^\/$ http://localhost:8088/railo.war/index.cfm$1

and see what happens.

I have a different way of doing this stuff, using proxypass and mod_rewrite:

http://coldshen.com/blog/index.cfm/2008/9/27/Load-Balancing-your-JBoss-AS-5-cluster-with-Apache-AJP

( http://tinyurl.com/d5odko )

The way I have it set up, static content is served by apache, and
dynamic content is served by CF, which I like the idea of.

HIH,
D

--
Nothing is more singular about this generation than its addiction to music.
Allan Bloom

Reply all
Reply to author
Forward
0 new messages