bndtools / bnd

Bnd/Bndtools. Tooling to build OSGi bundles including Eclipse, Maven, and Gradle plugins.
https://bndtools.org
Other
531 stars 305 forks source link

Packager used with Equinox throws NPE #394

Closed pkriens closed 11 years ago

pkriens commented 11 years ago

java.lang.NullPointerException at org.eclipse.osgi.internal.baseadaptor.BaseStorage.readStateData(BaseStorage.java:837) at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:792) at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:209) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:191) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299) at aQute.launcher.Launcher.update(Launcher.java:378) at aQute.launcher.Launcher.activate(Launcher.java:303) at aQute.launcher.Launcher.run(Launcher.java:193) at aQute.launcher.Launcher.main(Launcher.java:89)

bjhargrave commented 11 years ago

The NPE is fixed. However the way bnd "inserts" itself into the framework jar still breaks Equinox. The following is what the system bundle of Equinox 3.9 looks like in web console:

Symbolic Name   biz.aQute.launcher
Version 1.2.1.201309041006
Bundle Location System Bundle
Bundle Documentation    http://www.eclipse.org
Vendor  aQute SARL http://www.aQute.biz
Copyright   Copyright (c) aQute (2000, 2013). All Rights Reserved.
Description OSGi System Bundle

So the bundle symbolic name is wrong and the version is wrong. A framework extension fragment looking for "org.eclipse.osgi" bsn will fail to find it.

The package should really only insert/replace the Main-Class and should otherwise not modify the manifest including things like Bundle-License which now says Apache and not Eclipse!

bjhargrave commented 11 years ago

Fixed by 0261c924ef235ef38c9054b8de458baa5f348a3f and some subsequent commits. These fixes have been cherry picked to master for 2.2.

intothephone commented 10 years ago

I'm using bndtools 2.2.2 but still has this issue. Whatever Equinox version: 3.7, 3.8, 3.9. After exporting to a single executable jar, NPE as following:

java.lang.NullPointerException at org.eclipse.osgi.internal.baseadaptor.BaseStorage.readStateData(BaseStorage.java:844) at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:799) at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminIm pl.java:210) at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl .java:192) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at aQute.launcher.Launcher.update(Launcher.java:378) at aQute.launcher.Launcher.activate(Launcher.java:303) at aQute.launcher.Launcher.run(Launcher.java:193) at aQute.launcher.Launcher.main(Launcher.java:89)

intothephone commented 10 years ago

Additionally, if exporting to the folder instead of the single executable jar, there will be another NPE: java.lang.NullPointerException at java.util.StringTokenizer.(Unknown Source) at java.util.StringTokenizer.(Unknown Source) at aQute.launcher.constants.LauncherConstants.split(LauncherConstants.java:129) at aQute.launcher.constants.LauncherConstants.(LauncherConstants.java:114) at aQute.launcher.Launcher.(Launcher.java:155) at aQute.launcher.Launcher.main(Launcher.java:88) at launch.main(launch.java:13) I installed bndtools from eclipse marketplace, the version is 2.2.2.REL-20131018-171114. Not sure whether it has been fixed in the latest build.

pkriens commented 10 years ago

How do you export to a folder?

intothephone commented 10 years ago

Sorry for the late reply. I'm using bndtools plug-in, open the bndrun file, click Export button, select Export to folder in in Export Definition page. After that, run the application will report the NPE. I'm not sure whether it's my environment issue or it is a bug here.

pkriens commented 10 years ago

Can you send the JAR so I can take a look?

intothephone commented 10 years ago

Sure, thank you very much for the help, I'll send the jar via email.

kristofferpeterhansel commented 10 years ago

Since there has, presumably, been some email correspondence. I figured I'd ask if there has been a resolution of what is going on with this?

We just tried to move a project to bndtools and are having the same issue. Where it will fail with the same errors when exporting both as jar and folder

pkriens commented 10 years ago

1) Can you run with trace on (-runtrace=true) 2) Can you verify that there is a correct launcher.properties file in the root of the packaged project?

kristofferpeterhansel commented 10 years ago

The output from using -runtrace=true (with jar export). Looks like the launcher.properties is fine. Although I am not sure what to look for there

# inited runbundles=[jar/aQute.xray.plugin-1.3.0.jar, jar/bcprov-1.50.0.jar, jar/ch.qos.logback.classic-1.0.0.jar, jar/ch.qos.logback.core-1.0.0.jar, jar/com.springsource.javax.jms-1.1.0.jar, jar/com.springsource.javax.jws-2.0.0.jar, jar/com.springsource.javax.mail-1.4.0.jar, jar/com.springsource.org.aopalliance-1.0.0.jar, jar/com.springsource.org.apache.commons.httpclient-3.1.0.jar, jar/com.springsource.org.apache.commons.logging-1.1.1.jar, jar/configuration.jar, jar/dssimtool.snmp4j-1.0.0.jar, jar/engine.jar, jar/groovy-all-2.2.1.jar, jar/jackson-core-asl-1.5.0.jar, jar/jackson-mapper-asl-1.5.0.jar, jar/javax.servlet-3.0.0.jar, jar/javax.xml-1.3.4.jar, jar/mfpdevice-api.jar, jar/mobileimplementation.jar, jar/org.apache.axis2.osgi.sc-1.5.1.jar, jar/org.apache.commons.codec-1.8.0.jar, jar/org.apache.commons.fileupload-1.2.1.jar, jar/org.apache.commons.io-1.4.0.jar, jar/org.apache.commons.lang-2.6.0.jar, jar/org.apache.cxf.cxf-api-2.7.8.jar, jar/org.apache.cxf.cxf-rt-bindings-soap-2.7.8.jar, jar/org.apache.cxf.cxf-rt-bindings-xml-2.7.8.jar, jar/org.apache.cxf.cxf-rt-core-2.7.8.jar, jar/org.apache.cxf.cxf-rt-databinding-jaxb-2.7.8.jar, jar/org.apache.cxf.cxf-rt-frontend-jaxws-2.7.8.jar, jar/org.apache.cxf.cxf-rt-frontend-simple-2.7.8.jar, jar/org.apache.cxf.cxf-rt-transports-http-2.7.10.jar, jar/org.apache.felix.configadmin-1.6.0.jar, jar/org.apache.felix.fileinstall-3.2.4.jar, jar/org.apache.felix.gogo.command-0.12.0.jar, jar/org.apache.felix.gogo.runtime-0.10.0.jar, jar/org.apache.felix.gogo.shell-0.10.0.jar, jar/org.apache.felix.log-1.0.1.jar, jar/org.apache.felix.scr-1.6.2.jar, jar/org.apache.felix.webconsole-3.1.8.jar, jar/org.apache.geronimo.specs.geronimo-activation_1.1_spec-1.1.0.jar, jar/org.apache.neethi-3.0.1.jar, jar/org.apache.servicemix.bundles.wsdl4j-1.6.2.jar, jar/org.apache.woden.woden-api-1.0.0.jar, jar/org.apache.woden.woden-impl-dom-1.0.0.jar, jar/org.apache.ws.commons.axiom.axiom-api-1.2.8.jar, jar/org.apache.ws.commons.axiom.axiom-dom-1.2.8.jar, jar/org.apache.ws.commons.axiom.axiom-impl-1.2.8.jar, jar/org.apache.ws.xmlschema.core-2.0.1.jar, jar/org.apache.xerces-2.9.0.jar, jar/org.apache.xml.resolver-1.2.0.jar, jar/org.apache.xml.serializer-2.7.1.jar, jar/org.eclipse.equinox.console-1.0.0.jar, jar/org.eclipse.equinox.ds-1.4.100.jar, jar/org.eclipse.equinox.util-1.0.500.jar, jar/org.eclipse.gemini.blueprint.core-1.0.2.jar, jar/org.eclipse.gemini.blueprint.extender-1.0.2.jar, jar/org.eclipse.gemini.blueprint.io-1.0.2.jar, jar/org.ini4j-0.5.1.jar, jar/org.ops4j.pax.logging.pax-logging-api-1.7.2.jar, jar/org.ops4j.pax.logging.pax-logging-service-1.7.2.jar, jar/org.ops4j.pax.web.pax-web-jetty-bundle-3.0.6.jar, jar/org.springframework.aop-3.0.6.jar, jar/org.springframework.asm-3.0.6.jar, jar/org.springframework.beans-3.0.6.jar, jar/org.springframework.context-3.0.6.jar, jar/org.springframework.core-3.0.6.jar, jar/osgi.cmpn-5.0.0.jar, jar/osgi.enterprise-4.2.0.jar, jar/osgi.residential-4.3.0.jar, jar/printjobreceiver.jar, jar/safecomprotocol.jar, jar/sharpimplementation.jar, jar/slf4j.api-1.7.5.jar, jar/stax2-api-3.1.1.jar, jar/unittest4jenkins.jar,
jar/utils.startLazyBundles-1.0.0.jar, jar/woodstox-core-asl-4.2.0.jar, jar/xeroximplementation.jar] activators=[] timeout=0
# version
# using working dir: C:\Users\KRISTO~1\AppData\Local\Temp\osgi.979458798542925125.fw
# deleting working dir C:\Users\KRISTO~1\AppData\Local\Temp\osgi.979458798542925125.fw because not kept
# system packages used: org.eclipse.osgi.event;version="1.0",org.eclipse.osgi.framework.console;version="1.1",org.eclipse.osgi.framework.eventmgr;version="1.2",org.eclipse.osgi.framework.log;version="1.1",org.eclipse.osgi.launch;version="1.0",org.eclipse.osgi.service.datalocation;version="1.3",org.eclipse.osgi.service.debug;version="1.2",org.eclipse.osgi.service.environment;version="1.3",org.eclipse.osgi.service.localization;version="1.1",org.eclipse.osgi.service.pluginconversion;version="1.0",org.eclipse.osgi.service.resolver;version="1.6",org.eclipse.osgi.service.resolver.extras;version="1.0";x-friends:="org.eclipse.equinox.resolver",org.eclipse.osgi.service.runnable;version="1.1",org.eclipse.osgi.service.security;version="1.0",org.eclipse.osgi.service.urlconversion;version="1.0",org.eclipse.osgi.signedcontent;version="1.0",org.eclipse.osgi.storagemanager;version="1.0",org.eclipse.osgi.util;version="1.1",org.eclipse.equinox.log;version="1.0",org.osgi.framework;version="1.7",org.osgi.framework.launch;version="1.1",org.osgi.framework.hooks.bundle;version="1.1",org.osgi.framework.hooks.resolver;version="1.0",org.osgi.framework.hooks.service;version="1.1",org.osgi.framework.hooks.weaving;version="1.0",org.osgi.framework.namespace;version="1.0",org.osgi.framework.startlevel;version="1.0",org.osgi.framework.wiring;version="1.1",org.osgi.resource;version="1.0",org.osgi.service.condpermadmin;version="1.1.1",org.osgi.service.framework;version="1.0";x-internal:=true,org.osgi.service.log;version="1.3",org.osgi.service.packageadmin;version="1.2",org.osgi.service.permissionadmin;version="1.2",org.osgi.service.startlevel;version="1.1",org.osgi.service.url;version="1.0",org.osgi.util.tracker;version="1.5.1",org.eclipse.core.runtime.adaptor;x-friends:="org.eclipse.core.runtime",org.eclipse.core.runtime.internal.adaptor;x-internal:=true,org.eclipse.core.runtime.internal.stats;x-friends:="org.eclipse.core.runtime",org.eclipse.osgi.baseadaptor;x-internal:=true,org.eclipse.osgi.baseadaptor.bundlefile;x-internal:=true,org.eclipse.osgi.baseadaptor.hooks;x-internal:=true,org.eclipse.osgi.baseadaptor.loader;x-internal:=true,org.eclipse.osgi.framework.adaptor;x-internal:=true,org.eclipse.osgi.framework.debug;x-internal:=true,org.eclipse.osgi.framework.internal.core;x-internal:=true,org.eclipse.osgi.framework.internal.protocol;x-internal:=true,org.eclipse.osgi.framework.internal.protocol.bundleentry;x-internal:=true,org.eclipse.osgi.framework.internal.protocol.bundleresource;x-internal:=true,org.eclipse.osgi.framework.internal.protocol.reference;x-internal:=true,org.eclipse.osgi.framework.internal.reliablefile;x-internal:=true,org.eclipse.osgi.framework.util;x-internal:=true,org.eclipse.osgi.internal.baseadaptor;x-internal:=true,org.eclipse.osgi.internal.composite;x-internal:=true,org.eclipse.osgi.internal.loader;x-internal:=true,org.eclipse.osgi.internal.loader.buddy;x-internal:=true,org.eclipse.osgi.internal.module;x-internal:=true,org.eclipse.osgi.internal.profile;x-internal:=true,org.eclipse.osgi.internal.resolver;x-internal:=true,org.eclipse.osgi.internal.serviceregistry;x-internal:=true,org.eclipse.osgi.internal.permadmin;x-internal:=true,org.eclipse.osgi.internal.provisional.service.security;x-friends:="org.eclipse.equinox.security.ui";version="1.0.0",org.eclipse.osgi.internal.provisional.verifier;x-friends:="org.eclipse.update.core,org.eclipse.ui.workbench,org.eclipse.equinox.p2.artifact.repository",org.eclipse.osgi.internal.service.security;x-friends:="org.eclipse.equinox.security.ui",org.eclipse.osgi.internal.signedcontent;x-internal:=true,org.eclipse.osgi.service.internal.composite;x-internal:=true,org.eclipse.equinox.log.internal;x-internal:=true
# system capabilities used: osgi.native;osgi.native.osname:List<String>="Windows7,Windows 7,Win32";osgi.native.osversion:Version=6.1.0;osgi.native.processor:List<String>="x86-64,amd64,em64t,x86_64"
# using META-INF/services
# found META-INF/services in jar:file:/C:/tmp/dssim.jar!/META-INF/services/org.osgi.framework.launch.FrameworkFactory
# org.eclipse.osgi.launch.EquinoxFactory
# Framework factory org.eclipse.osgi.launch.EquinoxFactory@3aa450bb
# framework instance org.eclipse.osgi.launch.Equinox@2d9ffd6f
# inited system bundle org.eclipse.osgi.launch.Equinox@2d9ffd6f
# no permission admin available => ! security
# system bundle started ok
# could not get package admin
# start embedded activators
# Updating framework with [jar/aQute.xray.plugin-1.3.0.jar, jar/bcprov-1.50.0.jar, jar/ch.qos.logback.classic-1.0.0.jar, jar/ch.qos.logback.core-1.0.0.jar, jar/com.springsource.javax.jms-1.1.0.jar, jar/com.springsource.javax.jws-2.0.0.jar,
jar/com.springsource.javax.mail-1.4.0.jar, jar/com.springsource.org.aopalliance-1.0.0.jar, jar/com.springsource.org.apache.commons.httpclient-3.1.0.jar, jar/com.springsource.org.apache.commons.logging-1.1.1.jar, jar/configuration.jar, jar/dssimtool.snmp4j-1.0.0.jar, jar/engine.jar, jar/groovy-all-2.2.1.jar, jar/jackson-core-asl-1.5.0.jar, jar/jackson-mapper-asl-1.5.0.jar, jar/javax.servlet-3.0.0.jar, jar/javax.xml-1.3.4.jar, jar/mfpdevice-api.jar, jar/mobileimplementation.jar, jar/org.apache.axis2.osgi.sc-1.5.1.jar, jar/org.apache.commons.codec-1.8.0.jar, jar/org.apache.commons.fileupload-1.2.1.jar, jar/org.apache.commons.io-1.4.0.jar, jar/org.apache.commons.lang-2.6.0.jar, jar/org.apache.cxf.cxf-api-2.7.8.jar, jar/org.apache.cxf.cxf-rt-bindings-soap-2.7.8.jar, jar/org.apache.cxf.cxf-rt-bindings-xml-2.7.8.jar, jar/org.apache.cxf.cxf-rt-core-2.7.8.jar, jar/org.apache.cxf.cxf-rt-databinding-jaxb-2.7.8.jar, jar/org.apache.cxf.cxf-rt-frontend-jaxws-2.7.8.jar, jar/org.apache.cxf.cxf-rt-frontend-simple-2.7.8.jar, jar/org.apache.cxf.cxf-rt-transports-http-2.7.10.jar, jar/org.apache.felix.configadmin-1.6.0.jar, jar/org.apache.felix.fileinstall-3.2.4.jar, jar/org.apache.felix.gogo.command-0.12.0.jar, jar/org.apache.felix.gogo.runtime-0.10.0.jar, jar/org.apache.felix.gogo.shell-0.10.0.jar, jar/org.apache.felix.log-1.0.1.jar, jar/org.apache.felix.scr-1.6.2.jar, jar/org.apache.felix.webconsole-3.1.8.jar, jar/org.apache.geronimo.specs.geronimo-activation_1.1_spec-1.1.0.jar, jar/org.apache.neethi-3.0.1.jar, jar/org.apache.servicemix.bundles.wsdl4j-1.6.2.jar, jar/org.apache.woden.woden-api-1.0.0.jar, jar/org.apache.woden.woden-impl-dom-1.0.0.jar, jar/org.apache.ws.commons.axiom.axiom-api-1.2.8.jar, jar/org.apache.ws.commons.axiom.axiom-dom-1.2.8.jar, jar/org.apache.ws.commons.axiom.axiom-impl-1.2.8.jar, jar/org.apache.ws.xmlschema.core-2.0.1.jar, jar/org.apache.xerces-2.9.0.jar, jar/org.apache.xml.resolver-1.2.0.jar, jar/org.apache.xml.serializer-2.7.1.jar, jar/org.eclipse.equinox.console-1.0.0.jar, jar/org.eclipse.equinox.ds-1.4.100.jar, jar/org.eclipse.equinox.util-1.0.500.jar, jar/org.eclipse.gemini.blueprint.core-1.0.2.jar, jar/org.eclipse.gemini.blueprint.extender-1.0.2.jar, jar/org.eclipse.gemini.blueprint.io-1.0.2.jar, jar/org.ini4j-0.5.1.jar, jar/org.ops4j.pax.logging.pax-logging-api-1.7.2.jar, jar/org.ops4j.pax.logging.pax-logging-service-1.7.2.jar, jar/org.ops4j.pax.web.pax-web-jetty-bundle-3.0.6.jar, jar/org.springframework.aop-3.0.6.jar, jar/org.springframework.asm-3.0.6.jar, jar/org.springframework.beans-3.0.6.jar, jar/org.springframework.context-3.0.6.jar, jar/org.springframework.core-3.0.6.jar, jar/osgi.cmpn-5.0.0.jar, jar/osgi.enterprise-4.2.0.jar, jar/osgi.residential-4.3.0.jar, jar/printjobreceiver.jar, jar/safecomprotocol.jar, jar/sharpimplementation.jar, jar/slf4j.api-1.7.5.jar, jar/stax2-api-3.1.1.jar, jar/unittest4jenkins.jar, jar/utils.startLazyBundles-1.0.0.jar, jar/woodstox-core-asl-4.2.0.jar, jar/xeroximplementation.jar]
# starting in embedded mode
# installing jar/aQute.xray.plugin-1.3.0.jar
# installing jar/bcprov-1.50.0.jar
# installing jar/ch.qos.logback.classic-1.0.0.jar
# installing jar/ch.qos.logback.core-1.0.0.jar
# installing jar/com.springsource.javax.jms-1.1.0.jar
# installing jar/com.springsource.javax.jws-2.0.0.jar
# installing jar/com.springsource.javax.mail-1.4.0.jar
# installing jar/com.springsource.org.aopalliance-1.0.0.jar
# installing jar/com.springsource.org.apache.commons.httpclient-3.1.0.jar
# installing jar/com.springsource.org.apache.commons.logging-1.1.1.jar
# installing jar/configuration.jar
# installing jar/dssimtool.snmp4j-1.0.0.jar
# installing jar/engine.jar
# installing jar/groovy-all-2.2.1.jar
# installing jar/jackson-core-asl-1.5.0.jar
# installing jar/jackson-mapper-asl-1.5.0.jar
# installing jar/javax.servlet-3.0.0.jar
# installing jar/javax.xml-1.3.4.jar
# installing jar/mfpdevice-api.jar
# installing jar/mobileimplementation.jar
# installing jar/org.apache.axis2.osgi.sc-1.5.1.jar
# installing jar/org.apache.commons.codec-1.8.0.jar
# installing jar/org.apache.commons.fileupload-1.2.1.jar
# installing jar/org.apache.commons.io-1.4.0.jar
# installing jar/org.apache.commons.lang-2.6.0.jar
# installing jar/org.apache.cxf.cxf-api-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-bindings-soap-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-bindings-xml-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-core-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-databinding-jaxb-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-frontend-jaxws-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-frontend-simple-2.7.8.jar
# installing jar/org.apache.cxf.cxf-rt-transports-http-2.7.10.jar
# installing jar/org.apache.felix.configadmin-1.6.0.jar
# installing jar/org.apache.felix.fileinstall-3.2.4.jar
# installing jar/org.apache.felix.gogo.command-0.12.0.jar
# installing jar/org.apache.felix.gogo.runtime-0.10.0.jar
# installing jar/org.apache.felix.gogo.shell-0.10.0.jar
# installing jar/org.apache.felix.log-1.0.1.jar
# installing jar/org.apache.felix.scr-1.6.2.jar
# installing jar/org.apache.felix.webconsole-3.1.8.jar
# installing jar/org.apache.geronimo.specs.geronimo-activation_1.1_spec-1.1.0.jar
# installing jar/org.apache.neethi-3.0.1.jar
# installing jar/org.apache.servicemix.bundles.wsdl4j-1.6.2.jar
# installing jar/org.apache.woden.woden-api-1.0.0.jar
# installing jar/org.apache.woden.woden-impl-dom-1.0.0.jar
# installing jar/org.apache.ws.commons.axiom.axiom-api-1.2.8.jar
# installing jar/org.apache.ws.commons.axiom.axiom-dom-1.2.8.jar
# installing jar/org.apache.ws.commons.axiom.axiom-impl-1.2.8.jar
# installing jar/org.apache.ws.xmlschema.core-2.0.1.jar
# installing jar/org.apache.xerces-2.9.0.jar
# installing jar/org.apache.xml.resolver-1.2.0.jar
# installing jar/org.apache.xml.serializer-2.7.1.jar
# installing jar/org.eclipse.equinox.console-1.0.0.jar
# installing jar/org.eclipse.equinox.ds-1.4.100.jar
# installing jar/org.eclipse.equinox.util-1.0.500.jar
# installing jar/org.eclipse.gemini.blueprint.core-1.0.2.jar
# installing jar/org.eclipse.gemini.blueprint.extender-1.0.2.jar
# installing jar/org.eclipse.gemini.blueprint.io-1.0.2.jar
# installing jar/org.ini4j-0.5.1.jar
# installing jar/org.ops4j.pax.logging.pax-logging-api-1.7.2.jar
# installing jar/org.ops4j.pax.logging.pax-logging-service-1.7.2.jar
# installing jar/org.ops4j.pax.web.pax-web-jetty-bundle-3.0.6.jar
# installing jar/org.springframework.aop-3.0.6.jar
# installing jar/org.springframework.asm-3.0.6.jar
# installing jar/org.springframework.beans-3.0.6.jar
# installing jar/org.springframework.context-3.0.6.jar
# installing jar/org.springframework.core-3.0.6.jar
# installing jar/osgi.cmpn-5.0.0.jar
# installing jar/osgi.enterprise-4.2.0.jar
# installing jar/osgi.residential-4.3.0.jar
# installing jar/printjobreceiver.jar
# installing jar/safecomprotocol.jar
# installing jar/sharpimplementation.jar
# installing jar/slf4j.api-1.7.5.jar
# installing jar/stax2-api-3.1.1.jar
# installing jar/unittest4jenkins.jar
# installing jar/utils.startLazyBundles-1.0.0.jar
# installing jar/woodstox-core-asl-4.2.0.jar
# installing jar/xeroximplementation.jar
# cannot refresh the bundles because there is no Package Admin
# bundles administered []
# Will start bundles: [aQute.xray.plugin_1.3.0.201310301735 [1], bcprov_1.50.0 [2], ch.qos.logback.classic_1.0.0 [3], ch.qos.logback.core_1.0.0 [4], com.springsource.javax.jms_1.1.0 [5], com.springsource.javax.jws_2.0.0 [6], com.springsource.javax.mail_1.4.0 [7], com.springsource.org.aopalliance_1.0.0 [8], com.springsource.org.apache.commons.httpclient_3.1.0 [9], com.springsource.org.apache.commons.logging_1.1.1 [10], configuration_2.0.0 [11], dssimtool.snmp4j_1.0.0 [12], engine_2.0.0 [13], groovy-all_2.2.1 [14], jackson-core-asl_1.5.0 [15], jackson-mapper-asl_1.5.0 [16], javax.servlet_3.0.0.v201112011016 [17], javax.xml_1.3.4.v201005080400 [18], mfpdevice-api_2.0.0 [19], mobileimplementation_2.0.0 [20], org.apache.axis2.osgi.sc_1.5.1.1 [21], org.apache.commons.codec_1.8.0 [22], org.apache.commons.fileupload_1.2.1 [23], org.apache.commons.io_1.4.0 [24], org.apache.commons.lang_2.6.0 [25], org.apache.cxf.cxf-api_2.7.8 [26], org.apache.cxf.cxf-rt-bindings-soap_2.7.8 [27], org.apache.cxf.cxf-rt-bindings-xml_2.7.8 [28], org.apache.cxf.cxf-rt-core_2.7.8 [29], org.apache.cxf.cxf-rt-databinding-jaxb_2.7.8 [30], org.apache.cxf.cxf-rt-frontend-jaxws_2.7.8 [31], org.apache.cxf.cxf-rt-frontend-simple_2.7.8 [32], org.apache.cxf.cxf-rt-transports-http_2.7.10 [33], org.apache.felix.configadmin_1.6.0 [34], org.apache.felix.fileinstall_3.2.4 [35], org.apache.felix.gogo.command_0.12.0 [36], org.apache.felix.gogo.runtime_0.10.0 [37],
org.apache.felix.gogo.shell_0.10.0 [38], org.apache.felix.log_1.0.1 [39], org.apache.felix.scr_1.6.2 [40], org.apache.felix.webconsole_3.1.8 [41], org.apache.geronimo.specs.geronimo-activation_1.1_spec_1.1.0 [42], org.apache.neethi_3.0.1 [43], org.apache.servicemix.bundles.wsdl4j_1.6.2.5 [44], org.apache.woden.woden-api_1.0.0 [45], org.apache.woden.woden-impl-dom_1.0.0 [46], org.apache.ws.commons.axiom.axiom-api_1.2.8 [47], org.apache.ws.commons.axiom.axiom-dom_1.2.8 [48], org.apache.ws.commons.axiom.axiom-impl_1.2.8 [49], org.apache.ws.xmlschema.core_2.0.1 [50], org.apache.xerces_2.9.0.v200909240008 [51], org.apache.xml.resolver_1.2.0.v200902170519 [52], org.apache.xml.serializer_2.7.1.v200902170519 [53], org.eclipse.equinox.console_1.0.0.v20120522-1841 [54], org.eclipse.equinox.ds_1.4.100.v20130515-2026 [55], org.eclipse.equinox.util_1.0.500.v20130404-1337 [56], org.eclipse.gemini.blueprint.core_1.0.2.RELEASE [57], org.eclipse.gemini.blueprint.extender_1.0.2.RELEASE [58], org.eclipse.gemini.blueprint.io_1.0.2.RELEASE [59], org.ini4j_0.5.1 [60], org.ops4j.pax.logging.pax-logging-api_1.7.2 [61], org.ops4j.pax.logging.pax-logging-service_1.7.2 [62], org.ops4j.pax.web.pax-web-jetty-bundle_3.0.6 [63], org.springframework.aop_3.0.6.RELEASE [64], org.springframework.asm_3.0.6.RELEASE [65], org.springframework.beans_3.0.6.RELEASE [66], org.springframework.context_3.0.6.RELEASE [67], org.springframework.core_3.0.6.RELEASE [68], osgi.cmpn_5.0.0.201305092017 [69], osgi.enterprise_4.2.0.201003190513 [70], osgi.residential_4.3.0.201111022239 [71], printjobreceiver_1.0.0.qualifier [72], safecomprotocol_2.0.0 [73], sharpimplementation_2.0.0 [74], slf4j.api_1.7.5 [75], stax2-api_3.1.1 [76], unittest4jenkins_0.0.0 [77], utils.startLazyBundles_1.0.0 [78], woodstox-core-asl_4.2.0 [79],
xeroximplementation_2.0.0 [80]]
# starting aQute.xray.plugin
! Unexpected error in the run body: null
java.lang.NullPointerException
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.readStateData(BaseStorage.java:844)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:799)
        at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387)
        at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:210)
        at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:192)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
        at aQute.launcher.Launcher.update(Launcher.java:378)
        at aQute.launcher.Launcher.activate(Launcher.java:303)
        at aQute.launcher.Launcher.run(Launcher.java:193)
        at aQute.launcher.Launcher.main(Launcher.java:89)
# ignoring timeout handler because framework is already no longer active, shutdown is orderly handled
# alive thread Thread[main,5,main]
# stopped system bundle due to leaving run body
java.lang.NullPointerException
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.readStateData(BaseStorage.java:844)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.getStateManager(BaseStorage.java:799)
        at org.eclipse.osgi.baseadaptor.BaseAdaptor.getState(BaseAdaptor.java:387)
        at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.doResolveBundles(PackageAdminImpl.java:210)
        at org.eclipse.osgi.framework.internal.core.PackageAdminImpl.resolveBundles(PackageAdminImpl.java:192)
        at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:322)
        at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)
        at aQute.launcher.Launcher.update(Launcher.java:378)
        at aQute.launcher.Launcher.activate(Launcher.java:303)
        at aQute.launcher.Launcher.run(Launcher.java:193)
        at aQute.launcher.Launcher.main(Launcher.java:89)
kristofferpeterhansel commented 10 years ago

I was a bit too quick about the folder export. I am getting a different error with that.

Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
        at sun.security.util.SignatureFileVerifier.process(Unknown Source)
        at java.util.jar.JarVerifier.processEntry(Unknown Source)
        at java.util.jar.JarVerifier.update(Unknown Source)
        at java.util.jar.JarFile.initializeVerifier(Unknown Source)
        at java.util.jar.JarFile.getInputStream(Unknown Source)
        at sun.misc.URLClassPath$JarLoader$2.getInputStream(Unknown Source)
        at sun.misc.Resource.cachedInputStream(Unknown Source)
        at sun.misc.Resource.getByteBuffer(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
bjhargrave commented 10 years ago

See also https://bugs.eclipse.org/bugs/show_bug.cgi?id=413088 were it was determined that bnd was messing up the packaged jar's manifest which Equinox expects to have certain information if the framework is run from the main jar.

kristofferpeterhansel commented 10 years ago

I just realized this is an issued opened against bnd and not bndtools. But what is the status on that fix in relation to bndtools then?

pkriens commented 10 years ago

Can you try this out with the latest version and then send me the packaged JAR? (Peter.Kriens@aQute.biz)

kristofferpeterhansel commented 10 years ago

So. Did the provided jar help sort anything out?

pkriens commented 10 years ago

Actually yes. This bundle is in the old format so you're using an old version of bnd ...

The old version just to the -runpath and copied it into the JAR, this is what I see in your JAR. The newer (since october I think) stores the jars on the -runpath also as JARs in the uber JAR; it then adds a little class that explodes this on the file system. This is the aQute.launcher.pre.EmbeddedLauncher.

What could be the problem is the cnf/cache directory. The packaging is done by the launcher (since it needs to know intricately how the launcher works). The launcher and tester are stored in the cnf/cache directory. If they are not there, bnd will copy fresh versions. However, it does not overwrite existing version. So try

Exit eclispe(s)
Delete all ./cnf/cache directories
Restart eclipse(s)

Kind regards,

Peter Kriens

On 18 mrt. 2014, at 09:27, Kristoffer Peterhänsel notifications@github.com wrote:

So. Did the provided jar help sort anything out?

— Reply to this email directly or view it on GitHub.

kristofferpeterhansel commented 10 years ago

So I did that. And it got the exact same files back (biz.aQute.launcher-1.2.1.jar and biz.aQute.junit-1.2.0.jar). And looking in the launcher file it seems like it was build 2013/09/27. And it is behaving the same way.

But as far as I can tell. It is also the only version available on the Bndtools Hub repo. And I presume it fetches it from there.

pkriens commented 10 years ago

I guess that explains it. That fix is not in bndtools yet :-( We are discussing a release (bnd is ready) but the bndtools people are rather busy at the moment.

You can install the continuous build from https://bndtools.ci.cloudbees.com/job/bndtools.master/lastSuccessfulBuild/artifact/build/generated/p2/

If that is not what you want (yet), you can actually also run bnd from the commandline. This works easiest if you install it through jpm.

$ install jpm -> http://jpm4j.org/#!/md/install
$ [sudo] jpm install bnd@*              # the @* indicates latest staging version
$ bnd version                       # get the version
2.3.0......
$ bnd package dssim.bndrun              # make a jar
$ java -jar dssim.jar ...               # run the jar
....
$ [sudo] jpm install --name dssim dssim.jar     # this installs local, no upload
$ dssim                         # now you can run it from the command line
....

Otherwise, you can download bnd from http://jpm4j.org/#!/p/sha/58EDD95E8A3F6DCB69AFE3D01247E2EB6362B4BA//0.0.0

$ java -jar biz.aQute.bnd.jar version
2.3.0......
$ java -jar biz.aQute.bnd.jar package dssim.bndrun
$ java -jar dssim.jar ...

Kind regards,

Peter Kriens

On 18 mrt. 2014, at 12:44, Kristoffer Peterhänsel notifications@github.com wrote:

So I did that. And it got the exact same files back (biz.aQute.launcher-1.2.1.jar and biz.aQute.junit-1.2.0.jar). And looking in the launcher file it seems like it was build 2013/09/27. And it is behaving the same way.

But as far as I can tell. It is also the only version available on the Bndtools Hub repo. And I presume it fetches it from there.

— Reply to this email directly or view it on GitHub.

kristofferpeterhansel commented 10 years ago

Alright. I guess I was right in that it turned out to be a bug in the wrong space then ;)

Thanks