You can use plugin first classloading strategy by setting an option in the Pom.
Sent from my iPad On Thursday, 2 May 2013, Ingmar Kellner wrote: > Hello,**** > > ** ** > > I have a problem related to JFreeChart, which I use in my plugin.**** > > I use version 1.0.14 and use the classloader configuration described here ( > https://wiki.jenkins-ci.org/display/JENKINS/Plugin+Structure#PluginStructure-Classloader), > so that my plugin uses this version instead of 1.0.9 provided by the > Jenkins core.**** > > ** ** > > But now, I get the following LinkageError:**** > > ** ** > > Mai 02, 2013 10:50:53 PM org.kohsuke.stapler.compression.CompressionFilter > reportException**** > > Warnung: Untrapped servlet exception**** > > javax.servlet.ServletException: java.lang.LinkageError: > org/jfree/chart/JFreeChart**** > > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719)**** > > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)**** > > at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:384)** > ** > > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)**** > > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)**** > > at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)* > *** > > at > org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) > **** > > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)**** > > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)**** > > at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)**** > > at org.kohsuke.stapler.Stapler.service(Stapler.java:214)**** > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)*** > * > > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) > **** > > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > **** > > at > hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)*** > * > > at > hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)**** > > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) > **** > > ...**** > > Caused by: java.lang.LinkageError: org/jfree/chart/JFreeChart**** > > *at hudson.util.Graph.render(Graph.java:88)* > > * at hudson.util.Graph.doPng(Graph.java:98)* > > * at > com.hello2morrow.sonargraph.jenkinsplugin.controller.SonargraphChartAction.doGetPlot(SonargraphChartAction.java:124) > * > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)**** > > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > **** > > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > **** > > at java.lang.reflect.Method.invoke(Method.java:601)**** > > at > org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:288)*** > * > > at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:151)** > ** > > at > org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:90) > **** > > at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:111)* > *** > > at > org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) > **** > > at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)**** > > ... 45 more**** > > ** ** > > I use the following code to generate the chart **** > > ** ** > > * public* *void* doGetPlot(StaplerRequest req, StaplerResponse rsp)**** > > {**** > > //Some unimportant code here...**** > > ** ** > > * final* JFreeChart chart = plot.createXYChart(metric, xAxisLabel, > maxDataPoints, *true*);**** > > *try***** > > {**** > > Graph graph = *new* Graph(-1, defaultGraphicWidth, > defaultGraphicHeight)**** > > {**** > > @Override**** > > *protected* JFreeChart createGraph()**** > > {**** > > *return* chart;**** > > }**** > > };**** > > *graph.doPng(req, rsp);*** > > }**** > > *catch* (IOException ioe)**** > > {**** > > //Some exception handling here...**** > > ** ** > > If I understand this correctly, the problem is that I tell Graph to use a > JFreeChart (v1.0.14), whereas it has been compiled using a > JFreeChart(v1.0.9).**** > > Is there any way I can avoid this error and still use the 1.0.14 > functionality?**** > > ** ** > > Thanks for any suggestions!**** > > ** ** > > Cheers,**** > > ** ** > > Ingmar**** > > ** ** > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:_e({}, > 'cvml', 'jenkinsci-dev%[email protected]');>. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Sent from my phone -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
