You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan Lovell <dl...@mcs.net> on 2000/11/02 17:37:22 UTC

JSP compile error using bean jar file

I am using Tomcat 3.1 on Win NT.  When I try and bring up my JSP page I
receive the
following error:

Error: 500

Location: /mytest/test.jsp

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\Program
Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:66:

Undefined variable or class name: profile
                  proto.Address[] addrs  =
(proto.Address[])profile.loadAddresses("18190");
                                                            ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:74:

Undefined variable: addrsProfile
                  addrsProfile = addrs[i];
                  ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:123:

Undefined variable: acctProfile
                  acctProfile =
(proto.Account)profile.loadAccount("18190");
                  ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:123:

Undefined variable or class name: profile
                  acctProfile =
(proto.Account)profile.loadAccount("18190");
                                               ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:179:

Undefined variable or class name: profile
                  proto.Phone [] phns =
(proto.Phone[])profile.loadPhones("18190");
                                                       ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java:188:

Undefined variable: acctPhone
                  acctPhone = phns[i];
                  ^
6 errors

        at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)

        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)

        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)

        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,

Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,

Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,

Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)

I have a JAR file in the WEB-INF\lib directory that contains my beans.
Is there anything
else I am missing.  I tried to put the JAR file in the CLASSPATH, but
that did not work.

My bean JAR contains a class called Account, Phone, Officer, Address,
Profile

Here is part of my JSP page:

<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=WINDOWS-1252">
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<H2>The following output is from JSP code:</H2>

<jsp:usebean id="profile"  class="proto.Profile">
  <jsp:setProperty  name="profile" property="account" value = "18190" />

</jsp:usebean>

<jsp:usebean  id="addrsProfile" class="proto.Address">
</jsp:usebean>

<%
  proto.Address[] addrs  =
(proto.Address[])profile.loadAddresses("18190");
%>

Thanks for any help you can give me




Built mod_jk on linux

Posted by John Elia <je...@ratedg.com>.
For anyone who is interested.  I compiled mod_jk.so on linux (Red Hat 6.2,
Apache 1.3.14, Tomcat 1.3). here is what I did.

from ( /usr/local/jakartahome/jakarta-tomcat/src/native/apache/jserv ) I
used the command line ( apxs -o
mod_jk.so -I../jk -I/usr/local/java/include -I/usr/local/java/include/linux
-c *.c ../jk/*.c ) It ran through, but did not finish, so I used (
gcc -shared -o mod_jk.so *.o ) to finish the build.  I was having trouble
finding out how to do this, so I thought I would pass on the info incase
anyone else wanted to know.  Now all I have to do is learn how to implement
it..lol.

Thanks gang for the support and help the group has provided me.

John Elia
WD
711.NET
jelia@711.net




RE: JSP compile error using bean jar file

Posted by Ranko Bijelonic <ra...@dietsmart.com>.
its jsp:useBean with a capital B


-----Original Message-----
From: Dan Lovell [mailto:dlovell@mcs.net]
Sent: Thursday, November 02, 2000 11:37 AM
To: tomcat-user@jakarta.apache.org
Subject: JSP compile error using bean jar file


I am using Tomcat 3.1 on Win NT.  When I try and bring up my JSP page I
receive the
following error:

Error: 500

Location: /mytest/test.jsp

Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\Program
Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:66:

Undefined variable or class name: profile
                  proto.Address[] addrs  =
(proto.Address[])profile.loadAddresses("18190");
                                                            ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:74:

Undefined variable: addrsProfile
                  addrsProfile = addrs[i];
                  ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:123:

Undefined variable: acctProfile
                  acctProfile =
(proto.Account)profile.loadAccount("18190");
                  ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:123:

Undefined variable or class name: profile
                  acctProfile =
(proto.Account)profile.loadAccount("18190");
                                               ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:179:

Undefined variable or class name: profile
                  proto.Phone [] phns =
(proto.Phone[])profile.loadPhones("18190");
                                                       ^
C:\Program Files\Apache
Group\Tomcat\work\localhost_8080%2Fmytest\_0002ftest_0002ejsptest_jsp_0.java
:188:

Undefined variable: acctPhone
                  acctPhone = phns[i];
                  ^
6 errors

        at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
        at
org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:149)

        at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va:161)

        at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)

        at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,

Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java,

Compiled Code)
        at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,

Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)

I have a JAR file in the WEB-INF\lib directory that contains my beans.
Is there anything
else I am missing.  I tried to put the JAR file in the CLASSPATH, but
that did not work.

My bean JAR contains a class called Account, Phone, Officer, Address,
Profile

Here is part of my JSP page:

<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=WINDOWS-1252">
<META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<H2>The following output is from JSP code:</H2>

<jsp:usebean id="profile"  class="proto.Profile">
  <jsp:setProperty  name="profile" property="account" value = "18190" />

</jsp:usebean>

<jsp:usebean  id="addrsProfile" class="proto.Address">
</jsp:usebean>

<%
  proto.Address[] addrs  =
(proto.Address[])profile.loadAddresses("18190");
%>

Thanks for any help you can give me