Pax日志记录服务——激活器启动错误

时间:2021-07-17 20:28:39

I am trying to use pax logging in a freshly installed Apache Felix container. The following bundles are installed:

我正在尝试在新安装的Apache Felix容器中使用pax登录。安装了以下bundle:

    lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (5.0.0)
    1|Active     |    1|Apache Felix Bundle Repository (2.0.4)
    2|Active     |    1|Apache Felix Gogo Command (0.14.0)
    3|Active     |    1|Apache Felix Gogo Runtime (0.16.2)
    4|Active     |    1|Apache Felix Gogo Shell (0.10.0)
    6|Active     |    1|Apache Felix Declarative Services (1.6.0)
    7|Active     |    1|Apache Felix Web Management Console (3.1.2)
    8|Installed  |    1|Apache Felix Configuration Admin Service (1.2.4)
    9|Resolved   |    1|OSGi R4 Compendium Bundle (4.0.0)
   10|Resolved   |    1|Apache Felix Http Bundle (2.0.4)
   11|Installed  |    1|Apache Felix iPOJO WebConsole Plugins (1.6.0)
   12|Installed  |    1|Apache Felix iPOJO (1.8.0)
   13|Active     |    1|HTTP Service (1.0.1)
   14|Installed  |    1|Apache Felix Log Service (1.0.0)
   15|Resolved   |    1|Apache Felix Shell Service (1.4.2)
   26|Active     |    1|db_bundle (0.0.1.SNAPSHOT)
   33|Active     |    1|Loader (0.0.1.SNAPSHOT)
   39|Resolved   |    1|OPS4J Pax Logging - Service (1.8.3)
   40|Active     |    1|OPS4J Pax Logging - API (1.8.3)
   42|Resolved   |    1|OPS4J Pax Logging - Log4j v2 (1.8.3)

Trying to start bundle 39 (Pax Logging - Service) results in:

尝试启动39包(Pax日志记录-服务)的结果是:

g! felix:start 39
org.osgi.framework.BundleException: Activator start error in bundle org.ops4j.pax.logging.pax-logging-service [39].
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2270)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2138)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:977)
    at org.apache.felix.gogo.command.Basic.start(Basic.java:729)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.apache.felix.gogo.shell.Console.run(Console.java:62)
    at org.apache.felix.gogo.shell.Shell.console(Shell.java:203)
    at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:128)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:137)
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
    at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/ops4j/pax/logging/EventAdminPoster
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.newInstance(Class.java:412)
    at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4453)
    at org.apache.felix.framework.Felix.activateBundle(Felix.java:2215)
    ... 32 more
Caused by: java.lang.ClassNotFoundException: org.ops4j.pax.logging.EventAdminPoster not found by org.ops4j.pax.logging.pax-logging-api [29]
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1399)
    at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1579)
    at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1509)
    at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
    at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 38 more
java.lang.NoClassDefFoundError: org/ops4j/pax/logging/EventAdminPoster

I manually checked the Pax Logging API bundle (pax-logging-api-1.8.3.jar) - the file org/ops4j/pax/logging/EventAdminPoster.class is included. I also checked the Manifest.mf in the API bundle (pax-logging-api-1.8.3.jar). The "Export-Package" section starts with Export-Package:

我手动检查了Pax日志API包(Pax - Logging - API -1.8.3.jar)——文件org/ops4j/pax/logging/EventAdminPoster。类是包括在内。我还查看了舱单。API包中的mf (pax-logging-api-1.8.3.jar)。“出口包装”一节从出口包装开始:

org.apache.avalon.framework.logger;uses:="org.apache.log ";version="4.3";provider=paxlogging,org.apache.commons.logging;uses:="o rg.osgi.framework,org.ops4j.pax.logging";version="1.1.1";provider=paxlo gging...

org.apache.avalon.framework.logger;用途:=“org.apache.log”;version = " 4.3 ";提供者= paxlogging org.apache.commons.logging;用途:= " o rg.osgi.framework org.ops4j.pax.logging;version =“1.1.1”;提供者= paxlo gg……

So, I have no clue why the starting of the Pax Logging Service bundle throws a ClassNotFoundException. What am I missing?

因此,我不知道为什么Pax日志服务包的启动会抛出ClassNotFoundException。我缺少什么?

Note: Bundle 26 and 33 are some testing bundles in which I'm trying to use log4j through pax logging.

注意:Bundle 26和33是一些测试包,我试图通过pax日志记录使用log4j。

1 个解决方案

#1


0  

After restarting felix the issue is solved. Starting the Pax Logging Service bundle now works.

重新启动felix后,问题解决了。启动Pax日志服务包现在可以工作了。

#1


0  

After restarting felix the issue is solved. Starting the Pax Logging Service bundle now works.

重新启动felix后,问题解决了。启动Pax日志服务包现在可以工作了。