tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann BLAZART <yann.blaz...@externe.bnpparibas.com>
Subject TomEE embedded classloader behhaviours
Date Thu, 03 Sep 2015 17:05:00 GMT
Hello all.

Now I'm trying to deliver my application as micro servers using tomee embedded.
My problem come from log4j2 configs.

I've made an "extension" of tome-embedded to add inside the log4j2 jars, one log4j2.xml and
some parameters in the Main (baseport for exemple).
This is repackaged in one uber jar.

Now in my war I have the log4j2.xml for the app.
In the war, I've added one piece of code to see where the config is readed from :

LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Configuration config = ctx.getConfiguration();

System.out.println("-------------   LOG "+config.getConfigurationSource().getLocation());



When I launch the war with the tome-embedded-maven plugin, everything goes well :
<plugin>
    <groupId>org.apache.tomee.maven</groupId>
    <artifactId>tomee-embedded-maven-plugin</artifactId>
    <configuration>
        <context>/fmi</context>
        <classpathAsWar>false</classpathAsWar>
        <!--<httpPort>${tomee.dev.http.port}</httpPort>-->
        <containerProperties>
            <fmi.log.level>INFO</fmi.log.level>
            <fmi.log.appender>Console</fmi.log.appender>
        </containerProperties>
    </configuration>
</plugin>

The printed message is  LOG C:\....\xxxx-webapp\target\xxxx-webapp-2.0.0-SNAPSHOT\WEB-INF\classes\log4j2.xml

When I launch my app from commande line :
java -jar target\my-server-2.0.0-SNAPSHOT-uber.jar --baseport=28000 --path=target\xxx-webapp-2.0.0-SNAPSHOT.war
--context=/fmi --directory=target\ workdir

The printed message is  LOG jar:file:/C:/xxx-webapp/target/my-server-2.0.0-SNAPSHOT-uber.jar!/log4j2.xml

Could you help ?



This message and any attachments (the "message") is
intended solely for the intended addressees and is confidential. 
If you receive this message in error,or are not the intended recipient(s), 
please delete it and any copies from your systems and immediately notify
the sender. Any unauthorized view, use that does not comply with its purpose, 
dissemination or disclosure, either whole or partial, is prohibited. Since the internet 
cannot guarantee the integrity of this message which may not be reliable, BNP PARIBAS 
(and its subsidiaries) shall not be liable for the message if modified, changed or falsified.

Do not print this message unless it is necessary,consider the environment.

----------------------------------------------------------------------------------------------------------------------------------

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont etablis a l'intention exclusive de ses destinataires et sont confidentiels.
Si vous recevez ce message par erreur ou s'il ne vous est pas destine,
merci de le detruire ainsi que toute copie de votre systeme et d'en avertir
immediatement l'expediteur. Toute lecture non autorisee, toute utilisation de 
ce message qui n'est pas conforme a sa destination, toute diffusion ou toute 
publication, totale ou partielle, est interdite. L'Internet ne permettant pas d'assurer
l'integrite de ce message electronique susceptible d'alteration, BNP Paribas 
(et ses filiales) decline(nt) toute responsabilite au titre de ce message dans l'hypothese
ou il aurait ete modifie, deforme ou falsifie. 
N'imprimez ce message que si necessaire, pensez a l'environnement.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message