我正在查看教程http://arquillian.org/guides/getting_started/。一切运行良好。但是,如果我尝试使用 log4j.xml(放置在 src/main/resources 中)从 Log4J 添加 Logger,则只有嵌入式容器焊接,glassfish 使用控制台日志附加程序运行良好。在控制台上,我收到了消息:
2012-04-23T15:27:21,859 INFO call greet (ejbtest.Greeter)
远程 jboss 失败。我的部署:
@Deployment
public static JavaArchive createDeployment()
{
final JavaArchive deployment = ShrinkWrap.create(JavaArchive.class)
.addClasses(Greeter.class, PhraseBuilder.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource("log4j.xml");
return deployment;
}
堆栈跟踪片段:
15:33:11,375 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC0000
1: Failed to start service jboss.deployment.unit."a680b2b8-2dd6-4b0b-bc87-9082f2
4fc88d.jar".WeldService: org.jboss.msc.service.StartException in service jboss.d
eployment.unit."a680b2b8-2dd6-4b0b-bc87-9082f24fc88d.jar".WeldService: org.jboss
.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for t
ype [Greeter] with qualifiers [@Default] at injection point [[field]
我还尝试将 Logger.class 添加到 JavaArchive,但这也因以下堆栈跟踪片段而失败:
15:36:50,031 WARN [org.jboss.modules] (MSC service thread 1-3) Failed to define
class org.apache.log4j.Logger in Module "deployment.eb8033fe-29d7-4fa5-986f-303
4a1949020.jar:main" from Service Module Loader: java.lang.LinkageError: Failed t
o link org/apache/log4j/Logger (Module "deployment.eb8033fe-29d7-4fa5-986f-3034a
1949020.jar:main" from Service Module Loader)
我的错误是什么?