Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure: org.objenesis.instantiator.basic.ClassDefinitionUtilsTest #49

Closed
apoleon opened this issue Jan 16, 2017 · 6 comments
Closed
Assignees
Milestone

Comments

@apoleon
Copy link

apoleon commented Jan 16, 2017

Hello,

I am trying to build objenesis 2.5 on Debian Unstable but I get the following test failure now while 2.4 was working fine. I am using OpenJDK 8 but this issue is also reproducible with OpenJDK 7 and Oracle Java 8. However the test works fine on Windows 7 with Java 8. Someone else confirmed to me that he sometimes experiences a different error in the same class. Relevant output below:


T E S T S

Running org.objenesis.ObjenesisTest
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.119
sec - in org.objenesis.ObjenesisTest
Running org.objenesis.instantiator.sun.MagicInstantiatorTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012
sec - in org.objenesis.instantiator.sun.MagicInstantiatorTest
Running org.objenesis.instantiator.basic.ClassDefinitionUtilsTest
Tests run: 5, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.047
sec <<< FAILURE! - in
org.objenesis.instantiator.basic.ClassDefinitionUtilsTest
testDefineClass(org.objenesis.instantiator.basic.ClassDefinitionUtilsTest)
Time elapsed: 0.034 sec <<< ERROR!
java.lang.reflect.InvocationTargetException: null
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.objenesis.instantiator.basic.ClassDefinitionUtils.defineClass(ClassDefinitionUtils.java:135)
at
org.objenesis.instantiator.basic.ClassDefinitionUtilsTest.testDefineClass(ClassDefinitionUtilsTest.java:32)

Running org.objenesis.instantiator.basic.ProxyingInstantiatorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0 sec -
in org.objenesis.instantiator.basic.ProxyingInstantiatorTest
Running org.objenesis.ExternalizableTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005
sec - in org.objenesis.ExternalizableTest
Running org.objenesis.strategy.PlatformDescriptionTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003
sec - in org.objenesis.strategy.PlatformDescriptionTest
Running org.objenesis.SerializingInstantiatorTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.009
sec - in org.objenesis.SerializingInstantiatorTest
Running org.objenesis.ObjenesisExceptionTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007
sec - in org.objenesis.ObjenesisExceptionTest

Results :

Tests in error:
ClassDefinitionUtilsTest.testDefineClass:32 ?? InvocationTarget

Second test failure:

testDefineClass(org.objenesis.instantiator.basic.ClassDefinitionUtilsTest)
Time elapsed: 0.005 sec <<< ERROR!
java.lang.reflect.InvocationTargetException
at
org.objenesis.instantiator.basic.ClassDefinitionUtilsTest.testDefineClass(ClassDefinitionUtilsTest.java:32)
Caused by: java.lang.LinkageError: loader (instance of
sun/misc/Launcher$AppClassLoader): attempted duplicate class definition
for name: "org/objenesis/EmptyClass"
at
org.objenesis.instantiator.basic.ClassDefinitionUtilsTest.testDefineClass(ClassDefinitionUtilsTest.java:32)

@henri-tremblay henri-tremblay self-assigned this Jan 17, 2017
@henri-tremblay
Copy link
Contributor

Indeed. I can reproduce. Let me investigate.

@henri-tremblay
Copy link
Contributor

It seems to be an obscure JDK bug. I've workaround it. Do you need a new release?

@apoleon
Copy link
Author

apoleon commented Jan 17, 2017

Hey, thank you very much for your quick response. I wouldn't mind if you made a new release. If this is a burden for you, I could also apply your patch because Debian is approaching the "freeze" very quickly. After next week I won't be able to package a newer release of Objenesis for the next stable release aka Stretch. I could either wait for your next release until then or apply the patch to get the latest release of Objenesis into Debian Stretch. Of course 2.4 is working fine at the moment, so there is no compelling reason for an update at the moment. But if you rather want to see 2.5 in Debian stable, please let me know.

@henri-tremblay
Copy link
Contributor

henri-tremblay commented Jan 17, 2017 via email

@henri-tremblay henri-tremblay added this to the 2.5.1 milestone Jan 18, 2017
@henri-tremblay
Copy link
Contributor

Objenesis 2.5.1 has been delivered.

@apoleon
Copy link
Author

apoleon commented Jan 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants