繁体   English   中英

启动包org.eclipse.jetty.osgi.boot时出错(Eclipse中的OSGi Framework)

[英]Error when starting bundle org.eclipse.jetty.osgi.boot (OSGi Framework in Eclipse)

我正在Eclipse中运行OSGi项目。 在将新方法添加到REST通道(应该产生JSON)后,我获得了以下堆栈跟踪,这表明无法启动捆绑包org.eclipse.jetty.osgi.boot。

[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.eclipse.jetty.osgi.boot - BundleEvent STOPPING - org.eclipse.jetty.osgi.boot
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - Starting BlueprintContainer destruction process for bundle org.eclipse.jetty.osgi.boot/9.4.0.v20161208
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - Not a blueprint bundle or destruction of BlueprintContainer already finished for org.eclipse.jetty.osgi.boot/9.4.0.v20161208.
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - Starting BlueprintContainer destruction process for bundle org.eclipse.jetty.osgi.boot/9.4.0.v20161208
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - Not a blueprint bundle or destruction of BlueprintContainer already finished for org.eclipse.jetty.osgi.boot/9.4.0.v20161208.
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.eclipse.jetty.osgi.boot - BundleEvent STOPPED - org.eclipse.jetty.osgi.boot
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.eclipse.persistence.moxy - BundleEvent STARTING - org.eclipse.persistence.moxy
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - Scanning bundle org.eclipse.persistence.moxy/2.6.4.v20160829-44060b6 for blueprint application
[Framework Event Dispatcher: org.eclipse.osgi.internal.framework.EquinoxEventPublisher@7946e1f4] ERROR org.eclipse.jetty.osgi.boot - FrameworkEvent ERROR - org.eclipse.jetty.osgi.boot
org.osgi.framework.BundleException: Exception in org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.start() of bundle org.eclipse.jetty.osgi.boot.
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:795)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:724)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:932)
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
    at org.eclipse.osgi.container.Module.doStart(Module.java:581)
    at org.eclipse.osgi.container.Module.start(Module.java:449)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1620)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1600)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1571)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1514)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.NullPointerException
    at org.eclipse.jetty.osgi.boot.internal.serverfactory.DefaultJettyAtJettyHomeHelper.startJettyAtJettyHome(DefaultJettyAtJettyHomeHelper.java:134)
    at org.eclipse.jetty.osgi.boot.JettyBootstrapActivator.start(JettyBootstrapActivator.java:82)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:774)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:767)
    ... 12 more
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.aries.blueprint.container.BlueprintExtender - No blueprint application found in bundle org.eclipse.persistence.moxy/2.6.4.v20160829-44060b6
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.eclipse.persistence.moxy - BundleEvent STARTED - org.eclipse.persistence.moxy
[Start Level: Equinox Container: 2f378d23-3439-4e9f-98a1-7d4720e478a8] DEBUG org.apache.felix.coordinator - BundleEvent STARTING - org.apache.felix.coordinator

GrepCode使我进入以下代码:

        for (Bundle b : bundleContext.getBundles())
        {
            if (b.getState() == Bundle.UNINSTALLED)
                continue;

            if (b.getSymbolicName().equals(jettyHomeBundleSysProp))
            {
                jettyHomeBundle = b;
                break;
            }
        }

并且看起来b变量将为null。 但是,我不认为这将使我进一步发展。

方法注释是相当纯真的:

@POST()
@Path("update")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)

但是,我看不到它们和错误之间的联系,因为添加方法之后,我在MoXy中得到了ClassNotFoundException:

Caused by: java.lang.NoClassDefFoundError: javax/json/JsonException
    at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.getNewXMLReader(SAXUnmarshaller.java:209)
    at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.getXMLReader(SAXUnmarshaller.java:197)
    at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:452)
    at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:400)
    at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:741)
    at org.eclipse.persistence.internal.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:649)
    at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:349)
    at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.readFrom(MOXyJsonProvider.java:668)

然后,我添加了org.glassfish.javax.json:1.0.4来运行配置,并且码头初始化程序出现了问题。 现在,即使删除了json捆绑包和带有REST通道的捆绑包(导致最初的问题),该错误仍然存​​在。

是什么导致错误,我该怎么办?

我看起来像Eclipse错误。

我必须转到目录$workspace/.metadata/.plugins/org.eclipse.pde.core并删除用于启动配置的目录(在我的情况下为OSGI-Launch )。

看来我不必要地困扰了整个小组。 我应该使用经典的Eclipse Way:如果某些东西停止工作,则创建一个新的工作区。 或删除特定插件的缓存。 不过,我希望这篇文章对将来的某个人仍然有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM