wood burning stoves*
The moose likes Servlets and the fly likes Problem in running example JSP's in Tomcat 3.3-b1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem in running example JSP Watch "Problem in running example JSP New topic
Author

Problem in running example JSP's in Tomcat 3.3-b1

Kaju Singh
Greenhorn

Joined: Jul 30, 2001
Posts: 10
Hi,
I've downloaded Tomcat-3.3-b1 and am trying to run it on solaris machine. I am getting the html page alright but while running the example jsp's I am getting the following error.
Error: 500
Location: /examples/jsp/num/numguess.jsp
Internal Servlet Error:
org.apache.jasper.compiler.ParseException: Cannot read file: /jsp/num/numguess.jsp
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.fillInStackTrace(Compiled Code)
at java.lang.Throwable.(Compiled Code)
at java.lang.Exception.(Compiled Code).....
If anyone has tried this version of Tomcat, please guide me.
Following is the startup script trace.
/home/rajeshk/download/jakarta-tomcat-3.3-b1> echo $TOMCAT_HOME
/home/rajeshk/download/jakarta-tomcat-3.3-b1
/home/rajeshk/download/jakarta-tomcat-3.3-b1> cd bin
/home/rajeshk/download/jakarta-tomcat-3.3-b1/bin> startup.sh
Using classpath: ./../lib/tomcat.jar:/home/keshab/weblogic/license:/home/keshab/weblogic/classes:/home/keshab/weblogic/lib/weblogicaux.jar:/home/rajeshk/download/JSDK2.0/lib/jsdk.jar::/home/rajeshk /classes/jconn2.jar:/home/keshab/classes/xml.jar:/home/keshab/classes/xml4j.jar:.:/usr/java1.2/jre/lib/rt.jar
Using JAVA_HOME: /usr/java1.2
Using TOMCAT_HOME: ./..
/home/rajeshk/download/jakarta-tomcat-3.3-b1/bin> Tomcat: setAttribute home=./..
2001-08-07 14:21:03 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-127.0.0.1.xml
2001-08-07 14:21:03 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-examples.xml
2001-08-07 14:21:03 - ContextXmlReader: Context config=$TOMCAT_HOME/conf/apps-admin.xml
2001-08-07 14:21:03 - AutoWebApp: Already loaded: DEFAULT:/admin
2001-08-07 14:21:03 - AutoWebApp: Already loaded: DEFAULT:/examples
2001-08-07 14:21:03 - AutoWebApp: Auto-Adding DEFAULT:/
2001-08-07 14:21:03 - ContextManager: Adding DEFAULT:/examples
2001-08-07 14:21:03 - ContextManager: Adding DEFAULT:/admin
2001-08-07 14:21:03 - ContextManager: Adding DEFAULT:/ROOT
2001-08-07 14:21:03 - ContextManager: Init time 1767
2001-08-07 14:21:03 - Http10Interceptor: Starting on 8080
2001-08-07 14:21:03 - Ajp12Interceptor: Starting on 8007
2001-08-07 14:21:03 - Ajp13Interceptor: Starting on 8009
2001-08-07 14:21:03 - ContextManager: Startup 119
regards,
Kaju
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

You seem to have the environment variable TOMCAT_HOME set to an empty string. The JSP compiler's attempting to find a file named "/jsp/num/numguess.jsp".
Normally this file would probably be something like "/usr/local/jakarta-tomcat/webapps/examples/jsp/num/numguess.jsp" - or perhaps "/var/tomcat/webapps/....".
Not sure, but it's possible you did something to your server.xml file as well, since it looks like other parts of your context file path are missing also.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kaju Singh
Greenhorn

Joined: Jul 30, 2001
Posts: 10
Hi Tim,
Thanx for replying. I am sure TOMCAT_HOME was set properly as I had checked it up with echo command:
/home/rajeshk/download/jakarta-tomcat-3.3-b1> echo $TOMCAT_HOME
/home/rajeshk/download/jakarta-tomcat-3.3-b1
Also I didn't do anything with the server.xml file. I was able to startup the previous version of Tomcat(3.1.1) properly without changing any configuration, but is something extra required to be done in this version?? I don't know...
I am pasting below the server.xml file in which I didn't change anything. Basically I was not able to connect to apache-1.3.20 to tomcat-3.1.1, so I am trying this version because this had the mod_jk directories and I was able to build mod_jk.so easily.
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>
<!-- You can add a "home" attribute to represent the "base" for
all relative paths. If none is set, the TOMCAT_HOME property
will be used, and if not set "." will be used.
webapps/, work/ and log/ will be relative to this ( unless
set explicitely to absolute paths ).
-->
<ContextManager debug="0" workDir="work" >
<!-- ==================== Global modules ==================== -->
<LogSetter name="tc_log" timestamps="true"
verbosityLevel="INFORMATION" />
<LogEvents enabled="false" />

<!-- Backward compat: read the Context declarations from server.xml-->
<ContextXmlReader config="conf/server.xml" />
<!-- Separated Context -->
<ContextXmlReader config="conf/apps.xml" />
<AutoDeploy source="internal" target="internal"
redeploy="true" />
<AutoWebApp dir="internal" host="DEFAULT" trusted="true"/>
<AutoDeploy source="webapps" target="webapps" />
<AutoWebApp dir="webapps" host="DEFAULT" />
<PolicyLoader securityManagerClass="java.lang.SecurityManager"
policyFile="conf/tomcat.policy" />
<SimpleMapper1 debug="0" />
<SessionExpirer checkInterval="60" />
<!-- For development you can use randomClass="java.util.Random" -->
<SessionIdGenerator randomClass="java.security.SecureRandom"
randomFile="/dev/urandom" />

<!-- ========== context processing modules ========== -->
<!-- This will be the "default" profile
( all except the "global" modules can be set per context )
-->
<LogSetter name="servlet_log"
timestamps="true"
verbosityLevel = "INFORMATION"
path="logs/servlet-${yyyyMMdd}.log"
/>
<LogSetter name="JASPER_LOG"
timestamps="true"
path="logs/jasper-${yyyyMMdd}.log"
verbosityLevel = "INFORMATION" />
<LoaderInterceptor11 useApplicationLoader="true" />
<TrustedLoader />
<WebXmlReader validate="true" />
<ErrorHandler showDebugInfo="true" />
<WorkDirSetup cleanWorkDir="false" />
<Jdk12Interceptor />
<!-- Non-standard invoker, for backward compat. ( /servlet/* ) -->
<InvokerInterceptor />
<!-- you can add javaCompiler="jikes" -->
<JspInterceptor keepGenerated="true"
largeFile="false"
sendErrToClient="true"
useJspServlet="false"
/>

<StaticInterceptor debug="0" listings="true" />

<ReloadInterceptor fullReload="true" />
<SimpleSessionStore maxActiveSessions="-1" />
<AccessInterceptor />
<CredentialsInterceptor />
<SimpleRealm filename="conf/users/global-users.xml" />
<!-- UnComment the following and comment out the
above to get a JDBC realm.
Other options for driverName:
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc racle:thin:@ntserver:1521:ORCL"
connectionName="scott"
connectionPassword="tiger"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test"
connectionPassword="test"
"connectionName" and "connectionPassword" are optional.
-->
<!--
<JDBCRealm
debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc dbc:TOMCAT"
userTable="users"
userNameCol="user_name"
userCredCol="user_pass"
userRoleTable="user_roles"
roleNameCol="role_name" />
-->
<LoadOnStartupInterceptor />
<Servlet22Interceptor />

<!-- Tag pooling support.
To enable the reuse of tag handlers as described in
the JSP spec, uncomment the following. If your pages
use a lot of custom tags, you should see a nice performance
gain.

Note that placing the interceptor here will enable
Tag pooling for all of the web applicatitions loaded -
this may be a bad thing if all tags are not coded to
handle reuse. To enable pooling only for specific web
applications i.e. Contexts, place the interceptor inside of
the Context's definition.

To view information about tag usage uncomment the tag
LogSetter. Set verbosityLevel to DEBUG to see everytime
a tag is obtained and released.
-->
<!--
<LogSetter name="tag_pool_log" timestamps="true"
path="logs/tagpool-${yyyyMMdd}.log"
verbosityLevel="INFORMATION" />
<TagPoolManagerInterceptor debug="0"/>
-->
<!-- Request processing -->
<DecodeInterceptor debug="0" />
<SessionId cookiesFirst="true" noCookies="false" />
<!-- Uncoment for the automatic apache config generator
<ApacheConfig forwardAll="true" useJkMount="true"
noRoot="false" />
-->
<!-- ==================== Connectors ==================== -->
<!-- new http adapter. Attributes:
secure - use SSL ( https )
keystore, keypass - certs for SSL
port -->
<Http10Interceptor port="8080"
secure="false"
maxThreads="100"
maxSpareThreads="50"
minSpareThreads="10" />
<!--
Uncomment this for SSL support.
You _need_ to set up a server certificate if you want this
to work, and you need JSSE.
1. Add JSSE jars to CLASSPATH
2. Edit java.home/jre/lib/security/java.security
Add:
security.provider.2=com.sun.net.ssl.internal.ssl.Provider
3. Do: keytool -genkey -alias tomcat -keyalg RSA
RSA is essential to work with Netscape and IIS.
Use "changeit" as password. ( or add keypass attribute )
You don't need to sign the certificate.

You can set parameter keystore and keypass if you want
to change the default ( user.home/.keystore with changeit )
-->
<!--
<RequestInterceptor
className="org.apache.tomcat.modules.server.Http10Interceptor"
port="8443"
secure="true" />
-->
<!--
JNI connector, make sure that you update the native_lib
Parameter to point to your jni_connect.dll.
-->
<!--
<RequestInterceptor
className="org.apache.tomcat.modules.server.JNIConnectionHandler"
nativeLibrary="D:\tomcat\bin\i386\jni_connect.dll" />
-->
<!-- Apache AJP12 support. This is also used to shut down tomcat.
Parameter "address" defines network interface this Interceptor
"binds" to. Add it if you want to "bind" to just "127.0.0.1".

address="127.0.0.1"
-->
<RequestInterceptor
className="org.apache.tomcat.modules.server.Ajp12Interceptor"
tomcatAuthentication="false"
port="8007" />
<!-- Apache AJP13 support (mod_jk)
Parameter "address" defines network interface this Interceptor
"binds" to. Add it if you want to "bind" to just "127.0.0.1".
address="127.0.0.1"
-->
<RequestInterceptor
className="org.apache.tomcat.modules.server.Ajp13Interceptor"
port="8009" />
<!--
Context definitions can be placed here ( not recommended ) or
in separate files. The ContextXmlReader will read all context
definitions ( you can customize the "base" filename ).

The default is conf/apps-[name].xml.

See conf/apps-examples.xml and conf/apps-admin.xml
-->
</ContextManager>
</Server>

Originally posted by Tim Holloway:
You seem to have the environment variable TOMCAT_HOME set to an empty string. The JSP compiler's attempting to find a file named "/jsp/num/numguess.jsp".
Normally this file would probably be something like "/usr/local/jakarta-tomcat/webapps/examples/jsp/num/numguess.jsp" - or perhaps "/var/tomcat/webapps/....".
Not sure, but it's possible you did something to your server.xml file as well, since it looks like other parts of your context file path are missing also.

Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040


Using classpath: ./../lib/tomcat.jar:/home/keshab/weblogic/license:/home/keshab/weblogic/classes:/home/keshab/weblogic/lib/weblogicaux.jar:/home/rajeshk/download/JSDK2.0/lib/jsdk.jar::/home/rajeshk /classes/jconn2.jar:/home/keshab/classes/xml.jar:/home/keshab/classes/xml4j.jar:.:/usr/java1.2/jre/lib/rt.jar
Using JAVA_HOME: /usr/java1.2


I would do two things first....
1. verify that the JAVA_HOME is indeed correct.
2. remove the CLASSPATH variable from your env.
Tomcat has its own jars and will put them in the classpath.
I am a little concerned abt the JSDK jars and the weblogic classes/jars. With this classpath I am not sure
where the classes needed by Tomcat are getting resolved.
Remember, the first class in the classpath is where the
class gets resolved.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Kaju Singh
Greenhorn

Joined: Jul 30, 2001
Posts: 10
Hi Madhav,
Many many thanx to you. I was almost frustrated with this. I removed the unwanted files from the classpath and changed it to the following -
Using classpath: ./../lib/tomcat.jar:/home/rajeshk/classes/jconn2.jar:.:/usr/java1.2/jre/lib/rt.jar
Using JAVA_HOME: /usr/java1.2
[B]
Now it is working properly. I didn't suspect this because Tomcat3.1.1 version was not giving any such problem.
Thanx again..
Originally posted by Madhav Lakkapragada:
[B]
I would do two things first....
1. verify that the JAVA_HOME is indeed correct.
2. remove the CLASSPATH variable from your env.
Tomcat has its own jars and will put them in the classpath.
I am a little concerned abt the [b]JSDK
jars and the weblogic classes/jars. With this classpath I am not sure
where the classes needed by Tomcat are getting resolved.
Remember, the first class in the classpath is where the
class gets resolved.
regds.
- satya[/B]

Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

sure thing.
Glad to be of help.
- satya
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in running example JSP's in Tomcat 3.3-b1