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

[org.eclipse.jetty.ee8.webapp.Configurations] Unable to get known Configuration #12614

Open
gpfeifer opened this issue Dec 5, 2024 · 4 comments
Labels
Bug For general bugs on Jetty side

Comments

@gpfeifer
Copy link

gpfeifer commented Dec 5, 2024

Jetty version(s)
Jetty 12.0.15

Jetty Environment
ee8

Java version/vendor (use: java -version)
openjdk version "21.0.5" 2024-10-15
OpenJDK Runtime Environment (build 21.0.5+11-Ubuntu-1ubuntu122.04)
OpenJDK 64-Bit Server VM (build 21.0.5+11-Ubuntu-1ubuntu122.04, mixed mode, sharing)

OS type/version
22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2

Description
I'm running this JARs inside an OSGI container:

  • jetty-deploy-12.0.15.jar
  • jetty-ee-12.0.15.jar
  • jetty-ee8-nested-12.0.15.jar
  • jetty-ee8-osgi-boot-12.0.15.jar
  • jetty-ee8-security-12.0.15.jar
  • jetty-ee8-servlet-12.0.15.jar
  • jetty-ee8-servlets-12.0.15.jar
  • jetty-ee8-webapp-12.0.15.jar
  • jetty-http-12.0.15.jar
  • jetty-io-12.0.15.jar
  • jetty-jmx-12.0.15.jar
  • jetty-jndi-12.0.15.jar
  • jetty-osgi-12.0.15.jar
  • jetty-plus-12.0.15.jar
  • jetty-security-12.0.15.jar
  • jetty-server-12.0.15.jar
  • jetty-servlet-api-4.0.6
  • jetty-session-12.0.15.jar
  • jetty-util-12.0.15.jar
  • jetty-xml-12.0.15.jar

I get this warning at startup: [org.eclipse.jetty.ee8.webapp.Configurations] Unable to get known Configuration

How to reproduce?
Run the bundles in an OSGi container

Questions
What is the reason for this warning? How can I avoid this warning?

Where can I find the sources for org.eclipse.jetty.ee8.webapp.Configurations? No sources here:
https://github.com/jetty/jetty.project/tree/jetty-12.0.x/jetty-ee8/jetty-ee8-webapp/src/main

@gpfeifer gpfeifer added the Bug For general bugs on Jetty side label Dec 5, 2024
@joakime
Copy link
Contributor

joakime commented Dec 5, 2024

I get this warning at startup: [org.eclipse.jetty.ee8.webapp.Configurations] Unable to get known Configuration

You need add the ServiceLoader support to your OSGi environment.

OSGi, by default, doesn't support ServiceLoader for some odd reason.
A ton of features in Jakarta and Servlet and Web Containers require ServiceLoader to function properly.

https://docs.osgi.org/specification/osgi.enterprise/7.0.0/service.loader.html
https://blog.osgi.org/2013/02/javautilserviceloader-in-osgi.html

Aries Spy-Fly is a popular ServiceLoader support jar for OSGi.

Where can I find the sources for org.eclipse.jetty.ee8.webapp.Configurations? No sources here:
https://github.com/jetty/jetty.project/tree/jetty-12.0.x/jetty-ee8/jetty-ee8-webapp/src/main

Most of jetty-ee8 tree is generated at build time from the jetty-ee9 tree.

@gpfeifer
Copy link
Author

gpfeifer commented Dec 5, 2024

I'm already using this form Aries:

org.apache.aries.spifly.dynamic.bundle-1.3.7.jar

@gpfeifer
Copy link
Author

gpfeifer commented Dec 6, 2024

I have reduced my OSGi based service, so that it contains only one simple 'Hello World' Servlet. I still get this warning, but the servlet works. Attached you will find the log with log level FINEST.

Here is the relevant part:
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.osgi.AbstractContextProvider] BundleContextProvider ignoring bundle com.csc.dip.vpms.server.rest.admin with Web-ContextPath set
[2024-12-06 15:21:03] [FINEST ] [org.eclipse.jetty.osgi.util.BundleFileLocatorHelperFactory] IGNORED
[2024-12-06 15:21:03] [FINEST ] [org.eclipse.jetty.osgi.util.BundleFileLocatorHelperFactory] IGNORED
[2024-12-06 15:21:03] [FINEST ] [org.eclipse.jetty.osgi.util.BundleFileLocatorHelperFactory] IGNORED
[2024-12-06 15:21:03] [INFO ] [org.eclipse.jetty.deploy.DeploymentManager] addApp: App@616598cf[ee8,null,/media/gpf/data/github.dxc/vpms-production/vpms-server/vsrv-deliver/target/VPMS-XE-Server-24.4-20241205_1754/server/vpms-server-data/org.eclipse.osgi/136/0/bundleFile]
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.deploy.DeploymentManager] Executing Node Node[deploying]
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.deploy.AppLifeCycle] Calling org.eclipse.jetty.osgi.OSGiDeployer for App@616598cf[ee8,null,/media/gpf/data/github.dxc/vpms-production/vpms-server/vsrv-deliver/target/VPMS-XE-Server-24.4-20241205_1754/server/vpms-server-data/org.eclipse.osgi/136/0/bundleFile]
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.AbstractLifeCycle] STARTING oejur.ResourceFactoryInternals$LifeCycle@7f17a5bc{STOPPED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.AbstractLifeCycle] STARTED @1960ms oejur.ResourceFactoryInternals$LifeCycle@7f17a5bc{STARTED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] Server@676b58e added {oejur.ResourceFactoryInternals$LifeCycle@7f17a5bc{STARTED},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] Server@676b58e added {org.eclipse.jetty.util.resource.ResourceFactory$2@345d9a6c,POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] CoreContextHandler@38a53b99 added {SymlinkAllowedResourceAliasChecker@5df81cfe{base=null,protected=[]},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] CoreContextHandler@38a53b99 added {oeje8n.ContextHandler$CoreContextHandler$CoreToNestedHandler@7ba3db8e{STOPPED},AUTO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] CoreContextHandler@950352793 added {oeje8n.ContextHandler@33127804.,MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] WebAppContext@856848388 added {oeje8n.ContextHandler$CoreContextHandler@38a53b99{ROOT,/,b=null,a=STOPPED,h=oeje8n.ContextHandler$CoreContextHandler$CoreToNestedHandler@7ba3db8e{STOPPED}},UNMANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] WebAppContext@856848388 added {org.eclipse.jetty.util.DecoratedObjectFactory[decorators=0],POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@784561900 added {oeje8n.SessionHandler$CoreSessionManager@ece5b4d{STOPPED},AUTO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@784561900 added {org.eclipse.jetty.ee8.nested.SessionHandler$CookieConfig@732f8260[name=null,domain=null,path=null,max-age=-1,secure=false,http-only=false,same-site=null,comment=null],POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@784561900 added {[],POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@784561900 added {[],POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@784561900 added {[],POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] WebAppContext@33127804 added {oeje8n.SessionHandler@2ec376ec{STOPPED},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] ConstraintSecurityHandler@1813568076 added {org.eclipse.jetty.util.component.DumpableCollection@61921a13,POJO}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] SessionHandler@2ec376ec added {oeje8s.ConstraintSecurityHandler@6c18da4c{STOPPED},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] ConstraintSecurityHandler@6c18da4c added {oeje8s.ServletHandler@152b1018{STOPPED},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.util.component.ContainerLifeCycle] WebAppContext@33127804 added {oeje8s.ErrorPageErrorHandler@13feb30b{STOPPED},MANAGED}
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.ee8.osgi.boot.EE8Activator] Core classloader = org.eclipse.osgi.internal.loader.EquinoxClassLoader@40a3ac10[org.eclipse.jetty.osgi:12.0.15(id=100)]
[2024-12-06 15:21:03] [FINEST ] [org.eclipse.jetty.osgi.util.BundleClassLoaderHelperFactory] IGNORED
[2024-12-06 15:21:03] [FINE ] [org.eclipse.jetty.ee8.osgi.boot.EE8Activator] Environment classloader = org.eclipse.jetty.osgi.util.OSGiClassLoader@119c6014
[2024-12-06 15:21:03] [WARNING] [org.eclipse.jetty.ee8.webapp.Configurations] Unable to get known Configuration

server-log.0.log

@janbartel
Copy link
Contributor

@gpfeifer it is very likely that you do not have all the necessary bundles deployed. Spifly requires asm and I don't see that in the list of your deployed bundles. Try using your osgi container's tools to dump the deployed bundles and their status.

You can also maybe have a look at the ee9 sources (ee8 being automatically generated from ee9 srcs) for our osgi unit tests to see which bundles we deploy for the various tests: https://github.com/jetty/jetty.project/tree/jetty-12.0.x/jetty-ee9/jetty-ee9-osgi/test-jetty-ee9-osgi/src/test/java/org/eclipse/jetty/ee9/osgi/test

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
None yet
Development

No branches or pull requests

3 participants