Cargo fails to stop Tomcat with slf4j jul bridge

View: New views
1 Messages — Rating Filter:   Alert me  

Cargo fails to stop Tomcat with slf4j jul bridge

by snicoll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am using the cargo maven plugin to run integration tests against a webapp. We recently switched this webapp from commons-logging to slf4j.

Slf4j allows to redirect the JDK logging to anything, say log4j. Since we activated the bridge we have this:

Results :

Tests run: 235, Failures: 0, Errors: 0, Skipped: 0

[INFO] [cargo:stop {execution: stop}]
[INFO] [talledLocalContainer] Tomcat 5.5.25 is stopping...
[INFO] [talledLocalContainer] java.lang.reflect.InvocationTargetException
[INFO] [talledLocalContainer] java.lang.reflect.InvocationTargetException
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:585)
[INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:585)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
[INFO] [talledLocalContainer] Caused by: java.lang.IllegalStateException: Logging factory implementation cannot be null. See also http://www
.slf4j.org/codes.html#null_LF
[INFO] [talledLocalContainer] Caused by: java.lang.IllegalStateException: Logging factory implementation cannot be null. See also http://www
.slf4j.org/codes.html#null_LF
[INFO] [talledLocalContainer]   at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:86)
[INFO] [talledLocalContainer]   at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:86)
[INFO] [talledLocalContainer]   at org.slf4j.bridge.SLF4JBridgeHandler.getSLF4JLogger(SLF4JBridgeHandler.java:143)
[INFO] [talledLocalContainer]   at org.slf4j.bridge.SLF4JBridgeHandler.getSLF4JLogger(SLF4JBridgeHandler.java:143)
[INFO] [talledLocalContainer]   at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:198)
[INFO] [talledLocalContainer]   at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:198)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.log(Logger.java:452)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.log(Logger.java:452)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.doLog(Logger.java:474)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.doLog(Logger.java:474)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.logp(Logger.java:674)
[INFO] [talledLocalContainer]   at java.util.logging.Logger.logp(Logger.java:674)
[INFO] [talledLocalContainer]   at org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java:93)
[INFO] [talledLocalContainer]   at org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java:93)
[INFO] [talledLocalContainer]   at org.apache.commons.logging.impl.Jdk14Logger.error(Jdk14Logger.java:127)
[INFO] [talledLocalContainer]   at org.apache.commons.logging.impl.Jdk14Logger.error(Jdk14Logger.java:127)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Catalina.stop(Catalina.java:604)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Catalina.stop(Catalina.java:604)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
[INFO] [talledLocalContainer]   ... 6 more
[INFO] [talledLocalContainer]   ... 6 more


This allows only if we had this simple call when we initialize the webapp:

SLF4JBridgeHandler.install();

If we don't call this (i.e. if we don't redirect the JDK logging to SLF4J) tomcat just stops fine with cargo.

Any idea?
LightInTheBox - Buy quality products at wholesale price!