Quantcast

Jenkins loads bad ASM lib version

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

Jenkins loads bad ASM lib version

Ognjen Bubalo
Hi,

When the JaCoCo plugin tries to load the *.exec files it uses the JaCoCo API which needs the ASM 3 lib. For some reason a Jenkins instance needs ASM 2, and the plugin does not load the ASM 3 lib (which is in the .hpi), it loads the ASM 2.

In the pom.xml of the .hpi this is inserted:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<phase>insert-test</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.kohsuke.asm3</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>

What can we do?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Jenkins loads bad ASM lib version

Jesse Glick-4
On 10/03/2012 07:00 AM, Ognjen Bubalo wrote:
> When the JaCoCo plugin tries to load the *.exec files it uses the JaCoCo API which needs the ASM 3 lib. For some reason a Jenkins instance needs ASM 2, and the plugin
> does not load the ASM 3 lib (which is in the .hpi), it loads the ASM 2.

https://jenkins-ci.org/maven-hpi-plugin/hpi-mojo.html#pluginFirstClassLoader (also try maskClasses)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Jenkins loads bad ASM lib version

Mickael Istria
Jesse,

Is there a way to workaround this issue once plugin is released on install? Can I, in my JENKINS_HOME, change a flag somewhere so a plugin will use its classloader first on next startup?

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

Re: Jenkins loads bad ASM lib version

Ognjen Bubalo
Hi Jesse,

Thank you for your response! I tried the pluginFirstClassLoader but didn't work for me (didn't try maskClasses because of lack of a good example). I think I would need your help in the configuration of the pom.xml. Now it looks like this:

<pluginExecutionFilter>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>
maven-hpi-plugin
</artifactId>
<versionRange>[1.64,)</versionRange>
<goals>
<goal>apt-compile</goal>
<goal>insert-test</goal>
<goal>
resolve-test-dependencies
</goal>
<goal>test-hpl</goal>
<goal>validate</goal>
</goals>
<configuration>
<pluginFirstClassLoader>true</pluginFirstClassLoader>

</configuration>
</pluginExecutionFilter>

Thanks,
Ogi

On Thu, Oct 4, 2012 at 4:36 PM, Mickael Istria <[hidden email]> wrote:
Jesse,

Is there a way to workaround this issue once plugin is released on install? Can I, in my JENKINS_HOME, change a flag somewhere so a plugin will use its classloader first on next startup?

Cheers,

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

Re: Jenkins loads bad ASM lib version

Jesse Glick-4
On 10/04/2012 02:22 PM, Ognjen Bubalo wrote:
> <pluginExecutionFilter>

I guess this is something Eclipse-specific which I cannot help you with. Is there some reason your <configuration> is not just part of /projects/plugins/plugin?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Jenkins loads bad ASM lib version

Ognjen Bubalo
No, I think there is no a specific reason. So, if you can just point to a specific good configured plugin's pom I would be thankful.
 
This is the actual POM (the last pluginExecutionFilter is not committed):
 
Thanks,
Ogi

On Thu, Oct 4, 2012 at 8:52 PM, Jesse Glick <[hidden email]> wrote:
On 10/04/2012 02:22 PM, Ognjen Bubalo wrote:
<pluginExecutionFilter>

I guess this is something Eclipse-specific which I cannot help you with. Is there some reason your <configuration> is not just part of /projects/plugins/plugin?

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

Re: Jenkins loads bad ASM lib version

Jesse Glick-4
On 10/04/2012 04:56 PM, Ognjen Bubalo wrote:
> if you can just point to a specific good configured plugin's pom I would be thankful.

According to grep [1] this is used in maven-dependency-update-trigger-plugin and repository-connector-plugin.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Grepping+all+sources
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Jenkins loads bad ASM lib version

Ognjen Bubalo
Thank you! pluginFirstClassLoader + maskClasses worked!

Cheers,
Ogi

2012. október 4., csütörtök 23:28:45 UTC+2 időpontban Jesse Glick a következőt írta:
On 10/04/2012 04:56 PM, Ognjen Bubalo wrote:
> if you can just point to a specific good configured plugin's pom I would be thankful.

According to grep [1] this is used in maven-dependency-update-trigger-plugin and repository-connector-plugin.

[1] https://wiki.jenkins-ci.org/display/JENKINS/Grepping+all+sources
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Jenkins loads bad ASM lib version

kohsuke Kawaguchi (CB)
In reply to this post by Ognjen Bubalo

Possibly relevant: http://kohsuke.org/2012/03/03/potd-package-renamed-asm/

Use of ASM in Jenkins is bit tricky because some application servers do
put some random versions of ASM into webapp classpath.

On 10/03/2012 04:00 AM, Ognjen Bubalo wrote:

> Hi,
>
> When the JaCoCo plugin tries to load the *.exec files it uses the JaCoCo
> API which needs the ASM 3 lib. For some reason a Jenkins instance needs
> ASM 2, and the plugin does not load the ASM 3 lib (which is in the
> .hpi), it loads the ASM 2.
>
> In the pom.xml of the .hpi this is inserted:
>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-shade-plugin</artifactId>
> <version>1.3.1</version>
> <executions>
> <execution>
> <phase>insert-test</phase>
> <goals>
> <goal>shade</goal>
> </goals>
> <configuration>
> <relocations>
> <relocation>
> <pattern>org.objectweb.asm</pattern>
> <shadedPattern>org.kohsuke.asm3</shadedPattern>
> </relocation>
> </relocations>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
> What can we do?


--
Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/
Try Nectar, our professional version of Jenkins
Loading...