You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Roy Smith <ro...@panix.com> on 2004/03/20 23:31:07 UTC
Why can't tomcat find my bean classes?
I'm running jakarta-tomcat-5.0.18 on OSX.
I've got a trivial little JSP file:
<jsp:useBean id="doubler" class="DoublerBean" scope="page">
<jsp:setProperty name="doubler" property="in" value="wugga"/>
</jsp:useBean>
<html>
<body>
It looks like "<jsp:getProperty name="doubler"
property="out"/>"
</body>
</html>
and my DoublerBean.java file is pretty simple too:
public class DoublerBean
{
private String phrase;
public DoublerBean ()
{
// empty
}
public void setIn (String phrase)
{
this.phrase = phrase;
}
public String getOut ()
{
return (phrase + ", " + phrase);
}
}
When I run ant, I get a build/WEB-INF/classes/DoublerBean.class file,
but my jsp application can't seem to find the DoublerBean class. When
I reload my app through the manager and run it, I get:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /foo.jsp
Generated servlet error:
[javac] Compiling 1 source file
/usr/local/jakarta-tomcat-5.0.18/work/Catalina/localhost/SquawkLog/org/
apache/jsp/foo_jsp.java:40: cannot resolve symbol
symbol : class DoublerBean
location: class org.apache.jsp.foo_jsp
DoublerBean doubler = null;
^
and a few more similar errors complaining that it can't resolve
DoublerBean. Other JSP pages I wrote were able to find their required
classes in the same location. What's different about finding bean
classes?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Why can't tomcat find my bean classes?
Posted by Tom K <tk...@cox.net>.
Tomcat like your bean in a package.
-----Original Message-----
From: Roy Smith [mailto:roy@panix.com]
Sent: Saturday, March 20, 2004 4:31 PM
To: tomcat-user@jakarta.apache.orgtomcat-user@jakarta.apache.org
Cc: Roy Smith
Subject: Why can't tomcat find my bean classes?
I'm running jakarta-tomcat-5.0.18 on OSX.
I've got a trivial little JSP file:
<jsp:useBean id="doubler" class="DoublerBean" scope="page">
<jsp:setProperty name="doubler" property="in" value="wugga"/>
</jsp:useBean>
<html>
<body>
It looks like "<jsp:getProperty name="doubler"
property="out"/>"
</body>
</html>
and my DoublerBean.java file is pretty simple too:
public class DoublerBean
{
private String phrase;
public DoublerBean ()
{
// empty
}
public void setIn (String phrase)
{
this.phrase = phrase;
}
public String getOut ()
{
return (phrase + ", " + phrase);
}
}
When I run ant, I get a build/WEB-INF/classes/DoublerBean.class file,
but my jsp application can't seem to find the DoublerBean class. When
I reload my app through the manager and run it, I get:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /foo.jsp
Generated servlet error:
[javac] Compiling 1 source file
/usr/local/jakarta-tomcat-5.0.18/work/Catalina/localhost/SquawkLog/org/
apache/jsp/foo_jsp.java:40: cannot resolve symbol
symbol : class DoublerBean
location: class org.apache.jsp.foo_jsp
DoublerBean doubler = null;
^
and a few more similar errors complaining that it can't resolve
DoublerBean. Other JSP pages I wrote were able to find their required
classes in the same location. What's different about finding bean
classes?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Why can't tomcat find my bean classes?
Posted by "Noel J. Bergman" <no...@devtech.com>.
> <jsp:useBean id="doubler" class="DoublerBean" scope="page">
> When I run ant, I get a build/WEB-INF/classes/DoublerBean.class file
Tomcat requires the bean to be in a package.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org