eclipse-ee4j / eclipse-ee4j/jersey

Running Jersey in Jetty using JettyHttpContainerFactory does not support anything but root (/*) application path

Open
#6,026 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Using Jetty 12.1, Weld 6 (weld-se), Jersey 3.11 and `jersey-cdi2-se` for jersey/weld integration so weld-se is started by Jersey and the app (otherwise Jersey beans are not available for injection)

both places where `app-path` is used in attempt to have jersey handle http://localhost:8080/my-app-path/

as result all calls to jersey are /* not /my-app-path/* and I am forced to annotate all jersey resources as /my-app-path/

```
final Server server = JettyHttpContainerFactory.createServer(URI.create(http://localhost:8080/my-app-path), new WebApplication(), false);

@jakarta.ws.rs.ApplicationPath("/my-app-path")
@Vetoed
public class WebApplication extends ResourceConfig {

```

it is not surprising that @jakarta.ws.rs.ApplicationPath("/my-app-path") is ignored since I am forced to explicitly create WebApplication() in `JettyHttpContainerFactory.createServer()` call above so jersey does not scan and instantiate WebApplication.
I had to @Vetoed the app so CDI won't try to instantiate it second time

According to javadocs fist path element of URI in `JettyHttpContainerFactory.createServer()` call is supposed to be used but it is not

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.