You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Aaron Brashears <gi...@gila.org> on 2001/04/09 07:15:09 UTC

Problem accessing beans in beta 3

I was building a simple web app which combines jsps with beans. When I
deployed the application (a few pages and one bean), and accessed the
jsp which makes use of the bean, an exception was thrown that jasper
was unable to compile the jsp because it couldn't find the bean class.

At first, I assumed it was all my problem, but after a few failed
attempts to circumvent the problem, I tried out an old application
that I copied, deployed and successfully tested out of a book when I
was working with 4.0 beta 1. The same exception was generated. What's
going on? I found a message in the archives that indicated beans have
to be in a package. Is this a new requirement?

/jsp/beans.jsp accesses LanguageBean
/jsp/WEB-INF/classes/LanguageBean.class exists.

server.xml is configured with the following snippet in 
<Context path="/jsp" docBase="/home/aaron/work/jsp">
</Context>

And the exception is:

A Servlet Exception Has Occurred

org.apache.jasper.JasperException: Unable to compile class for JSP/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:57: Class org.apache.jsp.LanguageBean not found.
                LanguageBean languageBean = null;
                ^
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:60: Class org.apache.jsp.LanguageBean not found.
                    languageBean= (LanguageBean)
                                   ^
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:65: Class org.apache.jsp.LanguageBean not found.
                            languageBean = (LanguageBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "LanguageBean");
                                            ^
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:93: Class org.apache.jsp.LanguageBean not found.
                out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getName())));
                                                        ^
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:100: Class org.apache.jsp.LanguageBean not found.
                out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getLanguage())));
                                                        ^
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.java:107: Class org.apache.jsp.LanguageBean not found.
                out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribute("languageBean")).getLanguageComments())));
                                                        ^
6 errors

	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
	at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:501)
	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:357)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:431)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2175)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:162)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:827)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:904)
	at java.lang.Thread.run(Thread.java:484)



Re: R: Problem accessing beans in beta 3

Posted by Aaron Brashears <gi...@gila.org>.
I don't follow what you mean. Beans are supposed to be in
WEB-INF/classes right? Did I leave something out of my <Context> tag?


On Mon, Apr 09, 2001 at 08:18:24AM +0200, luigi wrote:
> Hi,
>         I've some similar problems, but using jsp with the tomcat's beans,
> that doesn't happen. I think there is a problem of setting in server.xml.
> Try changing the path of the bean .class file
> 
> bye
> 
> ----- Original Message -----
> From: Aaron Brashears <gi...@gila.org>
> To: Tomcat User <to...@jakarta.apache.org>
> Sent: Monday, April 09, 2001 7:15 AM
> Subject: Problem accessing beans in beta 3
> 
> 
> > I was building a simple web app which combines jsps with beans. When I
> > deployed the application (a few pages and one bean), and accessed the
> > jsp which makes use of the bean, an exception was thrown that jasper
> > was unable to compile the jsp because it couldn't find the bean class.
> >
> > At first, I assumed it was all my problem, but after a few failed
> > attempts to circumvent the problem, I tried out an old application
> > that I copied, deployed and successfully tested out of a book when I
> > was working with 4.0 beta 1. The same exception was generated. What's
> > going on? I found a message in the archives that indicated beans have
> > to be in a package. Is this a new requirement?
> >
> > /jsp/beans.jsp accesses LanguageBean
> > /jsp/WEB-INF/classes/LanguageBean.class exists.
> >
> > server.xml is configured with the following snippet in
> > <Context path="/jsp" docBase="/home/aaron/work/jsp">
> > </Context>
> >
> > And the exception is:
> >
> > A Servlet Exception Has Occurred
> >
> > org.apache.jasper.JasperException: Unable to compile class for
> JSP/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_j
> sp.java:57: Class org.apache.jsp.LanguageBean not found.
> >                 LanguageBean languageBean = null;
> >                 ^

<the rest of the exception follows...>

R: Problem accessing beans in beta 3

Posted by luigi <lf...@katamail.com>.
Hi,
        I've some similar problems, but using jsp with the tomcat's beans,
that doesn't happen. I think there is a problem of setting in server.xml.
Try changing the path of the bean .class file

bye

----- Original Message -----
From: Aaron Brashears <gi...@gila.org>
To: Tomcat User <to...@jakarta.apache.org>
Sent: Monday, April 09, 2001 7:15 AM
Subject: Problem accessing beans in beta 3


> I was building a simple web app which combines jsps with beans. When I
> deployed the application (a few pages and one bean), and accessed the
> jsp which makes use of the bean, an exception was thrown that jasper
> was unable to compile the jsp because it couldn't find the bean class.
>
> At first, I assumed it was all my problem, but after a few failed
> attempts to circumvent the problem, I tried out an old application
> that I copied, deployed and successfully tested out of a book when I
> was working with 4.0 beta 1. The same exception was generated. What's
> going on? I found a message in the archives that indicated beans have
> to be in a package. Is this a new requirement?
>
> /jsp/beans.jsp accesses LanguageBean
> /jsp/WEB-INF/classes/LanguageBean.class exists.
>
> server.xml is configured with the following snippet in
> <Context path="/jsp" docBase="/home/aaron/work/jsp">
> </Context>
>
> And the exception is:
>
> A Servlet Exception Has Occurred
>
> org.apache.jasper.JasperException: Unable to compile class for
JSP/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_j
sp.java:57: Class org.apache.jsp.LanguageBean not found.
>                 LanguageBean languageBean = null;
>                 ^
>
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.
java:60: Class org.apache.jsp.LanguageBean not found.
>                     languageBean= (LanguageBean)
>                                    ^
>
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.
java:65: Class org.apache.jsp.LanguageBean not found.
>                             languageBean = (LanguageBean)
java.beans.Beans.instantiate(this.getClass().getClassLoader(),
"LanguageBean");
>                                             ^
>
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.
java:93: Class org.apache.jsp.LanguageBean not found.
>
out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribu
te("languageBean")).getName())));
>                                                         ^
>
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.
java:100: Class org.apache.jsp.LanguageBean not found.
>
out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribu
te("languageBean")).getLanguage())));
>                                                         ^
>
/home/aaron/tmp/jakarta-tomcat-4.0-b3/bin/./../work/localhost/jsp/beans_jsp.
java:107: Class org.apache.jsp.LanguageBean not found.
>
out.print(JspRuntimeLibrary.toString((((LanguageBean)pageContext.findAttribu
te("languageBean")).getLanguageComments())));
>                                                         ^
> 6 errors
>
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
> at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:501)
> at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:175)
> at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:187)
> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:357)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:431)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:246)
> at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:191)
> at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:255)
> at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:225)
> at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2175)
> at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
> at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
> at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
> at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:162)
> at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
> at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:879)
> at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
827)
> at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:904)
> at java.lang.Thread.run(Thread.java:484)
>
>
>