You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Matt White <MW...@madriver.k12.oh.us> on 2001/02/14 18:02:03 UTC

IllegalAccessError?

This is most likely a newbie question, so please bear with me.

I have a class of my own, ("Building") which is compiled and placed in my WEB-INF directory.

Whenever I try to instantiate this class, I receive a IllegalAccessError error. According to the Java 1.2.2 API docs:

"Thrown if an application attempts to access or modify a field, or to call a method that it does not have access to. 

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed."

Which makes sense, but the JSP will die with just this:

Building b = new Building();

When I go into the generated servlet, I can see that it dies on this same line every time. If I run it like this:

Building b;
b = new Building();

... it will die on the second line.

To see if there's a problem in my Building class I wrote a simple application which simply takes a dozen Building objects, tosses them into a LinkedList object, and then prints them out one at a time. It works great as an application, but this servlet is giving me fits.

Am I doing something wrong?  I'm at a loss.

- Matt