[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Fun with classloaders and start.jar

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?