I just read classloader in tomcat, so in tomee I suppose. Normally, in the webapp it looks in the war first for resources, after it goes to parents. Isn't it ?
So why it doesn't work like that in my case ? 2015-09-03 21:08 GMT+02:00 Yann Blazart <[email protected]>: > Hmmm. I don't know. > > But for the Uber Jar, what is the class loader policy ? Parent first ? > That's why it get the log4j2.xml from my uber jar ? > > How to override this ? Or I leave TomEE with is own log framework and use > only log4j2 for my apps... > > 2015-09-03 19:21 GMT+02:00 Romain Manni-Bucau <[email protected]>: > >> Hi Yann, >> >> maven plugin deploys the classpath and src/main/webapp as a webapp where a >> uber jar deploys a jar so few differences can happen. What I dont get is >> how it uses target\xxxx-webapp-2.0.0-SNAPSHOT\WEB-INF. I would have >> expected target\classes instead. Can it be a difference on URLClassLoader >> between windows and linux? >> >> >> Romain Manni-Bucau >> @rmannibucau <https://twitter.com/rmannibucau> | Blog >> <http://rmannibucau.wordpress.com> | Github < >> https://github.com/rmannibucau> | >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber >> <http://www.tomitribe.com> >> >> 2015-09-03 19:05 GMT+02:00 Yann BLAZART < >> [email protected] >> >: >> >> > 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. >> > >> > >
