RE: useing beans.

2001-03-01 Thread Hawkins, Keith (Keith)

Did you try changing the class to have public access?
This is just a hunch but the default constructor on a
non-public class may not be accessible given the IllegalAccess
exception that is being thrown.
-Keith


-Original Message-
From: Pater Pandoson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 9:26 AM
To: [EMAIL PROTECTED]
Subject: useing beans.


Hello

My jsp pages work fine but when I try to use beans I get this

 2001-03-01 12:10:19 - Ctx(  ): Exception in: R(  + /test.jsp + null) -
javax.servlet.ServletException: try to access class NormalizeText from
class _0002ftest_0002ejsptest_jsp_4
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)

at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)

at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:479)
Root cause:
java.lang.IllegalAccessError: try to access class NormalizeText from
class _0002ftest_0002ejsptest_jsp_4
at
_0002ftest_0002ejsptest_jsp_4._jspService(_0002ftest_0002ejsptest_jsp_4.java
:62)

at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:177)

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)

at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)

at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)

at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)

at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)

at java.lang.Thread.run(Thread.java:479)


The bean is in the classes dir and compled fine

import java.beans.*;


class NormalizeText{
private String text;

public void setText(String text){
 this.text = text;
}

public String getText(){
 return text;
}

}


and the jsp page looks like this

jsp:useBean id="TN" scope="session" class="NormalizeText" /
jsp:setProperty name="TN" property="text" value="what is the prob?" /


So can any one tell me what I am doing wrong.

Thanks.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: useing beans.

2001-03-01 Thread William Brogden



Pater Pandoson wrote:
 
 Hello
 
 My jsp pages work fine but when I try to use beans I get this
 
  2001-03-01 12:10:19 - Ctx(  ): Exception in: R(  + /test.jsp + null) -
 javax.servlet.ServletException: try to access class NormalizeText from
 class _0002ftest_0002ejsptest_jsp_4
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:399)

... snip

 The bean is in the classes dir and compled fine

 
 and the jsp page looks like this
 
 jsp:useBean id="TN" scope="session" class="NormalizeText" /
 jsp:setProperty name="TN" property="text" value="what is the prob?" /
 
 So can any one tell me what I am doing wrong.
 
 Thanks.

You need to put your bean in a package and specify the package
completely in the useBean tag.  Apparently, when Tomcat sees
the kind of usage you show, it assumes that the class is in the
"current" directory.



WBB - [EMAIL PROTECTED]
Java Cert mock exams http://www.lanw.com/java/javacert/
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: useing beans.

2001-03-01 Thread Pater Pandoson

Good call that was it all right. Thanks
it says nothing about it in my book!
agh well live and learn.


"Hawkins, Keith (Keith)" wrote:

 Did you try changing the class to have public access?
 This is just a hunch but the default constructor on a
 non-public class may not be accessible given the IllegalAccess
 exception that is being thrown.
 -Keith



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]