Community
Participate
Working Groups
Build Identifier: 2.1.0.RELEASE I can't seem to add a Logback filter to my config/serviceability.xml. The error at startup is java.lang.ClassNotFoundException: org.codehaus.janino.ExpressionEvaluator It appears that most of the logback filter functionality relies on Janino (http://docs.codehaus.org/display/JANINO/Home). I grabbed Janino 2.5.15 from Spring's EBR and added it as a kernel bundle (following the Virgo docs on how to add bundles to the kernel via the launcher.bundles property). Still no dice. Then I tried modifying the manifest for org.eclipse.virgo.medic.core-2.1.0.RELEASE.jar to import the org.codehaus.janino package. No luck. Help? Reproducible: Always Steps to Reproduce: 1. Grab fresh copy of Virgo 2.1.0.RELEASE 2. Add any Logback filter to any appender in config/serviceability.xml. e.g. try a simple "matcher": http://logback.qos.ch/manual/filters.html#matcher 3. Observe stack trace on Virgo startup
Created attachment 186099 [details] stack trace on startup
Created attachment 186101 [details] sample config/serviceability.xml
Created attachment 186102 [details] sample config/serviceability.xml Bugzilla seems to have stripped out all the XML from my first attachment. Trying again...
(In reply to comment #0) > Build Identifier: 2.1.0.RELEASE > > I can't seem to add a Logback filter to my config/serviceability.xml. The error > at startup is > > java.lang.ClassNotFoundException: org.codehaus.janino.ExpressionEvaluator > > It appears that most of the logback filter functionality relies on Janino > (http://docs.codehaus.org/display/JANINO/Home). I grabbed Janino 2.5.15 from > Spring's EBR and added it as a kernel bundle (following the Virgo docs on how > to add bundles to the kernel via the launcher.bundles property). Still no dice. > Then I tried modifying the manifest for > org.eclipse.virgo.medic.core-2.1.0.RELEASE.jar to import the > org.codehaus.janino package. No luck. > > Help? That's what I would have recommended, but by attaching a fragment bundle containing just the new import to medic core. This fragment bundle needs to go in lib/kernel and be installed by being added to the launcher.bundles, without @start, in lib/org.eclipse.virgo.kernel.launch.properties. I would check the wiring by removing the appender configuration temporarily, configuring the Equinox console to start in the kernel, e.g. by running: bin/startup.sh -clean -Fosgi.console=2402 Then you can telnet in to 2402 and examine the wiring of the medic core bundle. If you still get the ClassNotFoundException and the wiring looks right, then check the Janino bundle actually contains that class.
> That's what I would have recommended, but by attaching a fragment bundle > containing just the new import to medic core. This fragment bundle needs to go > in lib/kernel and be installed by being added to the launcher.bundles, without > @start, in lib/org.eclipse.virgo.kernel.launch.properties. We have a winner! These instructions worked great, and is cleaner because it doesn't require modifying the manifest for medic core. Not really sure why this worked over the way I tried yesterday, but it was probably a typo on my part. Thank you! Would be great to have this functionality built in to Virgo. Logback is so powerful that it's a (small) shame not to be able to use all its features in out-of-the-box Virgo. Is this something that would be feasible with the whole Eclipse IP process? Should I open a new ticket for this?
Glad you are sorted. Please do open an enhancement bug to cover your requirement. (I don't see any issue with the Eclipse IP process, however. If necessary we can discuss in the other bug to keep the discussion in one place.)
Feature request filed as bug #333920.
(In reply to comment #7) > Feature request filed as bug #333920. Thanks Eric!
Closing the bug as "works for me" as there is a way of getting it going. Bug 333920 covers any future enhancement.