异常:原因:java.lang.noclassdeffounderror:org/osgi/framework/bund



log4j:2.6.1,weblogic:10.3.6 jdk:1.7.x

我在使用log4j jars 2.6.1中的weblogic域lib文件夹中使用的错误:

<Jun 25, 2016 7:36:49 AM EDT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
    java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator

将下面的插件添加到pom.xml解决我的问题。基本上,如果您想将jar放在jar本身中依赖的weblogic捆绑包中。

<plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                  <execution>
                    <phase>package</phase>
                    <goals>
                      <goal>single</goal>
                    </goals>
                  </execution>
                </executions>
                <configuration>
                  <descriptorRefs>
                    <descriptorRef>jar-with-dependencies</descriptorRef>
                  </descriptorRefs>
                </configuration>
          </plugin>

最新更新