The IllegalAccessException is not being thrown because the inner class could
not be loaded.
The IllegalAccessException is being thrown because the outer class does not
have permission to create an instance of the inner class(because the inner
class has a private constructor).
You could change the inner class's constructor to protected, that way only
the outer class (and subclasses of the outer class?) may create an instance
of the inner class.
ted stockwell
> -----Original Message-----
> From: Brian Agnew [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, May 04, 1999 4:08 AM
> To: '[EMAIL PROTECTED]'
> Subject: Peculiarity with inner classes
>
> Hello everyone,
>
> I'm using JServ 1.0b3 and the Sun JDK 1.1.6. All my JServ configuration
> etc.
> appears to be fine and I'm writing/running servlets ok, with the following
> exception.
>
> I added an inner class to my servlet code, and ran the resulting
> application
> ok (ie. from the command line). Running it as a servlet gives a
> java.lang.IllegalAccessException when that inner class is accessed for the
> first time. ie. the class loader can't/won't load it.
>
> On closer inspection I found my inner class constructor to be private.
> Changing it to public then makes the servlet work. So it's not a classpath
> problem. It looks to me like there's some issue wrt. the class loading
> under
> JServ as opposed to under the JVM (I believe that JServ uses it's own
> classloader).
>
> Has anyone experienced this before ? Does anyone have any pointers ?
>
> Thanks in advance,
>
> Brian
>
>
> ----------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> READ THE FAQ!!!! <http://java.apache.org/faq/>
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]