1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to configure JBOSS 5.1.0 GA ClassLoader

Discussão em 'StackOverflow' iniciado por Stack, Janeiro 13, 2021.

  1. Stack

    Stack Membro Participativo

    I am running into some issues with trying to load libs from my application instead of what comes with JBoss.

    I am trying to make use of the latest and greatest SLF4J in my application and in doing so I am getting the following messages:

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [vfszip:/C:/devtools/workspace/g2/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Runtime_Server1302541739184/deploy/ecotrakEar.ear/ecotrak.war/WEB-INF/lib/slf4j-log4j12-1.6.1.jar/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [vfszip:/C:/devtools/jboss-5.1.0.GA/common/lib/slf4j-jboss-logging.jar/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.


    In my application I have the following jars located in my WAR lib directory:

    • jul-to-slf4j-1.6.1.jar
    • slf4j-api-1.6.1.jar
    • slf4j-log4j12-1.6.1.jar

    My project is deployed as an EAR with a WAR. All libraries reside in the WAR.

    Based on some research it has been suggested that for JBoss 5.1 that a jboss-classloading.xml file be created. I have created one for my EAR:

    <classloading xmlns="urn:jboss:classloading:1.0"
    name="ecotrak.ear"
    domain="ecotrak.ear"
    export-all="NON_EMPTY"
    import-all="true"
    parent-first="false">
    </classloading>


    This identifies that the EAR file is to be loaded first.

    I have also created one for my WAR:

    <classloading xmlns="urn:jboss:classloading:1.0"
    name="ecotrak.war"
    domain="ecotrak.war"
    parent-domain="ecotrak.ear"
    top-level-classloader="true"
    export-all="NON_EMPTY"
    import-all="true"
    parent-first="true">
    </classloading>


    With this configuration I am getting the following error in the startup logs:

    11:18:07,949 ERROR [[/ecotrak]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
    at org.apache.commons.logging.impl.SLF4JLocationAwareLog.trace(SLF4JLocationAwareLog.java:107)


    What is the correct way in order to have jars from my project be loaded before JBoss's?

    Continue reading...

Compartilhe esta Página