当前位置: 首页 > 知识库问答 >
问题:

Pax日志服务-激活器启动错误

况明贤
2023-03-14

我试图在新安装的ApacheFelix容器中使用pax日志。已安装以下捆绑包:

    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)

尝试启动bundle 39(Pax Logging-Service)会导致:

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

我手动检查了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.log”;version=“4.3”;provider=paxloging,org。阿帕奇。平民登录中;用法:=“o rg.osgi.framework,org.ops4j.pax.logging”;version=“1.1.1”;provider=paxlo-gging。。。

所以,我不知道为什么Pax日志服务包的启动会抛出一个ClassNotFoundException。我错过了什么?

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

共有1个答案

袁羽
2023-03-14

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

 类似资料:
  • 我刚刚为我们的微服务环境在前端创建了简单的Zuul代理,但现在我想将所有条目记录到通过代理的日志文件中。 做任何我需要做的事情。

  • 我用Netbean 7.1.2下载了glassfish 3.1.2。Glassfish工作了很多次。但是现在它不想开始了。这是我在netbean中的内容: 启动GlassFish服务器3.1.2启动GlassFish服务器3.1.2 C:\Users\أبداود\Documents\NetBeansProjects\HelloWeb\nbproject\build impl。xml:721:部署

  • 我有一个新安装的wampserver2。5-Apache-2.4。9-Mysql-5.6。17-php5。5.12-64位。但当我点击wampserver时,它会变成橙色,无法启动。我检查了我的日志,我所有的apache、php和mysql日志似乎都是空的。浏览internet时,我发现运行以下命令C:\wamp\bin\apache\apache2。4.9\bin 有人能帮我解决这个问题吗?

  • 我们将OSGI KARAF升级到4.1. x版本,默认的pax-loging-api实现已经从log4j1更改为Log4J2。 在前面的log4j1中,我们曾经有一个自定义appender,它扩展了fileappender并从CFG文件中获取配置。我们确实将这个appender编译为片段,并提供片段主机包作为pax日志服务来加载。 现在使用log4J2,创建自定义appender似乎非常不同。我通

  • 使用WebLogic11g,我完成了以下操作: java.lang.ClassCastException:WebLogic.logging.log4j.ServerLoggingAppender不能强制转换为org.apache.log4j.Appender

  • 我有一个队列通道和一个带有轮询器的服务激活器,轮询器从该队列中读取数据。我希望配置为“我希望50个线程轮询该队列,每次轮询并返回消息时,在此线程上调用服务激活器指向的服务。” 该服务没有异步注释,但无状态,可以以并发方式安全运行。 下面的方法能做到吗?有没有其他首选的方法来实现这一点?