You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Bruce <ch...@yahoo.com> on 2000/03/30 09:28:29 UTC
IllegalAccess Error?
I got the following error, while trying to access a Class from within a
jsp page. The class exists withing the WEB-INF/classes dir. I am
using Tomcat 3.1
Error:
java.lang.IllegalAccessError: try to access class ClientInfo from class
_0002findex_0002ejspindex_jsp_6
at
_0002findex_0002ejspindex_jsp_6._jspService(_0002findex_0002ejspindex_jsp_6.java,
Compiled Code)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
at
org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled
Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java,
Compiled Code)
at
org.apache.tomcat.servlets.DefaultServlet.doGet(DefaultServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
Compiled Code)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java,
Compiled Code)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
Compiled Code)
at java.lang.Thread.run(Thread.java, Compiled Code)
JSP:
...
<td> </td>
</tr>
<tr valign="top">
<td class="content">
<%
ClientInfo client = new ClientInfo();
out.println("Hello");
client.setCompanyName("The Sleeter Group");
out.println(client.getCompanyName());
%>
<p align="center">This area is restricted for our
clients</p>
</td>
...
Any ideas?
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
Re: IllegalAccess Error?
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Nearly every case I've seen an IllegalAccessError is if you forgot to say "public" on your class
declaration. If you leave it off, the class is "package private", and can only be instantiated by other
classes in the same package.
Craig McClanahan
Chris Bruce wrote:
> I got the following error, while trying to access a Class from within a
> jsp page. The class exists withing the WEB-INF/classes dir. I am
> using Tomcat 3.1
>
> Error:
> java.lang.IllegalAccessError: try to access class ClientInfo from class
> _0002findex_0002ejspindex_jsp_6
> at
> _0002findex_0002ejspindex_jsp_6._jspService(_0002findex_0002ejspindex_jsp_6.java,
> Compiled Code)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
> Compiled Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java,
> Compiled Code)
> at
> org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java,
> Compiled Code)
> at
> org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled
> Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> Compiled Code)
> at
> org.apache.tomcat.core.RequestDispatcherImpl.forward(RequestDispatcherImpl.java,
> Compiled Code)
> at
> org.apache.tomcat.servlets.DefaultServlet.doGet(DefaultServlet.java,
> Compiled Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,
> Compiled Code)
> at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> Compiled Code)
> at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java,
> Compiled Code)
> at
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java,
> Compiled Code)
> at java.lang.Thread.run(Thread.java, Compiled Code)
>
> JSP:
> ...
> <td> </td>
> </tr>
> <tr valign="top">
> <td class="content">
> <%
> ClientInfo client = new ClientInfo();
> out.println("Hello");
> client.setCompanyName("The Sleeter Group");
> out.println(client.getCompanyName());
> %>
>
> <p align="center">This area is restricted for our
> clients</p>
> </td>
> ...
>
> Any ideas?
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org