• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin

Servlet 404 and JkMount configuration - encountered some problem (Apache/Tomcat)

Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi good people of Java Ranch! My first post here...

I'm trying to configure Apache 2.2.8, mod_jk/1.2.26 and Tomcat 5.5.25 on Linux RHEL 4 es.

Finally, trough some "non generic" methods I got everything working but I feel it isn't right, so please take a look and please let me know what is the problem.

All started after I migrated one of my addon domains from a shared hosting to dedicated. No problem with java code (everything works on my old shared server), it looks like a configuration issue.

My classes are packaged and stored in a JAR in WEB-INF/lib. Basically, I have a JSP with a form where drop down boxes get populated from DB. This part works. Than I have a submit button that invokes a servlet /Start.

As soon as I hit submit, url immediately redirects to 404 page. So, looks like it can't find a servlet, which is in the same package as other classes.

So, after playing around, I figured this is related to JkMount in httpd.conf. Basic config had this:

As soon as I added /servlet/Start to the submit action and changed web.xml url-pattern to /servlet/Start submit worked and servlet was invoked.
But I need my servlet to be invoked as /Start and url should be
www.myaddondomain.com/Satrt not www.myaddondomain.com/servlet/Start

So, I added to the httpd.conf to my <Host> and it works now. But, now I let Tomcat to handle everything, including php, html and other stuff. So, I had to add a few JkUnMount parameters in order for Apache to process them.

This is where I feel it isn't right. I'm not supposed to tell Tomcat what NOT to process. I should tell it to process only JSPs and servlets. But looks like it processes servlets only if I specify /servlet/ in form action and web.xml.

Please help me to resolve this problem. Here are related samples of my httpd.conf, server.xml and web.xml (domain names, IPs, passwords and user changed for example porpuses).




[ February 13, 2008: Message edited by: Axel Brown ]
[ February 13, 2008: Message edited by: Axel Brown ]
Screaming fools! It's nothing more than a tiny ad:
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic