Skip to content

LinkageError #28

@XenoGearX

Description

@XenoGearX

Hello,

we are currently trying to implement integration tests for liferay with Arquillian-Liferay(https://github.com/liferay-labs/arquillian-liferay) and have the following issue:
zeppelin.liferay.integration.test.LiferayServiceTest > testRole STANDARD_ERROR
May 27, 2020 8:08:36 AM org.jboss.arquillian.protocol.jmx.JMXMethodExecutor invoke
SEVERE: Failed: zeppelin.liferay.integration.test.LiferayServiceTest.testRole
java.lang.LinkageError: loader constraint violation: when resolving method "org.junit.runner.JUnitCore.addListener(Lorg/junit/runner/notification/RunListener;)V" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/jboss/arquillian/junit/container/JUnitTestRunner, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, org/junit/runner/JUnitCore, have different Class objects for the type org/junit/runner/notification/RunListener used in the signature
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:56)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.doRunTestMethod(JMXTestRunner.java:180)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethodInternal(JMXTestRunner.java:162)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:120)
at org.jboss.arquillian.osgi.ArquillianBundleActivator$2.runTestMethod(ArquillianBundleActivator.java:88)
at org.jboss.arquillian.protocol.jmx.JMXTestRunner.runTestMethod(JMXTestRunner.java:137)
at org.jboss.arquillian.osgi.ArquillianBundleActivator$2.runTestMethod(ArquillianBundleActivator.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown Source)
at com.sun.jmx.mbeanserver.PerInterface.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(Unknown Source)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

In the attachement you can find the example Project.
Example Project Requirements:
Gradle 6.2.1 (or use the gradle wrapper in the project)
Java 8 JDK and JAVA_HOME set correctly (alternatively use gradle.properties to set the correct jdk as explained in issues below)
Minimum of 3GB RAM (2GB for Liferay Server and 1GB for gradle daemon)

Steps to reproduce:
In the project folder run the testIntegration gradle task, example "gradlew testIntegration"

What does the test do?
It is a simple test which tries to get all Liferay UserIDs for the Administrator Role

Possible issues during execution:
• downloadLiferay task can’t download from sourceforge.net – either fix the network so that the liferay distribution can be downloaded or download it manually from https://liquidtelecom.dl.sourceforge.net/project/lportal/Liferay%20Portal/7.1.2%20GA3/liferay-ce-portal-tomcat-7.1.2-ga3-20190107144105508.7z and extract the contents into the "PROJECT_ROOT/liferay" folder
• gradle uses wrong java version – edit the gradle.properties file in the project and set the "org.gradle.java.home" property

Possible cause (speculation):
The com.liferay.arquillian.arquillian-container-liferay project version 1.0.10 uses com.liferay.hot.deploy.jmx.listener version 2.0.0-SNAPSHOT per default, this Snapshot version couldn’t be found and 2.0.0 is not released yet. We forced the usage of the latest released version 1.0.1 with
testIntegrationCompile ("com.liferay:com.liferay.hot.deploy.jmx.listener") {
version {
strictly "1.0.1"
}
}
If this is the cause, when will version 2.0.0 be released?

Regards,
Safet
zeppelin-liferay-integration-test.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions