You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sa...@automatedlogic.com on 2001/06/15 17:20:22 UTC

IllegalAccessError when run from Tomcat

When running a servlet from within Tomcat I get the following exception:

java.lang.IllegalAccessError: try to access field org.w3c.tidy.ParserImpl._parseHead from class org.w3c.tidy.ParserImpl$ParseHTML
     at org.w3c.tidy.ParserImpl$ParseHTML.parse(ParserImpl.java)
     at org.w3c.tidy.ParserImpl.parseDocument(ParserImpl.java)
     at org.w3c.tidy.Tidy.parse(Tidy.java)
     at org.w3c.tidy.Tidy.parseDOM(Tidy.java)
                ...

A method in the inner class $ParseHTML is trying to access a private field
_parseHead in the containing class, but that is legal as far as I know.
When I move the body of this servlet to a stand alone application it runs
fine - no exceptions.  Is there some strange JVM security manager here that
is different from running as a real application?  Anyone have an idea what
is going on?


Re: IllegalAccessError when run from Tomcat

Posted by Luba Powell <lu...@bellatlantic.net>.
Put:
System.out.println(System.getSecurityManager()) into your program.
Let us know what it says.

----- Original Message -----
From: <sa...@automatedlogic.com>
To: <to...@jakarta.apache.org>
Sent: Friday, June 15, 2001 11:20 AM
Subject: IllegalAccessError when run from Tomcat


> When running a servlet from within Tomcat I get the following exception:
>
> java.lang.IllegalAccessError: try to access field
org.w3c.tidy.ParserImpl._parseHead from class
org.w3c.tidy.ParserImpl$ParseHTML
>      at org.w3c.tidy.ParserImpl$ParseHTML.parse(ParserImpl.java)
>      at org.w3c.tidy.ParserImpl.parseDocument(ParserImpl.java)
>      at org.w3c.tidy.Tidy.parse(Tidy.java)
>      at org.w3c.tidy.Tidy.parseDOM(Tidy.java)
>                 ...
>
> A method in the inner class $ParseHTML is trying to access a private field
> _parseHead in the containing class, but that is legal as far as I know.
> When I move the body of this servlet to a stand alone application it runs
> fine - no exceptions.  Is there some strange JVM security manager here
that
> is different from running as a real application?  Anyone have an idea what
> is going on?
>


Re: IllegalAccessError when run from Tomcat

Posted by Robert Schweng <hy...@multiplayer.ch>.
i am not perfectly sure, but as far as i know
are inner classes  in beans not allowed!!.
so i could imagine this is also a fact for
servlets.
but dont ask me why.
anyway would it be worth to try cause its pretty simple to make
the inner classe outer classes.

cheers
hype



----- Original Message -----
From: <sa...@automatedlogic.com>
To: <to...@jakarta.apache.org>
Sent: Friday, June 15, 2001 5:20 PM
Subject: IllegalAccessError when run from Tomcat


> When running a servlet from within Tomcat I get the following exception:
>
> java.lang.IllegalAccessError: try to access field
org.w3c.tidy.ParserImpl._parseHead from class
org.w3c.tidy.ParserImpl$ParseHTML
>      at org.w3c.tidy.ParserImpl$ParseHTML.parse(ParserImpl.java)
>      at org.w3c.tidy.ParserImpl.parseDocument(ParserImpl.java)
>      at org.w3c.tidy.Tidy.parse(Tidy.java)
>      at org.w3c.tidy.Tidy.parseDOM(Tidy.java)
>                 ...
>
> A method in the inner class $ParseHTML is trying to access a private field
> _parseHead in the containing class, but that is legal as far as I know.
> When I move the body of this servlet to a stand alone application it runs
> fine - no exceptions.  Is there some strange JVM security manager here
that
> is different from running as a real application?  Anyone have an idea what
> is going on?
>