Can't use Arquillian with WebSphere 8.5.5
-----------------------------------------
Key: ARQ-2089
URL:
https://issues.jboss.org/browse/ARQ-2089
Project: Arquillian
Issue Type: Feature Request
Components: WebSphere Containers
Environment: WebSphere Application Server Full Profile (WAS), on Windows 10. Java
6 (requirement for WebSphere 8.5.5)
Reporter: nicolas duminil
Assignee: Gerhard Poul
I get the following exception while trying to run arquillian tests on WebSphere 8.5.5:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.562 sec <<<
FAILURE!
be.alphacredit.tests.TestXSDValidationArquillian Time elapsed: 0 sec <<<
ERROR!
java.lang.RuntimeException: Could not create new instance of class
org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:165)
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:102)
at
org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:113)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
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:497)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:161)
... 15 more
Caused by: java.lang.NoClassDefFoundError: Lcom/ibm/websphere/management/AdminClient;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at
org.jboss.arquillian.core.impl.Reflections.getFieldInjectionPoints(Reflections.java:74)
at org.jboss.arquillian.core.impl.ExtensionImpl.of(ExtensionImpl.java:53)
at org.jboss.arquillian.core.impl.ManagerImpl.inject(ManagerImpl.java:211)
at org.jboss.arquillian.core.impl.InjectorImpl.inject(InjectorImpl.java:58)
at
org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.createServiceInstance(ServiceRegistryLoader.java:108)
at
org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.all(ServiceRegistryLoader.java:55)
at
org.jboss.arquillian.core.impl.loadable.ServiceRegistryLoader.onlyOne(ServiceRegistryLoader.java:67)
at
org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:80)
at
org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:78)
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:497)
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.ManagerImpl.bindAndFire(ManagerImpl.java:265)
at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)
at
org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:73)
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:497)
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.ManagerImpl.start(ManagerImpl.java:290)
at
org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:63)
... 20 more
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.management.AdminClient
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 55 more
Here is the relevant part of my POM:
<dependencies>
<dependency>
<groupId>com.ibm.websphere.j2ee</groupId>
<artifactId>j2ee</artifactId>
<scope>provided</scope>
</dependency>
...............
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-was-remote-8.5</artifactId>
<scope>test</scope>
</dependency>
Here is the arquillian.xml file:
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
<arquillian
xmlns="http://www.jboss.org/arquillian-1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/arquillian-1.0
http://jboss.org/schema/arquillian/arquillian-1.0.xsd">
<engine>
<property
name="deploymentExportPath">target/deployments/</property>
</engine>
<container qualifier="websphere" default="true">
<configuration>
<property name="remoteServerAddress">localhost</property>
<property name="remoteServerSoapPort">8880</property>
<property name="securityEnabled">false</property>
<property name="username">nicolas</property>
</configuration>
</container>
</arquillian>
And here is my unit test:
@RunWith(Arquillian.class)
public class TestXSDValidationArquillian
{
private static final Logger slf4jLogger =
LoggerFactory.getLogger(TestXSDValidationArquillian.class);
@Deployment
public static Archive<?> createTestArchive()
{
slf4jLogger.info("Loading pom.xml");
PomEquippedResolveStage mavenResolver =
Maven.resolver().loadPomFromFile("pom.xml");
slf4jLogger.info("pom.xml loaded. Now importing dependencies");
File[] libs =
mavenResolver.importRuntimeAndTestDependencies().resolve().withTransitivity().asFile();
slf4jLogger.info("Dependencies loaded. Creating web archive");
WebArchive war = ShrinkWrap.create(WebArchive.class,
"arquillian-test.war");
slf4jLogger.info("Web archive created. Now, adding files to the archive");
for (File file : libs)
war.addAsLibrary(file);
slf4jLogger.info("Web archive created");
return war;
}
@Test
public void test1(){}
}
What might be the problem here ? Many thanks in advance.
Kind regards,
Nicolas