tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Wagner <alexander.wag...@inside-m2m.de>
Subject Re: tomee, jax-rs and logback
Date Tue, 21 Jan 2014 09:49:27 GMT
Hi hwaastad,

for 1.5.2 this worked for a test environment in one of my projects:

some sources ahead:
*
http://hwellmann.blogspot.de/2012/11/logging-with-slf4j-and-logback-in.html
* http://tomee.apache.org/tomee-logging-in-eclipse.html
*
http://rmannibucau.wordpress.com/2012/07/18/openejb-tomee-and-log-framework/

Copy the Logback and SLF4J Jars into the 'bin' directory and delete the
SLF4J Jars from the lib directory. Create a 'lockback.xml' in e.g.
'logback-config/logback.xml' and put it to the classpath:

* Classpath

bin/setenv.sh
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/jul-to-slf4j-1.7.5.jar
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/slf4j-api-1.7.2.jar
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/logback-classic-1.0.12.jar
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/logback-core-1.0.12.jar
CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/logback-config/

** 'bin/setenv.sh' have to be executable 'chmod +x /bin/setenv.sh' **

* System Properties:
'conf/system.properties'
openejb.log.factory = slf4j


* Classpath (Eclipse)
For Eclipse you have to put the Jars also in the classpath and add some
properties:

* System Properties (Eclipse)
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dopenejb.log.factory=slf4j

In the end I do not use it cause in my Tomee instances the web-apps
define its lockback config by it selfs. So I never used this
configuration in a productive environment.

Best Regards
Alexander

Am 21.01.2014 08:51, schrieb hwaastad:
> Hi,
> I'm testing logback implementation in TomEE 1.6.0
> 
> Current config:
> 
> catalina_home/lib/logback.xml
> 
> tomee-maven-plugin:
> <lib>org.slf4j:jul-to-slf4j:1.7.5</lib>
> <lib>ch.qos.logback:logback-core:1.0.13</lib>
> <lib>ch.qos.logback:logback-classic:1.0.13</lib>
> <lib>ch.qos.logback:logback-access:1.0.13</lib>
> <lib>remove:slf4j-jdk14</lib>
> 
> I have a supersimple rest-on-ejb.
> 
> When running:
> 
> ---
> SEVERE: error invoking
> Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}
> java.lang.UnsupportedOperationException
> 	at
> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)
> 	at
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)
> 	at
> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)
> 	at
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)
> 	at
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:606)
> 	at
> org.apache.openejb.observer.ObserverManager$Observer.invoke(ObserverManager.java:149)
> 	at
> org.apache.openejb.observer.ObserverManager.fireEvent(ObserverManager.java:69)
> 	at
> org.apache.openejb.loader.SystemInstance.fireEvent(SystemInstance.java:108)
> 	at
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStart(TomcatWebAppBuilder.java:1600)
> 	at
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:113)
> 	at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
> 	at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> 	at
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:168)
> 	at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
> 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
> 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
> 	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983)
> 	at
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> 	at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:724)
> ---
> 
> I've tested different setup for logback in tomee, but never really found a
> good way....
> 
> br hw
> 
> 
> 
> --
> View this message in context: http://openejb.979440.n4.nabble.com/tomee-jax-rs-and-logback-tp4667241.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
> 



Mime
View raw message