Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSP and package deployment problem in Tomcat 5

843835Jun 10 2003 — edited Jun 10 2003
Hi,
I tried very simple exercise that includes JSP and javabean (from package), but I have the following error:

HTTP Status 500 -
---------------------------------------------------------------
type Exception report
message
description The server encountered an internal error ()
that prevented it from fulfilling this request.
exception

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
[javac] Compiling 1 source file
[javac] C:\jwsdp\work\Catalina\localhost\exercises\org\apache\jsp\ex01\ex01_jsp.java:10:
package pack01 does not exist
[javac] import pack01.ex01;
[javac] ^
...................

Bellow are all my sources

1. directory structure
========================

C:\jwsdp\webapps\exercises
index.html

C:\jwsdp\webapps\exercises\ex01
build.bat
ex01.jsp

C:\jwsdp\webapps\exercises\ex01\WEB-INF
web.xml

C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes
C:\jwsdp\webapps\exercises\ex01\WEB-INF\classes\pack01
ex01.class
ex01.java

C:\jwsdp\webapps\exercises\ex01\WEB-INF\lib
pack01.jar

2. sources
==========

<< ex01.jsp >>

<HTML> <HEAD> <TITLE>Ex01</TITLE> </HEAD>
<BODY>
<FORM METHOD="GET" ACTION="ex01.jsp">

<%@ page import = "pack01.ex01" %>

<H2>Ex01</H2>

<jsp:useBean id = "x" class = "ex01" scope="application"/>

</FORM>
</BODY> </HTML>

<< ex01.java >>

package pack01;

import java.io.*;

public class ex01 implements Serializable {
private String value;
public ex01() {
value = "EX01";
}
public void setValue(String s) {
value = s;
}
public String getValue() {
return value;
}
}

<< build.bat >>

cd WEB-INF\classes\
cd
del ex01.jar
javac -deprecation -verbose pack01\ex01.java
jar cvf ..\lib\pack01.jar pack01\ex01.class

<< C:\jwsdp\webapps\exercises.xml >>

<Context className="org.apache.catalina.core.StandardContext"
cachingAllowed="true"
charsetMapperClass="org.apache.catalina.util.CharsetMapper"
configFile="webapps\exercises.xml"
cookies="true"
crossContext="false"
debug="0"
displayName="Exercises"
docBase="C:\jwsdp\webapps\exercises"
domain="Catalina"
engineName="Catalina"
j2EEApplication="none"
j2EEServer="none"
lazy="true"
mapperClass="org.apache.catalina.core.StandardContextMapper"
path="/exercises"
privileged="false"
reloadable="true"
startupTime="30"
swallowOutput="true"
useNaming="true"
wrapperClass="org.apache.catalina.core.StandardWrapper" >

</Context>

What is wrong ?

I have Windows NT and Tomcat 5 (from jwsdp 1.2).

Thank you,
Alex.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2003
Added on Jun 10 2003
1 comment
105 views