I have problem accessing protected method of classes localted in same package but in different jar.
Dependencies of same groupid are used in a distinct classloader, you might
encounter problems when trying to access protected method of class in
same package but in different dependency group (a jar file from another maven groupid).
There is no simple solution to this problem since it is a java
security protection to avoid malicious code execution (see
http://www.artima.com/insidejvm/ed2/security2.html). The only workaround is to group the 2 dependencies under the same classloader using pomstrap.customgroup property.
-Dpomstrap.customgroup="groupId:artifact groupId:artifact,groupId:artifact groupId:artifact, ...
javax.mail does not work
Mail required activation to be loaded in same classloader (it uses protected methods of classes located in activation). You have to group the jar manually using system property.
-Dpomstrap.customgroup="javax.activation:activation javax.mail:mail"
If you are using JDK6, activation is provided by JDK so you want to use this implementation, you should run you application with Mail running in same classloader (meaning Mail should be at same level as pomstrap jar).
Some applications are working with JDK5 but not with JDK6 JDK6 has some new libraries provided such as activation. Those libraries may conflict with artifact with lower version dynamically loaded. Pomstrap allows you to discard loading of such artifact using 'neverload' property. -Dpomstrap.neverload=javax.activation:activation,xalan:xalan Here we tell pomstrap not to load any activation and xalan versions (assuming JDK should have the better version).
|