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

Jetty 12 EE10 OSGi Boot invalid jetty.xml Handler configuration #11280

Closed
cmark opened this issue Jan 16, 2024 · 2 comments · Fixed by #11284
Closed

Jetty 12 EE10 OSGi Boot invalid jetty.xml Handler configuration #11280

cmark opened this issue Jan 16, 2024 · 2 comments · Fixed by #11284
Labels
Bug For general bugs on Jetty side

Comments

@cmark
Copy link

cmark commented Jan 16, 2024

Jetty version(s)
Jetty 12.0.3 (but according to the source code it affects the current jetty-12 main as well)

Jetty Environment
ee10 (ee8 working without problems)

Java version/vendor (use: java -version)
openjdk version "17.0.9" 2023-10-17
OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)

OS type/version
Microsoft Windows 10 22H2 (OS Build 19045.3930)

Description
When trying to run an embedded Jetty 12 Jakarta EE10 in an OSGi unit test environment via the jetty-ee10-osgi-boot bundle it fails because the jetty.xml file incorrectly references the Handler class from jetty-server module, specifically this line:

    ...
    <Set name="handler">
      <New id="Handlers" class="org.eclipse.jetty.server.handler.Handler.Collection">   <----- Handler interface is in the org.eclipse.jetty.server package not in the handler package.
        <Set name="handlers">
        ...

Replacing the Handler configuration section in the EE10 jetty.xml from the EE8 boot's jetty.xml solves the issue and Jetty 12 can start without any errors.

How to reproduce?
I don't have a simple example project that demonstrates the problem, but if that's needed let me know.

@cmark cmark added the Bug For general bugs on Jetty side label Jan 16, 2024
@joakime
Copy link
Contributor

joakime commented Jan 16, 2024

@janbartel The tree jetty-ee10-osgi/jetty-ee10-osgi-boot/jettyhome/ seems to be totally unused in code at runtime or testing.
The contents of that tree appear to be packaged into the target/jetty-ee10-osgi-boot-<ver>.jar, but nothing refers to it.

We can probably get rid of it.

The up to date XML examples, used in testing, are found in https://github.com/jetty/jetty.project/tree/jetty-12.0.x/jetty-ee10/jetty-ee10-osgi/test-jetty-ee10-osgi/src/test/config/etc

@janbartel
Copy link
Contributor

@joakime see https://eclipse.dev/jetty/documentation/jetty-9/index.html#framework-jetty-osgi. We provide those files inside the boot jar as a convenience for users. We should probably fix their contents, and create/alter at least one unit test to use them rather than externally provided files to ensure their contents are validated.

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

Successfully merging a pull request may close this issue.

3 participants