Problems building gerrit-trigger-plugin

109 views
Skip to first unread message

Øyvind Harboe

unread,
May 18, 2015, 2:30:04 AM5/18/15
to jenkin...@googlegroups.com
Hi,

I'm having problems building the gerrit-trigger-plugin. It fails with the error below when running tests. This is with the latest from gerrit-trigger-plugin master.

Any ideas on how to fix this?

Configuration details at the bottom of this post. I guess I'm on the bleeding edge by running Java 1.8 and Ubuntu 14 and that there's some versioning issue here, but it would be nice if I could create patches with the gerrit-trigger-plugin with the latest Java and OS that I use for other work.

Here's what I do:

1. cd gerrit-trigger-plugin
2. mvn install


results in =>

-------------------------------------------------------------------------------
Test set: com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTest
-------------------------------------------------------------------------------
Tests run: 38, Failures: 0, Errors: 9, Skipped: 0, Time elapsed: 3.93 sec <<< FAILURE! - in com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTest
testRetriggerThisBuild(com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTest)  Time elapsed: 0.029 sec  <<< ERROR!
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.acegisecurity.Authentication$$EnhancerByMockitoWithCGLIB$$41aef083.implies(Ljavax/security/auth/Subject;)Z" the class loader (instance of org/powermock/core/classloader/MockClassLoader) of the current class, org/acegisecurity/Authentication$$EnhancerByMockitoWithCGLIB$$41aef083, and the class loader (instance of <bootloader>) for interface java/security/Principal have different Class objects for the type javax/security/auth/Subject used in the signature
	at sun.reflect.GeneratedSerializationConstructorAccessor15.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:56)
	at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
	at org.mockito.internal.creation.jmock.ClassImposterizer.createProxy(ClassImposterizer.java:128)
	at org.mockito.internal.creation.jmock.ClassImposterizer.imposterise(ClassImposterizer.java:63)
	at org.powermock.api.mockito.internal.mockcreation.MockCreator.createMethodInvocationControl(MockCreator.java:111)
	at org.powermock.api.mockito.internal.mockcreation.MockCreator.mock(MockCreator.java:60)
	at org.powermock.api.mockito.PowerMockito.mock(PowerMockito.java:143)
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTest.mockConfig(GerritTriggerTest.java:1626)
	at com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerTest.testRetriggerThisBuild(GerritTriggerTest.java:834)




$ uname -a
Linux rider 3.13.0-51-generic #84-Ubuntu SMP Wed Apr 15 12:08:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ mvn --version
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-51-generic", arch: "amd64", family: "unix"




Robert Sandell

unread,
May 18, 2015, 5:18:16 AM5/18/15
to jenkin...@googlegroups.com
The PowerMock version used by the tests doesn't work on Java 8. Should work on Java 7

--
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 jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/9f1ed53a-82be-4e97-861f-6fce6b3efe6c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

Øyvind Harboe

unread,
May 18, 2015, 5:26:06 AM5/18/15
to jenkin...@googlegroups.com
Ah. I see.... Is there a fundamental reason why we have to use
Powermock or would there be interest in a patch that removed that
dependency replacing it with some sort of alternative?

After googling, it seems like waiting for Powermock to support Java
1.8 before depending on it isn't entirely a bad thing.

Unless I misunderstand, Powermock is only used in one of the tests(at
least in a fashion that fails).
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-dev/n5sdCxrccSk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS0Yt%3DDbRXbjyobPzQ%3DtsuJtbfkNWro_AozgrK%3DCKukpkQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Øyvind Harboe - Can Zylin Consulting help on your project?
http://www.zylin.com/

Robert Sandell

unread,
May 18, 2015, 5:36:51 AM5/18/15
to jenkin...@googlegroups.com
PowerMock is used quite extensively for static and final mocking of the core classes, so replacing it would be a big risk.

The plugin is also depending on the plugin parent that's not supporting java 8 fully iirc.
So I think it's simpler to stick with Java 7 for now.

/B


For more options, visit https://groups.google.com/d/optout.

Øyvind Harboe

unread,
May 18, 2015, 6:48:31 AM5/18/15
to jenkin...@googlegroups.com
Gotit.

I'll see if I can create a patch against the readme with some more
detailed instructions on how to build the gerrit-trigger-plugin then.
> https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS2gzfFynsb_pW3kvLkQYRmv%3D949Wd3rJVaU7Sj89tV%3DQg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages