Struggling with weblogic 12 and arquillian-wls-embedded-12.1
clibois.work Dec 9, 2015 8:10 AMHello there,
I'm a former user of openEJB as ejb testing. I wanted to migrate to arquillian and found there was and adapter that would allow me to directly use weblogic embedded api.
However, if it works quiet easily with openejb, weblogic configuration is a real mess.
Does someone already succeed in using this container adapter ?
Here a quick explanation of what I did and what's my problem.
First, weblogic requires to have a full weblogic installation to provide embedded api(it seems to create a dummy domain).
So I have installed the latest version: Weblogic 12.2.10 which is running on JDK7.
Thank to to weblogic documentation(https://docs.oracle.com/middleware/1213/wls/EJBAD/embedejb.htm#EJBAD1403 )
I have managed to add the weblogic.jar in my classpath and set WL_HOME as env variable.
With this, I have launch my test working which works with openEJB and get the following error:
sun.misc.InvalidJarIndexException: Invalid index at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:939) at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:848) at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:818) at sun.misc.URLClassPath$1.next(URLClassPath.java:226) at sun.misc.URLClassPath$1.hasMoreElements(URLClassPath.java:236) at java.net.URLClassLoader$3$1.run(URLClassLoader.java:583) at java.net.URLClassLoader$3$1.run(URLClassLoader.java:581) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader$3.next(URLClassLoader.java:580) at java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:605) at sun.misc.CompoundEnumeration.next(CompoundEnumeration.java:45) at sun.misc.CompoundEnumeration.hasMoreElements(CompoundEnumeration.java:54) at java.util.Collections.list(Collections.java:3687) at org.jboss.shrinkwrap.impl.base.URLPackageScanner.loadResources(URLPackageScanner.java:182) at org.jboss.shrinkwrap.impl.base.URLPackageScanner.scanPackage(URLPackageScanner.java:116) at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackage(ContainerBase.java:1495) at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackages(ContainerBase.java:1460) at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addPackages(ContainerBase.java:1440) at org.jboss.arquillian.junit.container.JUnitDeploymentAppender.buildArchive(JUnitDeploymentAppender.java:40) at org.jboss.arquillian.container.test.spi.client.deployment.CachedAuxilliaryArchiveAppender.createAuxiliaryArchive(CachedAuxilliaryArchiveAppender.java:43) at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.loadAuxiliaryArchives(DeploymentGenerator.java:209) at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.buildTestableDeployments(DeploymentGenerator.java:160) at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.createTestableDeployments(DeploymentGenerator.java:148) at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67) at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94) at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145) at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116) at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:87) at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:201) at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:422) at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:54) at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:218) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:166) at org.junit.runner.JUnitCore.run(JUnitCore.java:157) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
By digging into the code I have noticed that org.jboss.shrinkwrap.impl.base.URLPackageScanner.loadResources tries to load the following package "org/junit" which seems to fail.
I have tried to use a jdk 6 with an older weblogic version and noticed I didn't had this problem(ok I got another one because it requires jdk 7 at some point...)
I have set in my pom.xml the following dep:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
I have tried other version but arquillian seems to be stuck on 4.8.1
Can anyone helpe me please ?
Best Regards,