[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Using Jetty as an OSGi bundle

I am attempting to use Jetty as a bundle in an OSGi framework. I am a few weeks new with OSGi so I will provide what I understand to the best of my knowledge...

My original project has a few OSGi bundles. I figured to start with something small. I am defining only a single class file REST application.

My environment is Eclipse Oxygen, using Java 1.8, and OSGi R6. I am using BndTools plugin for Eclipse. My project is built using the enroute templates. For this project I used the application template.

I placed my existing code in the following repo. I believe the issue is not understanding Jetty to the depth of being able to configure it correctly.

https://github.com/elmer25/jetty-rest

I am referencing the guide atÂÂhttps://www.eclipse.org/jetty/documentation/9.4.x/framework-jetty-osgi.htmlÂfor steps needed to configure Jetty.

I have added the Jetty OSGi bundles defined in Getting Started. I have added annotations defined in the associated link.Â

On customizing the Jetty container, I attempted to set the jetty.http.port. This doesn't work so I would expect. I select the Run As -> Run Configuration -> Environment tab. I define the -Djetty.http.port=8123. The port is still being defined to use port 8080.

When I attempt to access the REST methods, I am receiving a 403 when I go to the path that I defined in the Example.java class file.

Thank you for your help on what I believe is a simple matter.

Cheers,
Jim