file not found errors with blogcfc

139 views
Skip to first unread message

mazman

unread,
Jan 4, 2011, 6:33:11 AM1/4/11
to Railo
I just moved by blogcfc blog from CF7 to the latest release of Railo.
The main pages work fine, but whenever I try to access a page that
uses the SES URL path after the .cfm file, the server throws a 404
error. Here are some examples:

THESE WORK:
http://www.mkville.com/blog/index.cfm
http://www.mkville.com/blog/index.cfm?year=2007&month=11&mode=month

THESE DO NOT WORK:
http://www.mkville.com/blog/index.cfm/ColdFusion
http://www.mkville.com/blog/index.cfm/2007/11

Todd Rafferty

unread,
Jan 4, 2011, 6:35:33 AM1/4/11
to ra...@googlegroups.com
Did you add the URL re-writes to Tomcat or whatever server you're using? 
--
~Todd Rafferty ** Volunteer Railo Open Source Community Manager ** http://getrailo.org/

mazman

unread,
Jan 4, 2011, 6:50:37 AM1/4/11
to Railo
Coming from CF7/Apache/Linux I never had to use any rewrites so I
wasn't aware that I needed to do that. Can you point me to
documentation/information about what settings I need?

On Jan 4, 6:35 am, Todd Rafferty <t...@getrailo.org> wrote:
> Did you add the URL re-writes to Tomcat or whatever server you're using?
>

James Holmes

unread,
Jan 4, 2011, 8:04:51 AM1/4/11
to ra...@googlegroups.com
Which servlet container / J2EE server are you using?

--
WSS4CF - WS-Security framework for CF
http://wss4cf.riaforge.org/

mazman

unread,
Jan 4, 2011, 8:53:15 AM1/4/11
to Railo
Tomcat. I used the VivioTech installer.

On Jan 4, 8:04 am, James Holmes <james.hol...@gmail.com> wrote:
> Which servlet container / J2EE server are you using?
>
> --
> WSS4CF - WS-Security framework for CFhttp://wss4cf.riaforge.org/

Todd Rafferty

unread,
Jan 4, 2011, 9:07:43 AM1/4/11
to ra...@googlegroups.com
That's because the JRUN / CF7 / Apache connector has some voodoo behind it all to allow *.cfm/* -- Tomcat will recognize (filename).cfm/*, but not *.cfm/*

I'm not sure about blogcfc, but for mango blog, I did the following. I went into my WEB-INF directory and created a file called "web.xml" and then I put:

=========================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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/web-app_2_5.xsd"
    version="2.5">
    <servlet-mapping>
       <servlet-name>RailoCFMLServlet</servlet-name>
       <url-pattern>/blog/post.cfm/*</url-pattern>
       <url-pattern>/blog/page.cfm/*</url-pattern>
       <url-pattern>/blog/archives.cfm/*</url-pattern>
       <url-pattern>/blog/author.cfm/*</url-pattern>
       <url-pattern>/blog/feeds/rss.cfm/*</url-pattern>
    </servlet-mapping>
</web-app>
=========================================

So, you need to figure out (or ask Jordan) what the <servlet-name> is and put in the proper servlet name and then figure out what <url-pattern> that BlogCFC requires.


--
~Todd Rafferty ** Volunteer Railo Open Source Community Manager ** http://getrailo.org/


Todd Rafferty

unread,
Jan 4, 2011, 9:16:19 AM1/4/11
to ra...@googlegroups.com
Doing some basic searches on google this is one of your pieces:

<url-pattern>/index.cfm/*</url-pattern>

The <servlet-name> can be found in the Tomcat / conf directory, there's a web.xml - search for <servlet-name> -- then follow the instructions as I listed below.

Eric Cobb

unread,
Jan 4, 2011, 9:22:55 AM1/4/11
to ra...@googlegroups.com
Yeah, I just got my blogCFC up and running on Railo/Tomcat a few weeks ago, and I think I had to add these to the web.xml file to make everything work.:

<url-pattern>/index.cfm/*</url-pattern>
<url-pattern>/page.cfm/*</url-pattern>

Thanks,

Eric Cobb
ECAR Technologies, LLC
http://www.ecartech.com
http://www.cfgears.com

Todd Rafferty

unread,
Jan 4, 2011, 9:36:20 AM1/4/11
to ra...@googlegroups.com
Just to explain what the difference is between the two web.xml files:

* If you want Tomcat to handle the url-pattern is globally (in case you have many many blogcfcs on your server), then you want to put it in the tomcat's main conf/web.xml (look for the appropriate spot to put it in and you're done and never have to touch it again)

* If you're like me and you prefer your stuff to be on a context by context basis, then you put it in the WEB-INF/web.xml (exactly as I had it below)


--
~Todd Rafferty ** Volunteer Railo Open Source Community Manager ** http://getrailo.org/


mazman

unread,
Jan 4, 2011, 10:54:17 AM1/4/11
to Railo
Awesome -- that worked! Here is a summary for future generations.
Thanks to everyone for their assistance.

* The following servlet mappings (after my bullet lists here) already
exist in the tomcat/conf/web.xml file when using the VivioTech
installer.

* Though /index.cfm/* exists, I don't think it was taking effect
because my blog is in the /blog/ folder (IS THIS CORRECT that you must
specify subfolders?).

* Per Todd's suggestion, I created a web.xml file in the WEB-INF
folder under my domain folder, added the entries similar to his
listing (note that "GlobalCFMLServlet" is the name of the servlet
created by the VivioTech installer). File with my changes listed
below.

===DEFAULT MAPPINGS IN MAIN TOMCAT web.xml FILE (I didn't change
this)===
<servlet-mapping>
<servlet-name>GlobalCFMLServlet</servlet-name>
<url-pattern>*.cfm</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GlobalCFMLServlet</servlet-name>
<url-pattern>/index.cfm/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GlobalCFMLServlet</servlet-name>
<url-pattern>*.cfml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GlobalCFMLServlet</servlet-name>
<url-pattern>*.cfc</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>GlobalAMFServlet</servlet-name>
<url-pattern>/flashservices/gateway/*</url-pattern>
</servlet-mapping>

===NEW web.xml FILE IN DOMAIN FOLDER===
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app 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/web-app_2_5.xsd"
version="2.5">
<servlet-mapping>
<servlet-name>GlobalCFMLServlet</servlet-name>
<url-pattern>/blog/index.cfm/*</url-pattern>
<url-pattern>/blog/page.cfm/*</url-pattern>
<url-pattern>/blog/print.cfm/*</url-pattern>
<url-pattern>/blog/rss.cfm/*</url-pattern>
<url-pattern>/blog/slideshow.cfm/*</url-pattern>
</servlet-mapping>
</web-app>

On Jan 4, 9:36 am, Todd Rafferty <t...@getrailo.org> wrote:
> Just to explain what the difference is between the two web.xml files:
>
> * If you want Tomcat to handle the url-pattern is globally (in case you have
> many many blogcfcs on your server), then you want to put it in the tomcat's
> main conf/web.xml (look for the appropriate spot to put it in and you're
> done and never have to touch it again)
>
> * If you're like me and you prefer your stuff to be on a context by context
> basis, then you put it in the WEB-INF/web.xml (exactly as I had it below)
>
> --
> ~Todd Rafferty ** Volunteer Railo Open Source Community Manager **http://getrailo.org/
>
>
>
>
>
>
>
> On Tue, Jan 4, 2011 at 9:22 AM, Eric Cobb <railot...@ecartech.com> wrote:
> >  Yeah, I just got my blogCFC up and running on Railo/Tomcat a few weeks
> > ago, and I think I had to add these to the web.xml file to make everything
> > work.:
>
> > <url-pattern>/index.cfm/*</url-pattern>
> > <url-pattern>/page.cfm/*</url-pattern>
>
> > Thanks,
>
> > Eric Cobb
> > ECAR Technologies, LLChttp://www.ecartech.comhttp://www.cfgears.com
>
> > On 1/4/2011 8:16 AM, Todd Rafferty wrote:
>
> > Doing some basic searches on google this is one of your pieces:
>
> > <url-pattern>/index.cfm/*</url-pattern>
>
> > The <servlet-name> can be found in the Tomcat / conf directory, there's a
> > web.xml - search for <servlet-name> -- then follow the instructions as I
> > listed below.
>

Todd Rafferty

unread,
Jan 4, 2011, 11:20:01 AM1/4/11
to ra...@googlegroups.com
Mark,

Glad that worked for you. Thanks for looking up what the servlet name is in the new tomcat installer, I haven't used it yet and it's good to know. Because Tomcat won't handle more than one wildcard, your question below is correct, it would have to be /blog/index.cfm/* because the file is in the sub directory and can't be */index.cfm/*

Now, I'm not sure what'll happen if you mix Tomcat with tuckey's url rewrite ( http://www.tuckey.org/urlrewrite/ ) - however, seeing as you got it up and running, I don't think it matters at this point.

~Todd

Scott Stroz

unread,
Mar 5, 2014, 3:44:07 PM3/5/14
to ra...@googlegroups.com, to...@getrailo.org
Is there anything different to get this working on 4.1?

I tried Todd's suggestion and added web.xml to my WEB-INF folder, but after I do so, I get 404 errors on EVERY url I try.

Scott Stroz

unread,
Mar 5, 2014, 4:01:27 PM3/5/14
to ra...@googlegroups.com, to...@getrailo.org
Never mind.....

When I copied the <url-pattern> block, I missed the one for index.cfm.

Everything working fine now.

Scott Stroz

unread,
Mar 5, 2014, 4:09:35 PM3/5/14
to ra...@googlegroups.com, to...@getrailo.org
I stand corrected.....

The site is working, but I am unable to access the Web admin.I get a 404 error.

Scott Stroz

unread,
Mar 5, 2014, 4:21:40 PM3/5/14
to ra...@googlegroups.com, to...@getrailo.org
And...when I try to get to anything in the Blog admin, the actual CFML source code is being served.

Thoughts?

Here is the content of web.xml in my sites WEB-INF folder

<?xml version="1.0" encoding="ISO-8859-1"?>
    version="2.5">
    <servlet-mapping>
       <servlet-name>CFMLServlet</servlet-name>
       <!-- BlogCFC SES -->
<url-pattern>/blog/index.cfm/*</url-pattern>
<url-pattern>/blog/post.cfm/*</url-pattern>
<url-pattern>/blog/page.cfm/*</url-pattern>
<url-pattern>/blog/archives.cfm/*</url-pattern>
<url-pattern>/blog/author.cfm/*</url-pattern>
<url-pattern>/blog/feeds/rss.cfm/*</url-pattern>
        <url-pattern>/blog/contact.cfm/*</url-pattern>
        <url-pattern>/blog/search.cfm/*</url-pattern>
    </servlet-mapping>
</web-app>

Scott Stroz

unread,
Mar 5, 2014, 4:58:26 PM3/5/14
to ra...@googlegroups.com, to...@getrailo.org
So..it turns out.....I needed to add teh following to web.xml in the WEB-INF directory

<url-pattern>*.cfm</url-pattern>

And now everything works as expected.
Reply all
Reply to author
Forward
0 new messages