Migrating from Glassfish to Payara(Jersey 1.x to jersey 2.x)

145 views
Skip to first unread message

Priyanka Dubey

unread,
Sep 17, 2021, 8:30:49 AM9/17/21
to Payara Forum
Hi All,

I am trying to migrate an application from glassfish to Payara 5, existing code has reference to the com.sun.jersey.client, com.sun.jersey.server and com.sun.jersey.servlet dependencies.
When deploying the application on Payara I am getting below error:
java.lang.NoSuchMethodError: com.sun.jersey.core.reflection.ReflectionHelper.classForNameWithExceptionPEA(Ljava/lang/String;)Ljava/security/PrivilegedExceptionAction;


While troubleshooting I tried as below :
1.I added the below dependency:
<dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-core</artifactId> <version>1.17.1</version> </dependency>
But no luck.

2.I also tried adding the latest version of jersey available in maven:
<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-client</artifactId>
    <version>2.26</version>
</dependency>
And other related dependencies.

Please advice how to fix it.

Thanks,
Priyanka



Alexander Pinchuk

unread,
Sep 17, 2021, 1:42:08 PM9/17/21
to Payara Forum
Hi, Priyanka!


Regards

пятница, 17 сентября 2021 г. в 15:30:49 UTC+3, priyankal...@gmail.com:

Rudy De Busscher

unread,
Sep 20, 2021, 2:47:29 AM9/20/21
to Payara Forum
Hi,

Jakarta 8 (and thus Payara 5) have already a Rest client included. No need for additional dependencies.

If you want to use an old or specific version of Jersey Client, include it in your application and define the class loading as mentioned by Alexander.

Regards
Rudy

Reply all
Reply to author
Forward
0 new messages