Error during publish jetty 10.0.11 [message #1854758] |
Thu, 08 September 2022 03:01  |
Eclipse User |
|
|
|
Hi,
I am using jetty 10.0.11 plugins in my application. During the publish, it is not publishing the jetty jar files. I get below error.
Could you please help?
!STACK 0
org.osgi.framework.BundleException: Invalid manifest header Import-Package: "java.io" : Cannot specify java.* packages in Import/Export headers "java.io"
at org.eclipse.osgi.internal.resolver.StateBuilder.checkImportExportSyntax(StateBuilder.java:826)
at org.eclipse.osgi.internal.resolver.StateBuilder.validateHeaders(StateBuilder.java:214)
at org.eclipse.osgi.internal.resolver.StateBuilder.createBundleDescription(StateBuilder.java:65)
at org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl.createBundleDescription(StateObjectFactoryImpl.java:32)
at org.eclipse.osgi.service.resolver.StateObjectFactory$StateObjectFactoryProxy.createBundleDescription(StateObjectFactory.java:558)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleDescription(BundlesAction.java:543)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.createBundleDescription(BundlesAction.java:579)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.getBundleDescriptions(BundlesAction.java:901)
at org.eclipse.equinox.p2.publisher.eclipse.BundlesAction.perform(BundlesAction.java:721)
at org.eclipse.equinox.p2.publisher.Publisher$ArtifactProcess.run(Publisher.java:207)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.executeBatch(SimpleArtifactRepository.java:1344)
at org.eclipse.equinox.p2.publisher.Publisher.publish(Publisher.java:231)
at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.run(AbstractPublisherApplication.java:286)
at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.run(AbstractPublisherApplication.java:256)
at org.eclipse.equinox.p2.publisher.AbstractPublisherApplication.start(AbstractPublisherApplication.java:320)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:748)
|
|
|
|
|
Re: Error during publish jetty 10.0.11 [message #1854782 is a reply to message #1854778] |
Fri, 09 September 2022 17:36  |
Eclipse User |
|
|
|
Starting with OSGi Release 7, the OSGi framework must now support imports of packages.
https://docs.osgi.org/specification/osgi.core/7.0.0/framework.module.html#framework.module-execution.environment
In additional to specifying the version of the execution environment via an osgi.ee requirement, see osgi.ee Namespace, a Bundle may also import java.* packages using the Import-Package header. Imports of java.* packages by a bundle will be used during the resolution process, see Resolving Process, to ensure the bundle has visibility to the requested packages by wiring the bundle's import of a java.* package to the export of the java.* package by the Framework's system bundle. However, a bundle always loads classes in java.* packages via parent delegation. See Parent Delegation. Therefore, a bundle is not required to import a java.* package to have visibility to the classes in the package, if the package is present in the current runtime. It only needs to import a java.* package to have the resolution process ensure the package is available from the execution environment. This can avoid a NoClassDefFoundError during execution of the bundle due to a missing java.* package required by the bundle.
So Bnd will now generate imports for packages when certain conditions are present for the bundle. See https://bnd.bndtools.org/instructions/noimportjava.html.
The exception above is because p2 uses old OSGi resolving code which is not updated to understand that importing of packages are now permitted for OSGi R7 frameworks.
Note: Jetty can change their builds to configure the maven-bundle-plugin to instruct Bnd to not import packages. This can be done by either adding to the instruction or adding a new <_noimportjava>true</_noimportjava> instruction.
|
|
|
Powered by
FUDForum. Page generated in 0.08138 seconds