Tomcat4 404 error: .jsp file "not available" in default webapps and ownWebapp directories but OK in examples directory

Hi

Using: Tomcat 4.1.31, JDK 1.5

I am getting this error:  HTTP Status 404: the requested resource (/cal1.jsp) is not available.

I have just set up Tomcat afresh and cannot access my JSP files from:
  a) the webapps directory (URL: http://localhost:9080/cal1.jsp), and
  b) my own webapp directory called peacBudget (URL: http://localhost:9080/peacBudget/cal1.jsp)
Both these directories contain hte simple JSP file cal1.jsp.

I can however access the file using  (URL: http://localhost:9080/examples/cal1.jsp).  which means the java compiler is OK, right?

All html files can be accessed OK in all the above directories.

I have been through Google and now the ExpertExchange queries and cannot find a solution other than checking that the classpath,
java_home(my IDE works OK with java_home) and
catalina_home are correct - I have double and triple checked these.

Please advise

Thanks

Fernando
Fernando44Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
Using: Tomcat 4.1.31, JDK 1.5
>> tomcat 4.x is not compatible with jdk1.5
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
fargoCommented:
Using: Tomcat 4.1.31, JDK 1.5
>> tomcat 4.x is not compatible with jdk1.5
>>> my mind is off, ignore my post.
0
fargoCommented:
have u defined a context in server.xml or seperately with context file??

0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Fernando44Author Commented:
Hi Fargo

Thanks!

I was hoping not to use Tomcat5 but it seems I have not choice.

Cheers

Fernando
0
fargoCommented:
No, Please reopen the question. I think, tomcat 4.x should run with jdk1.5.
0
Fernando44Author Commented:
I have defined in server.xml (at the bottom just before </Server>) as follows:

<Context path="/peacBudget" docbase="peacBudget" debug="0">
</Context>

and have left the other tags as is.
0
rrzCommented:
Yes, your installation should work should work. Please describe your file structure in peacBudget.  Also look in Tomcat's logs for an errror message.
0
fargoCommented:
rrz -:)

Fernando, please show your directory structure. And as rrz asked, any exception in tomcat logs?
0
rrzCommented:
Also try take what you put into server.xml. You don't need to add anything in there for now. Just try to get it working first.  
fargo, I am just trying to help.
0
fargoCommented:
sure rrz. I gave a smile.....

You may define as many Context elements as you wish, nested within a Host element in conf/server.xml
http://tomcat.apache.org/tomcat-4.1-doc/config/context.html

do not just define context anywhere in the server.xml but within the Host
0
Fernando44Author Commented:
Tomcat log errors on start up of Tomcat (no logs on failed attempt to open JSP page):

in localhost_log.2006-04-24
a)  LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name

b) 2006-04-24 16:32:13 StandardHost[localhost]: Error deploying application at context path /peacBudget
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name

c) 2006-04-24 16:32:13 HostConfig[localhost] Error deploying web application directory peacBudget
java.io.IOException: java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name

As regards peacBudget structure:
peacBudget\web-INF\web.xml
peacBudget\web-INF\classes\*.class
peacBudget\web-INF\lib\*.jar
peacBudget\*. = other directories containing jsp and source files. The cal1.jsp file is in peacBudget directory.


I can see from hte above that there is a problem with the /peacBudget directory but why can't the default webapps URL work?

Cheers

Fernando



0
fargoCommented:
i hope the web-INF actually is WEB-INF (keep in mind, it's case sensitive)

Moreover, as i said..the context definition should be inside the <Host >.. <Context..></Context> </Host> in server.xml
Please do the mentioned changes and let us know, what are the exceptions then.
0
Fernando44Author Commented:
Hi Fargo

I have just dumped a newly created  jsp file into examples and am getting the same error as before. The original file cal1.jsp is pre-existing in the Tomcat distribution which I guess means that the java compiler is working OK but that I have screwed up the directory structures/configs up somehow

Fernando
0
fargoCommented:
do one thing. Remove the changes u did for peacBudget. I mean remove your app code from webapps, remove entry for it from server.xml and restart tomcat to see if the tomcat is working properly as default.

If you find no exception, then we will do the application deployment step by step.
0
Fernando44Author Commented:
Hi Fargo

Yes it is WEB-INF

I inserted the context tags inside the existing host tags and Tomcat would not start, so I have taken out my new context tags. Tomcat now starts but am still getting same errors on jsp files.

Log errors seem the same as well:
a) LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name

b) 2006-04-24 17:17:37 StandardHost[localhost]: Error deploying application at context path /peacBudget
java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name

c) 2006-04-24 17:17:37 HostConfig[localhost] Error deploying web application directory peacBudget
java.io.IOException: java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException:  start: :  java.lang.IllegalArgumentException: javacc,ant,commons-collections,log4j,junit-Extension-Name


Fernando
0
Fernando44Author Commented:
Hi Fargo

Re:Remove the changes u did for peacBudget

I have done it and the newly created file in examples (URL: http://localhost:9080/examples/fdn.jsp) works fine.

However the default webapps url generates hte same 404 serror (URL: http://localhost:9080/fdn.jsp)

Good test but what does it mean?

Fernando
0
Fernando44Author Commented:
Hi Fargo

Re:Re:Remove the changes u did for peacBudget

Sorry: no exceptions in the logs

Fernando

0
fargoCommented:
However the default webapps url generates hte same 404 serror (URL: http://localhost:9080/fdn.jsp)
>> You will definitely get the page not found exception, because the fdn.jsp is bundled with ROOT directory of tomcat. If you put this fdn.jsp inside the ROOT folder of webapps. Then you will be available to access http://localhost:9080/fdn.jsp
0
fargoCommented:
Hi Fernando, i will be off now. Will be available tomorrow. May be rrz or others will help you in this regard.
0
rrzCommented:
Please show us your web.xml file for your web app.  
>However the default webapps url generates hte same 404 serror (URL: http://localhost:9080/fdn.jsp)  
That would have Tomcat loking in  the ROOT web app's root directory for fdn.jsp
0
Fernando44Author Commented:
Hi Fargo

Yes you are right offcourse - I'm going moggy with all the testing.

Where to now?

Fernando
0
rrzCommented:
Let us start over. Are you using Tomcat 4 ?   Revert back back to original state  of  server.xml , you don't need to change that now. Show us your web app's web.xml.
0
Fernando44Author Commented:
Hi rrz

the web.xml in webapps/peacBudget/WEB-INF/ is as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
      <display-name> Welcome to PEAC Budget Rate </display-name>
      
      <description> PEAC Budget Rate      </description>
 
      <context-param>
        <param-name>default</param-name>
        <param-value>""</param-value>
        <description>
          default context path
        </description>
      </context-param>
 
<!--  
      <listener>
          <listener-class>peacBudget.HibernateListener</listener-class>
      </listener>
-->

<!--
      <servlet>
          <servlet-name>Submit_action</servlet-name>
          <servlet-class>peacBudget.Submit_action</servlet-class>
      </servlet>  

      
      <servlet-mapping>
          <servlet-name>Submit_action</servlet-name>
          <url-pattern>/submit/*</url-pattern>
      </servlet-mapping>
-->
   
</web-app>

Fernando

Cheers Fargo, Thanks for your comments.

0
Fernando44Author Commented:
Hi rrz

Have reverted to default server.xml and yes it is Tomcat4.

Fernando
0
rrzCommented:
I can't see the problem yet.  The only doubt I have is with  your port. Did you alter server.xml? Did you try the default 8080 ?
http://localhost:8080/peacBudget/cal1.jsp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.