You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jürgen Weber <we...@gmail.com> on 2024/09/10 18:07:07 UTC

Jersey on Tomcat 10.1

Hi,

I am looking for a working minimal Jersey on Tomcat 10.1 Maven based
REST example.
What I found all give ClassNotFoundExceptions.

Anybody knows an example on github?

Does Jersey even work on Tomcat?

Thx


java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart

<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version3.1.8</version>

<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.0.0</version>

<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>

<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Jersey on Tomcat 10.1

Posted by Jürgen Weber <we...@gmail.com>.
I had found about jersey-client, too, but it did not help.
The exceptions happen in static blocks, so no good information in the
stacktrace.

Am Di., 10. Sept. 2024 um 20:16 Uhr schrieb Sebastian Trost
<ma...@sebastiantrost.de.invalid>:
>
> Jürgen,
>
> On 10.09.2024 20:07, Jürgen Weber wrote:
> > java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
> > java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart
> >
> > <groupId>org.glassfish.jersey</groupId>
> > <artifactId>jersey-bom</artifactId>
> > <version3.1.8</version>
> >
> > <groupId>jakarta.ws.rs</groupId>
> > <artifactId>jakarta.ws.rs-api</artifactId>
> > <version>3.0.0</version>
> >
> > <groupId>org.glassfish.jersey.containers</groupId>
> > <artifactId>jersey-container-servlet</artifactId>
> >
> > <groupId>org.glassfish.jersey.inject</groupId>
> > <artifactId>jersey-hk2</artifactId>
> The manual at
> https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/modules-and-dependencies.html#servlet-app-general
> indicates, that you should also add the dependency "jersey-client".
>
> Sebastian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Jersey on Tomcat 10.1

Posted by Sebastian Trost <ma...@sebastiantrost.de.INVALID>.
Jürgen,

On 10.09.2024 20:07, Jürgen Weber wrote:
> java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
> java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart
>
> <groupId>org.glassfish.jersey</groupId>
> <artifactId>jersey-bom</artifactId>
> <version3.1.8</version>
>
> <groupId>jakarta.ws.rs</groupId>
> <artifactId>jakarta.ws.rs-api</artifactId>
> <version>3.0.0</version>
>
> <groupId>org.glassfish.jersey.containers</groupId>
> <artifactId>jersey-container-servlet</artifactId>
>
> <groupId>org.glassfish.jersey.inject</groupId>
> <artifactId>jersey-hk2</artifactId>
The manual at 
https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/modules-and-dependencies.html#servlet-app-general 
indicates, that you should also add the dependency "jersey-client".

Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Jersey on Tomcat 10.1

Posted by Jürgen Weber <we...@gmail.com>.
interestingly, if you do not specify rs-api,
jersey-container-servlet:jar:3.1.8 pulls in ws.rs-api:jar:3.1.0

[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet:jar:3.1.8:compile
[INFO] |  +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:3.1.8:compile
[INFO] |  |  \- jakarta.inject:jakarta.inject-api:jar:2.0.1:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-common:jar:3.1.8:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
[INFO] |  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-server:jar:3.1.8:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-client:jar:3.1.8:compile
[INFO] |  |  \- jakarta.validation:jakarta.validation-api:jar:3.0.2:compile
[INFO] |  \- jakarta.ws.rs:jakarta.ws.rs-api:jar:3.1.0:compile
[INFO] \- org.glassfish.jersey.inject:jersey-hk2:jar:3.1.8:compile
[INFO]    +- org.glassfish.hk2:hk2-locator:jar:3.0.6:compile
[INFO]    |  +-
org.glassfish.hk2.external:aopalliance-repackaged:jar:3.0.6:compile
[INFO]    |  +- org.glassfish.hk2:hk2-api:jar:3.0.6:compile
[INFO]    |  \- org.glassfish.hk2:hk2-utils:jar:3.0.6:compile
[INFO]    \- org.javassist:javassist:jar:3.30.2-GA:compile

Am Mi., 11. Sept. 2024 um 19:34 Uhr schrieb Jürgen Weber <we...@gmail.com>:
>
> It works with rs-api 4.0.0
>
> Thanks for your help!
>
> <artifactId>jakarta.ws.rs-api</artifactId>
> <version>4.0.0</version>
>
> Am Di., 10. Sept. 2024 um 20:27 Uhr schrieb Thomas Meyer <th...@m3y3r.de>:
> >
> > Hi,
> >
> > Looks correct, see example from GitHub:
> >
> > https://github.com/eclipse-ee4j/jersey/blob/3.1/examples/servlet3-webapp/pom.xml
> >
> > But I assume that Jersey 3.1.x does implement jax-rs 3.1, so maybe that's the reason it cannot find this class.
> >
> > Mfg
> > Thomas
> >
> >
> > Am 10. September 2024 20:07:07 MESZ schrieb "Jürgen Weber" <we...@gmail.com>:
> > >Hi,
> > >
> > >I am looking for a working minimal Jersey on Tomcat 10.1 Maven based
> > >REST example.
> > >What I found all give ClassNotFoundExceptions.
> > >
> > >Anybody knows an example on github?
> > >
> > >Does Jersey even work on Tomcat?
> > >
> > >Thx
> > >
> > >
> > >java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
> > >java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart
> > >
> > ><groupId>org.glassfish.jersey</groupId>
> > ><artifactId>jersey-bom</artifactId>
> > ><version3.1.8</version>
> > >
> > ><groupId>jakarta.ws.rs</groupId>
> > ><artifactId>jakarta.ws.rs-api</artifactId>
> > ><version>3.0.0</version>
> > >
> > ><groupId>org.glassfish.jersey.containers</groupId>
> > ><artifactId>jersey-container-servlet</artifactId>
> > >
> > ><groupId>org.glassfish.jersey.inject</groupId>
> > ><artifactId>jersey-hk2</artifactId>
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > >For additional commands, e-mail: users-help@tomcat.apache.org
> > >
> >
> > --
> > Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Jersey on Tomcat 10.1

Posted by Jürgen Weber <we...@gmail.com>.
It works with rs-api 4.0.0

Thanks for your help!

<artifactId>jakarta.ws.rs-api</artifactId>
<version>4.0.0</version>

Am Di., 10. Sept. 2024 um 20:27 Uhr schrieb Thomas Meyer <th...@m3y3r.de>:
>
> Hi,
>
> Looks correct, see example from GitHub:
>
> https://github.com/eclipse-ee4j/jersey/blob/3.1/examples/servlet3-webapp/pom.xml
>
> But I assume that Jersey 3.1.x does implement jax-rs 3.1, so maybe that's the reason it cannot find this class.
>
> Mfg
> Thomas
>
>
> Am 10. September 2024 20:07:07 MESZ schrieb "Jürgen Weber" <we...@gmail.com>:
> >Hi,
> >
> >I am looking for a working minimal Jersey on Tomcat 10.1 Maven based
> >REST example.
> >What I found all give ClassNotFoundExceptions.
> >
> >Anybody knows an example on github?
> >
> >Does Jersey even work on Tomcat?
> >
> >Thx
> >
> >
> >java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
> >java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart
> >
> ><groupId>org.glassfish.jersey</groupId>
> ><artifactId>jersey-bom</artifactId>
> ><version3.1.8</version>
> >
> ><groupId>jakarta.ws.rs</groupId>
> ><artifactId>jakarta.ws.rs-api</artifactId>
> ><version>3.0.0</version>
> >
> ><groupId>org.glassfish.jersey.containers</groupId>
> ><artifactId>jersey-container-servlet</artifactId>
> >
> ><groupId>org.glassfish.jersey.inject</groupId>
> ><artifactId>jersey-hk2</artifactId>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
> --
> Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Jersey on Tomcat 10.1

Posted by Thomas Meyer <th...@m3y3r.de>.
Hi,

Looks correct, see example from GitHub:

https://github.com/eclipse-ee4j/jersey/blob/3.1/examples/servlet3-webapp/pom.xml

But I assume that Jersey 3.1.x does implement jax-rs 3.1, so maybe that's the reason it cannot find this class.

Mfg
Thomas 


Am 10. September 2024 20:07:07 MESZ schrieb "Jürgen Weber" <we...@gmail.com>:
>Hi,
>
>I am looking for a working minimal Jersey on Tomcat 10.1 Maven based
>REST example.
>What I found all give ClassNotFoundExceptions.
>
>Anybody knows an example on github?
>
>Does Jersey even work on Tomcat?
>
>Thx
>
>
>java.lang.ClassNotFoundException: org.glassfish.jersey.client.ClientConfig
>java.lang.NoClassDefFoundError: jakarta/ws/rs/core/EntityPart
>
><groupId>org.glassfish.jersey</groupId>
><artifactId>jersey-bom</artifactId>
><version3.1.8</version>
>
><groupId>jakarta.ws.rs</groupId>
><artifactId>jakarta.ws.rs-api</artifactId>
><version>3.0.0</version>
>
><groupId>org.glassfish.jersey.containers</groupId>
><artifactId>jersey-container-servlet</artifactId>
>
><groupId>org.glassfish.jersey.inject</groupId>
><artifactId>jersey-hk2</artifactId>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

-- 
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.