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

Add an example of a Jersey OSGi bundle for Jetty 12 (ee8) #5524

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

gpfeifer
Copy link

A very minimalistic example of a Jersey OSGi Bundle which can be deployed in an OSGi container with Jetty 12 (ee8).

@jansupol
Copy link
Contributor

Please sign ECA. See here.

@jansupol
Copy link
Contributor

jansupol commented Feb 6, 2024

@gpfeifer I can see the ECA has been signed, but for some reason, the Eclipse ECA validation tool validates against gpfeifer@d*c DOT com, ie not against the signed-off-by address. I'll try to bug Eclipse about it.

@jansupol
Copy link
Contributor

jansupol commented Feb 6, 2024

@gpfeifer It has the Author header different from the email the ECA is signed with. Can you please update the Author header in the commit?

@gpfeifer
Copy link
Author

gpfeifer commented Feb 6, 2024

Changed the author (hopefully)

Signed-off-by: Gregor Pfeifer <gregor.pfeifer.gp@gmail.com>
@jansupol
Copy link
Contributor

jansupol commented Feb 7, 2024

@gpfeifer Yes, that did the trick, thank you.

@jansupol
Copy link
Contributor

jansupol commented Feb 8, 2024

@gpfeifer What is it exactly that makes the app running on Jetty 12? Is it just the lines

                   <Jetty-Environment>ee8</Jetty-Environment>
                   <_wab>src/main/webapp</_wab>

Or is there something more?

@gpfeifer
Copy link
Author

gpfeifer commented Feb 9, 2024

Two things makes the app running on Jetty 12:

Manifest.mf

In addition to the other entries there must be:

Jetty-Environment=ee8

web.xml

The Jersey ServletContainer must be initialized with a Jersey ResourceConfig. Jersey Application should also work, but I didn't tested this

<servlet>
    <servlet-name>Jersey Web Application</servlet-name>
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
    <init-param>
        <param-name>javax.ws.rs.Application</param-name>
        <param-value>org.glassfish.jersey.examples.osgi.helloworld.HelloResourceConfig</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants