Quantcast

jaxen JDOM classloading issues.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

jaxen JDOM classloading issues.

Nord, James
Hi all,
 
I'm having a classloading issue with Jaxen/XPath in a plugin.  The dependencies are all correct and are present in the HPI, but when running the plugin failes with
 
java.lang.NoClassDefFoundError: org/jdom/Parent
 
Which exists and is packaged in the .hpi.
 
I found a similar report http://markmail.org/message/prtdhkewlg6iq65j and there are multiple reports of this in containers such as glassfish[1] etc which ship their own jdom.
 
I'm guessing that Hudson is picking up the jaxen that ships with itself (beta-11) and not the version I package in my hpi.  And the version in Hudson doesn't know about my classloaders and as such barfs....
 
Any suggestions on how to solve this in a plugin?
 
[1] https://issues.apache.org/jira/browse/GERONIMO-3894
 
 

**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the [hidden email] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jaxen JDOM classloading issues.

Kohsuke Kawaguchi
Administrator

Right, because of the parent-first classloading.

I think a quick hack would be to introduce a mask capability so that a
plugin can selectively hide some classes from the parent classloader.


Nord, James wrote:

> Hi all,
>  
> I'm having a classloading issue with Jaxen/XPath in a plugin.  The
> dependencies are all correct and are present in the HPI, but when
> running the plugin failes with
>  
> java.lang.NoClassDefFoundError: org/jdom/Parent
>  
> Which exists and is packaged in the .hpi.
>  
> I found a similar report http://markmail.org/message/prtdhkewlg6iq65j
> and there are multiple reports of this in containers such as
> glassfish[1] etc which ship their own jdom.
>  
> I'm guessing that Hudson is picking up the jaxen that ships with itself
> (beta-11) and not the version I package in my hpi.  And the version in
> Hudson doesn't know about my classloaders and as such barfs....
>  
> Any suggestions on how to solve this in a plugin?
>  
> [1] https://issues.apache.org/jira/browse/GERONIMO-3894
>  
>  
>
> **************************************************************************************
> This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the [hidden email] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
> **************************************************************************************
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jaxen JDOM classloading issues.

Kohsuke Kawaguchi
Administrator

In rev.19658 (and hence 1.316), I added <maskClasses> configuration
parameter to maven-hpi-plugin so that you can hide classes from the core
selectively.

This will be maven-hpi-plugin 1.40


>     /**
>      * [ws|tab|CR|LF]+ separated list of package prefixes that your plugin doesn't want to see
>      * from the core.
>      *
>      * <p>
>      * Tokens in this list is prefix-matched against the fully-qualified class name, so add
>      * "." to the end of each package name, like "com.foo. com.bar."
>      *
>      * @parameter
>      */
>     private String maskClasses;

Kohsuke Kawaguchi wrote:

> Right, because of the parent-first classloading.
>
> I think a quick hack would be to introduce a mask capability so that a
> plugin can selectively hide some classes from the parent classloader.
>
>
> Nord, James wrote:
>> Hi all,
>>  
>> I'm having a classloading issue with Jaxen/XPath in a plugin.  The
>> dependencies are all correct and are present in the HPI, but when
>> running the plugin failes with
>>  
>> java.lang.NoClassDefFoundError: org/jdom/Parent
>>  
>> Which exists and is packaged in the .hpi.
>>  
>> I found a similar report http://markmail.org/message/prtdhkewlg6iq65j
>> and there are multiple reports of this in containers such as
>> glassfish[1] etc which ship their own jdom.
>>  
>> I'm guessing that Hudson is picking up the jaxen that ships with itself
>> (beta-11) and not the version I package in my hpi.  And the version in
>> Hudson doesn't know about my classloaders and as such barfs....
>>  
>> Any suggestions on how to solve this in a plugin?
>>  
>> [1] https://issues.apache.org/jira/browse/GERONIMO-3894
>>  
>>  
>>
>> **************************************************************************************
>> This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the [hidden email] and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
>>
>> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
>> **************************************************************************************
>>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   http://weblogs.java.net/blog/kohsuke/

smime.p7s (4K) Download Attachment
Loading...