Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad and/or missing Require-Capability for osgi.serviceloader #6418

Closed
flaviodonze opened this issue Jun 16, 2021 · 4 comments · Fixed by #6422
Closed

Bad and/or missing Require-Capability for osgi.serviceloader #6418

flaviodonze opened this issue Jun 16, 2021 · 4 comments · Fixed by #6422
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@flaviodonze
Copy link

Jetty version(s)
Jetty Version 10.0.5

Java version/vendor (use: java -version)
jdk16.0.1

OS type/version
Windows 10

Description
I'm trying to migrate our embedded jetty 9.4.x to jetty 10.0.5. I'm having a couple of OSGi and dependency issues.

To isolate the problem I created a simple OSGi Launch in Eclipse, having a couple bundles:

<setEntry value="jakarta.servlet-api@default:default"/>
<setEntry value="org.apache.aries.spifly.dynamic.bundle@default:default"/>
<setEntry value="org.apache.felix.gogo.runtime@default:default"/>
<setEntry value="org.apache.felix.gogo.shell@default:default"/>
<setEntry value="org.eclipse.equinox.console@default:default"/>
<setEntry value="org.eclipse.jetty.http*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.io*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.security*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.server*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.servlet*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.util*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.webapp*10.0.5@default:default"/>
<setEntry value="org.eclipse.jetty.xml*10.0.5@default:default"/>
<setEntry value="org.eclipse.osgi.services@default:default"/>
<setEntry value="org.eclipse.osgi.util@default:default"/>
<setEntry value="org.eclipse.osgi@-1:true"/>
<setEntry value="org.objectweb.asm.commons@default:default"/>
<setEntry value="org.objectweb.asm.tree.analysis@default:default"/>
<setEntry value="org.objectweb.asm.tree@default:default"/>
<setEntry value="org.objectweb.asm.util@default:default"/>
<setEntry value="org.objectweb.asm@default:default"/>
<setEntry value="slf4j.api*2.0.0.alpha1@default:default"/>

If I launch this settings I get the following validation error:
Require-Capability: osgi.serviceloader; filter:=“(osgi.serviceloader=org.eclipse.jetty.webapp.Configuration)”
PrintScreen: https://stackoverflow.com/questions/68004496/jetty-10-require-capability-osgi-serviceloader-filter-osgi-serviceloader-o

@flaviodonze flaviodonze added the Bug For general bugs on Jetty side label Jun 16, 2021
@joakime
Copy link
Contributor

joakime commented Jun 16, 2021

You don't seem to be using any component / bundle that has a META-INF/services/org.eclipse.jetty.webapp.Configuration service entry.

[jetty-10.0.x]$ find . -name "org.eclipse.jetty.webapp.Configuration"
./jetty-plus/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-cdi/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-osgi/jetty-osgi-boot/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-maven-plugin/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-ant/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-quickstart/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-websocket/websocket-javax-server/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-websocket/websocket-jetty-client/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-websocket/websocket-jetty-server/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
./jetty-annotations/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration

If you add such an entry, does the error/warning go away? (eg: add jetty-annotations-<ver>.jar)

@flaviodonze
Copy link
Author

That is the strange thing, actually <setEntry value="org.eclipse.jetty.webapp*10.0.5@default:default"/> contains the entry:
./jetty-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.webapp.Configuration
But also org.eclipse.jetty.webapp causes the validation exception.

@janbartel
Copy link
Contributor

I've been able to reproduce the problem, investigating further.

@janbartel janbartel added this to To do in Jetty 10.0.6/11.0.6 FROZEN via automation Jun 17, 2021
janbartel added a commit that referenced this issue Jun 17, 2021
Signed-off-by: Jan Bartel <janb@webtide.com>
@janbartel
Copy link
Contributor

Yup, that there is a genuine bug. Fixing, see PR #6422

Jetty 10.0.6/11.0.6 FROZEN automation moved this from To do to Done Jun 17, 2021
janbartel added a commit that referenced this issue Jun 17, 2021
janbartel added a commit that referenced this issue Jun 17, 2021
janbartel added a commit that referenced this issue Jun 21, 2021
@joakime joakime changed the title Require-Capability: osgi.serviceloader; filter:=“(osgi.serviceloader=org.eclipse.jetty.webapp.Configuration)” Bad and/or missing Require-Capability for osgi.serviceloader Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants