• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error when requesting servlet pages after hosting but not on jsp pages

 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

i have a problem with a j2ee web application as i am getting type of errors when i am requesting for .jsp and .do pages. actually i have crested a filter that filters every request and shows login page if user is not login till then. but if i am requesting for jsp extension requests then it is working properly but for .do or any other apart from .jsp it is giving the error like this:

Not Found

The requested URL /abc.do was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_jk/1.2.28 PHP/5.2.12 mod_perl/2.0.4 Perl/v5.8.8 Server at jadmin.deathbydesign.com Port 80

i am confused because this error is coming only after hosting while on local development systems it is working perfectlyy well.

so please help me in this regard.

Thank You
Mohit Kumar Tayal(SCJP 5.0)
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2688
156
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohit,

Can you post the web.xml part that defines the URL mapping to your servlet and filter?

Regards,
Frits
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frits,

thanks for your response. i am posting the part of the web.xml. but actually what i think the problem is with .do extension because as i change the extensio from .do to .jsp for servlets it works. plaese help me in this regard.

<filter>
<filter-name>AdminRequest</filter-name>
<filter-class>com.DesignRequestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AdminRequest</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
<display-name>ViewCustomers</display-name>
<servlet-name>ViewCustomers</servlet-name>
<servlet-class>com.ViewCustomers</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ViewCustomers</servlet-name>
<url-pattern>/view_customers.do</url-pattern>
</servlet-mapping>

now when i am requesting for view_customers.do i am getting the error but if i changed the extension from .do to .jsp then it is working perfectlly well.
and also i am getting this error after hosting only on development it is working properly.

Thank You
 
Vijitha Kumara
Bartender
Posts: 3953
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...now when i am requesting for view_customers.do i am getting the error but if i changed the extension from .do to .jsp then it is working perfectlly well.

Are you saying that with .jsp extension you can get to the "ViewCustomers" servlet but not with .do extension?
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vijitha

yes this is exactly what i mean. i am not getting what may be the problem.
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i have find out the problem. the exact problem is apache is not forwarding the requests to tomcat so unable to process the requests with extensions other than .jsp. it is only forwarding .jsp requests to tomcat.
how can i change the setting that all the request with any extension must be forwarded to tomcat by apache.

thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i change the setting that all the request with any extension must be forwarded to tomcat by apache.

Check the documentation of your hosting provider (and first look through all the options in your hosting setup). Depending on the type of hosting it's possible that there's no way to change this, though (for example, if it's a shared setup).
 
Mohit Kumar Tayal
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a dedicated server running on CPanel. can you please help me further by telling which file i should read and check for extension issues.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, are you seriously asking us how to look up the documentation (and maybe contact support) for your hosting provider?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!