Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Error during publish jetty 10.0.11(Publishing artifacts throws error)
Error during publish jetty 10.0.11 [message #1854758] Thu, 08 September 2022 07:01 Go to next message
Virag Purnam is currently offline Virag PurnamFriend
Messages: 142
Registered: June 2014
Senior Member
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 #1854772 is a reply to message #1854758] Fri, 09 September 2022 08:55 Go to previous messageGo to next message
cristelle AMELDA is currently offline cristelle AMELDAFriend
Messages: 5
Registered: August 2022
Junior Member
I would also like to know how to do this
Re: Error during publish jetty 10.0.11 [message #1854778 is a reply to message #1854772] Fri, 09 September 2022 16:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I'm not sure if this is a bug in OSGi, though I think not because I see this message in a properties file:

READER_PACKAGE_JAVA=Cannot specify java.* packages in Export headers \"{0}\"

You might ask for clarification here:

https://github.com/eclipse-equinox/equinox/discussions

In the case that is just wrong to have this in a header then I think it's a problem that Jetty needs to fix:

https://github.com/eclipse/jetty.project

BTW, Cristelle, my sense, looking at all your terse posts, is that you are just posting enough times until you case post links. But if you do that, I will ask that all your posts be removed and that your account be blocked.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Error during publish jetty 10.0.11 [message #1854782 is a reply to message #1854778] Fri, 09 September 2022 21:36 Go to previous message
BJ Hargrave is currently offline BJ HargraveFriend
Messages: 60
Registered: July 2009
Member
Starting with OSGi Release 7, the OSGi framework must now support imports of
java.*
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
java.*
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
java.*
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
java.*
packages. This can be done by either adding
!java.*
to the
Import-Package
instruction or adding a new
<_noimportjava>true</_noimportjava>
instruction.

Previous Topic:Eclipse RCP 4.8 support for oauth2 or sso login
Next Topic: Plug-in org.eclipse.jdt.ui was unable to load
Goto Forum:
  


Current Time: Thu Apr 25 01:18:41 GMT 2024

Powered by FUDForum. Page generated in 0.08723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top