问题描述
我正在尝试建立一个使用arquillian进行某种集成测试的项目。我已经完成了一些教程,但无法让我的测试运行。
我得到的例外是:
I'm trying to set up a project that uses arquillian to do some kind of integration testing. I already went through some tutorials but can't get my test running.The exception I get is:
Cannot not load JBoss LogManager. The LogManager has likely been accessed prior to this initialization.
Jul 14, 2015 10:30:37 AM org.jboss.msc.service.ServiceContainerImpl <clinit>
INFO: JBoss MSC version 1.2.2.Final
Jul 14, 2015 10:30:37 AM org.jboss.as.server.ApplicationServerService start
INFO: JBAS015899: WildFly 8.2.0.Final "Tweek" starting
Jul 14, 2015 10:30:38 AM org.jboss.as.controller.AbstractOperationContext executeStep
ERROR: JBAS014612: Operation ("parallel-extension-add") failed - address: ([])
java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:111)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:660)
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:501)
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:298)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:293)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:324)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:297)
at org.jboss.as.server.ServerService.boot(ServerService.java:356)
at org.jboss.as.server.ServerService.boot(ServerService.java:331)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:259)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:103)
... 10 more
Caused by: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:122)
at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:98)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:139)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:125)
at java.util.concurrent.FutureTask.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)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Jul 14, 2015 10:30:38 AM org.jboss.as.server.ServerService boot
FATAL: JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
我的pom.xml如下所示:
my pom.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.arquillian.examples</groupId>
<artifactId>arquillian-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>arquillian-tutorial</name>
<url>http://arquillian.org/guides/getting_started/</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
</plugin>
</plugins>
</build>
<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>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>arquillian-wildfy82-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>8.2.0.Final</version>
<type>zip</type>
<overWrite>false</overWrite>
<outputDirectory>target</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<!--forkMode>once</forkMode-->
<forkCount>1</forkCount>
<systemPropertyVariables>
<jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
<module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
<arquillian.launch>arquillian-wildfly-embedded</arquillian.launch>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<argLine>-Xmx512m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Djboss.socket.binding.port-offset=100</argLine>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId>
<version>8.2.0.Final</version>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-embedded</artifactId>
<version>8.2.0.Final</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
这是我的arquillian.xml:
and this is my arquillian.xml:
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="wildfly-embedded" default="true">
<configuration>
<property name="jbossHome">target/wildfly-8.2.0.Final</property>
<property name="modulePath">target/wildfly-8.2.0.Final/modules</property>
</configuration>
</container>
</arquillian>
推荐答案
出于某种原因,maven to eclipse设置不是完全正常工作:在eclipse中:转到你要运行的单元测试的JVM设置,
For some reason, the maven to eclipse settings are not completely working: in eclipse: go to JVM settings of the unit test(s) you want to run,
并添加以下行在VM参数部分
and add the below line in VM arguments section
-Djava.util.logging.manager = org.jboss.logmanager.LogManager
这篇关于Arquillian wildfly8.2嵌入式:JBAS014670:初始化模块失败org.jboss.as.logging的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!