[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jetty-users] Fun with classloaders and start.jar
- From: Joakim Erdfelt <joakim@xxxxxxxxxxx>
- Date: Wed, 20 Jun 2012 15:31:19 -0700
- Delivered-to: firstname.lastname@example.org
start.jar itself does no work around the WebAppContext's classloaders.
That's for the various XML files you are using to manage.
The WebAppContext has a ClassLoader layer of its own.
This layer is likely preventing you from accessing the webapp specific classes from the server classloader.
If you want to play around with the access rules, you'll want to check out the WebAppContext class and the relationship of System Classes to Server Classes.
Accessing classes in that direction Server -> WebApp seems odd to me.
Check the __dftSystemClasses and __dftServerClasses fields (and comments) at
Developer advice, services and support
from the Jetty & CometD experts.
On Wed, Jun 20, 2012 at 3:18 PM, ccleve <ccleve.tech@xxxxxxxxx>
I recently switched our app from our own startup code to using start.jar. Now we're getting an error in our webapp:
java.lang.IllegalAccessException: com.mycompany.MySuperClass can not access a member of class com.mycompany.MySubClass with modifiers "protected"
MySuperClass is an odd beast. It exists in a jar in the main /lib directory. It contains a method that uses reflection to examine protected members of subclasses. MySubClass exists in the webapp.
MySuperClass and MySubClass are both in the same package, but in different jars.
I do not get this error when I use our own Jetty startup code, only with start.jar. My guess is that start.jar sets up classloaders in a way that prevents access, but that's just a guess.
Anyone know how to fix this?
jetty-users mailing list