0

I'm checking out the tutorial http://arquillian.org/guides/getting_started/. Everything runs fine. But if I try to add Logger from Log4J with a log4j.xml (placed in src/main/resources) only the embedded containers weld and glassfish runs fine with console log-appender. On the console I got my message:

2012-04-23T15:27:21,859 INFO  call greet (ejbtest.Greeter)

The remote jboss fails. My deployment:

  @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;
  }

The stacktrace-snippet:

    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] 

I also tried with adding Logger.class to the JavaArchive, but that also fails with the following stacktrace-snippet:

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)

What is my mistake?

Michael K.
  • 1,738
  • 2
  • 17
  • 35

1 Answers1

0

JBoss has it's onw built in log4j. I guess you have conflict.

alexsmail
  • 5,661
  • 7
  • 37
  • 57
  • That's right, but there should be a workaround as described here: http://stackoverflow.com/questions/9584787/using-log4j-with-jboss-7-1. But that also doesn't works for me. I always get an instance of org.jboss.logmanager.log4j.BridgeLogger. – Michael K. Oct 25 '12 at 14:57