You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
In our Apache Felix Logback based OSGI Environment we get the following error when using an expression in an EvaluatorFilter:
Could not start evaluator with expression [mdc != null && "true".equals(mdc.get("enableLogHttpTraffic"))] org.codehaus.commons.compiler.CompileException: Line 1, Column 7: A class 'ch.qos.logback.classic.Level' could not be found
We tested this and it fixes the problem, but then a new but similar error appeared
Could not start evaluator with expression [mdc != null && "true".equals(mdc.get("enableLogHttp"))] org.codehaus.janino.JaninoRuntimeException: Cannot load class 'org.slf4j.Marker' through the parent loader
at org.codehaus.janino.JaninoRuntimeException: Cannot load class 'org.slf4j.Marker' through the parent loader
at at org.codehaus.janino.SimpleCompiler$1.getDelegate(SimpleCompiler.java:325)
at at org.codehaus.janino.SimpleCompiler$1.accept(SimpleCompiler.java:301)
at at org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:5660)
This could be fixed by adding
Import-Package: org.slf4j
to MANIFEST.MF
Summary
Maybe it should be fixed together with #22 which asks to replace the Require-Bundle with DynamicImport-Package
I tested this as well and it works and fixes also my problem when MANIFEST.MF is modified like this:
The text was updated successfully, but these errors were encountered:
chrisrueger
changed the title
logback-janino-fragment is missing : A class 'ch.qos.logback.classic.Level' could not be found (because logback-janino-fragment is not importing logback.classic but just logback.core)
logback-janino-fragment is missing imports for ch.qos.logback.classic and slf4j
Nov 8, 2019
chrisrueger
added a commit
to chrisrueger/logback-contrib
that referenced
this issue
Feb 2, 2020
* replaced Require-Bundle with DynamicImport-Package
* to allow janino-fragment see classes in ch.qos.logback.classic (instead of just ch.qos.logback.core): e.g. ch.qos.logback.classic.Level
* also added org.slf4j which is also required to be visible and is currently missing
* needed in OSGI environments
* see qos-ch#28 for details
* this also fixes the change request in qos-ch#22
In our Apache Felix Logback based OSGI Environment we get the following error when using an expression in an EvaluatorFilter:
Could not start evaluator with expression [mdc != null && "true".equals(mdc.get("enableLogHttpTraffic"))] org.codehaus.commons.compiler.CompileException: Line 1, Column 7: A class 'ch.qos.logback.classic.Level' could not be found
Our appender:
Reason
We found out that janino-fragment only does a
Require-Bundle: ch.qos.logback.core
in MANIFEST.MF
So it cannot see the class ch.qos.logback.classic.Level which lives in ch.qos.logback.classic
The easiest thing would be to extend:
We tested this and it fixes the problem, but then a new but similar error appeared
This could be fixed by adding
Import-Package: org.slf4j
to MANIFEST.MF
Summary
Maybe it should be fixed together with #22 which asks to replace the
Require-Bundle
withDynamicImport-Package
I tested this as well and it works and fixes also my problem when MANIFEST.MF is modified like this:
Modify MANIFEST.MF like this:
remove
and add
The text was updated successfully, but these errors were encountered: