fixing 404 error of JSP or servlet

by Selva 2009-04-16 19:27:10

If you have VPS running in cpanel/WHM environment and if you have enabled JSP/JAVA/Tomact support for your client domain,somtimes your clients may face 404 error for a JSP file/servlet file.

This 404 error may be fixed by one the following steps :

Here consider that your client domain is test.com and username is test


Step 1: Check whether test.com have jsp support.
You may check this by :
--> Open apache config file - /etc/httpd/conf/httpd.conf
--> Go to vittual host entry of test.com
--> Check whether jkmount configuration like Include /usr/local/apache/conf/userdata/std/1/test/test.com/*.conf is included within the virtual host entry of test.com
--> If this entry is not present for test.com then enable jsp support for test.com by using the command /scripts/addservlets --domain=test.com

Step 2:

Check the file /usr/local/apache/conf/userdata/std/1/test/test.com/cp_jkmount.conf . This must have JkMount entry for .jsp and .do (to support structs)

The file must be like :

<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
JkMount /*.do ajp13
</IfModule>


Step 3: Check whether /home/test and /home/test/public_html have read,execute permission for others . This is because the jsp files of all users runs under user called tomcat and so the user tomact must have neccessary premission to user's home directory to execute jsp file.

Step 4: Check whether .class files ( if used by user client ) in /home/test/public_html/WEB-INF/classes/ have read permission for others

Step 5: If the issue is not solved by above steps then issue resides in web.xml ( placed in /home/test/public_html/WEB-INF/ ).Just backup this file,remove it,restart the tomcat server and try it.If this solves your issue then inform your client ( in this case test ) to chanage configuration in his web.xml to suite to your VPS emvironment


Note : Premission to files and folder may be the major cause for this kind of issue,so check it twice....

Tagged in:

2276
like
1
dislike
0
mail
flag

You must LOGIN to add comments