Arquillian Spring 4 Issues
wlf2kme Apr 15, 2019 9:42 AMWhile looking to test some Spring components and at the same time testing its integration in our JBoss AS 7 server (EAP 6 in production) my eye fell on Arquillian-extension-spring.
I'm trying to get a simple test with autowiring to work, but I seem to be hitting a stone wall.
I've based myself on the github readme.md, which lists Spring 4+ as supported Spring version. I'm unsure this is true.
GitHub - arquillian/arquillian-extension-spring: Arquillian Spring Containers and Enrichers
Arquillian-spring-parent 1.0.0.Beta3 is used because it contains arquillian-service-deployer-spring-3. The next Alpha doesn't seem to include this dependency.
I'm using this latter dependency because otherwise I get the exception below. With it there is no autowiring in my Arquillian test. The autowiring dependencies are all NULL.
org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy to container: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test.war\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test.war\".WeldStartService: Failed to start service Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.jboss.arquillian.spring.integration.test.annotation.SpringConfiguration.contextClass() Caused by: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.jboss.arquillian.spring.integration.test.annotation.SpringConfiguration.contextClass()"}} at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:74)
Seeing that this Arquillian-spring-extension is still in its alpha stage with last commit in 2015 I'm guessing this won't be updated anymore? Any suggestions to get this to work?
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.1.8.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-spring-parent</artifactId>
<version>1.0.0.Beta3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>our-spring4</groupId>
<artifactId>module-to-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-service-integration-spring-inject</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.as</groupId>
<artifactId>jboss-as-arquillian-container-remote</artifactId>
<version>7.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.protocol</groupId>
<artifactId>arquillian-protocol-servlet</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.6.0.GA</version>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>1.0.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>