Quantcast

classloading issues with hpi plugin

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

classloading issues with hpi plugin

Tom Huybrechts
This simple plugin:

/**
 * @plugin
 */
public class PluginImpl extends hudson.Plugin {
        public void start() throws Exception {
                        org.jdom.xpath.XPath.newInstance("");
        }
}

fails at startup with hpi:run, throwing this exception:

hudson.util.IOException2: Failed to initialize
        at hudson.PluginWrapper.load(PluginWrapper.java:253)
        at hudson.PluginManager.<init>(PluginManager.java:90)
        at hudson.model.Hudson.<init>(Hudson.java:334)
        at hudson.WebAppMain$2.run(WebAppMain.java:129)
Caused by: org.jdom.JDOMException: java.lang.NoClassDefFoundError:
org/jdom/Parent: org/jdom/Parent
        at org.jdom.xpath.XPath.newInstance(XPath.java:139)
        at hudson.myplugin.PluginImpl.start(PluginImpl.java:18)
        at hudson.PluginWrapper.load(PluginWrapper.java:250)
        ... 3 more
Caused by: java.lang.NoClassDefFoundError: org/jdom/Parent
        at org.jaxen.jdom.JDOMXPath.<init>(JDOMXPath.java:91)
        at org.jdom.xpath.JaxenXPath.setXPath(JaxenXPath.java:281)
        at org.jdom.xpath.JaxenXPath.<init>(JaxenXPath.java:99)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.jdom.xpath.XPath.newInstance(XPath.java:129)
        ... 5 more
Caused by: java.lang.ClassNotFoundException: org.jdom.Parent
        at java.lang.ClassLoader.findClass(ClassLoader.java:358)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at org.jvnet.hudson.maven.plugins.hpi.MaskingClassLoader.loadClass(MaskingClassLoader.java:22)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:325)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 13 more

My pom contains direct dependencies on jdom and jaxen.

Could this be related to jetty ? What can I do about it ?

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: classloading issues with hpi plugin

Tom Huybrechts
correction: this happens with winstone too (without the hpi plugin)

Tom

On Sun, Feb 24, 2008 at 11:09 PM, Tom Huybrechts
<[hidden email]> wrote:

> This simple plugin:
>
>  /**
>   * @plugin
>   */
>  public class PluginImpl extends hudson.Plugin {
>         public void start() throws Exception {
>                         org.jdom.xpath.XPath.newInstance("");
>         }
>  }
>
>  fails at startup with hpi:run, throwing this exception:
>
>  hudson.util.IOException2: Failed to initialize
>         at hudson.PluginWrapper.load(PluginWrapper.java:253)
>         at hudson.PluginManager.<init>(PluginManager.java:90)
>         at hudson.model.Hudson.<init>(Hudson.java:334)
>         at hudson.WebAppMain$2.run(WebAppMain.java:129)
>  Caused by: org.jdom.JDOMException: java.lang.NoClassDefFoundError:
>  org/jdom/Parent: org/jdom/Parent
>         at org.jdom.xpath.XPath.newInstance(XPath.java:139)
>         at hudson.myplugin.PluginImpl.start(PluginImpl.java:18)
>         at hudson.PluginWrapper.load(PluginWrapper.java:250)
>         ... 3 more
>  Caused by: java.lang.NoClassDefFoundError: org/jdom/Parent
>         at org.jaxen.jdom.JDOMXPath.<init>(JDOMXPath.java:91)
>         at org.jdom.xpath.JaxenXPath.setXPath(JaxenXPath.java:281)
>         at org.jdom.xpath.JaxenXPath.<init>(JaxenXPath.java:99)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at org.jdom.xpath.XPath.newInstance(XPath.java:129)
>         ... 5 more
>  Caused by: java.lang.ClassNotFoundException: org.jdom.Parent
>         at java.lang.ClassLoader.findClass(ClassLoader.java:358)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at org.jvnet.hudson.maven.plugins.hpi.MaskingClassLoader.loadClass(MaskingClassLoader.java:22)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
>         at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:325)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         ... 13 more
>
>  My pom contains direct dependencies on jdom and jaxen.
>
>  Could this be related to jetty ? What can I do about it ?
>
>  Tom
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: classloading issues with hpi plugin

Kohsuke Kawaguchi
Administrator
In reply to this post by Tom Huybrechts

Hmm. Can you send me your plugin workspace as a test case?

Tom Huybrechts wrote:

> This simple plugin:
>
> /**
>  * @plugin
>  */
> public class PluginImpl extends hudson.Plugin {
> public void start() throws Exception {
> org.jdom.xpath.XPath.newInstance("");
> }
> }
>
> fails at startup with hpi:run, throwing this exception:
>
> hudson.util.IOException2: Failed to initialize
>         at hudson.PluginWrapper.load(PluginWrapper.java:253)
>         at hudson.PluginManager.<init>(PluginManager.java:90)
>         at hudson.model.Hudson.<init>(Hudson.java:334)
>         at hudson.WebAppMain$2.run(WebAppMain.java:129)
> Caused by: org.jdom.JDOMException: java.lang.NoClassDefFoundError:
> org/jdom/Parent: org/jdom/Parent
>         at org.jdom.xpath.XPath.newInstance(XPath.java:139)
>         at hudson.myplugin.PluginImpl.start(PluginImpl.java:18)
>         at hudson.PluginWrapper.load(PluginWrapper.java:250)
>         ... 3 more
> Caused by: java.lang.NoClassDefFoundError: org/jdom/Parent
>         at org.jaxen.jdom.JDOMXPath.<init>(JDOMXPath.java:91)
>         at org.jdom.xpath.JaxenXPath.setXPath(JaxenXPath.java:281)
>         at org.jdom.xpath.JaxenXPath.<init>(JaxenXPath.java:99)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at org.jdom.xpath.XPath.newInstance(XPath.java:129)
>         ... 5 more
> Caused by: java.lang.ClassNotFoundException: org.jdom.Parent
>         at java.lang.ClassLoader.findClass(ClassLoader.java:358)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at org.jvnet.hudson.maven.plugins.hpi.MaskingClassLoader.loadClass(MaskingClassLoader.java:22)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
>         at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:325)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>         ... 13 more
>
> My pom contains direct dependencies on jdom and jaxen.
>
> Could this be related to jetty ? What can I do about it ?
>
> Tom
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

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