Can you create a simple reproducer project in github to see the issue?
Jan
From: J Dadashev <jim.dadashev@xxxxxxxxx>
Sent: Wednesday, December 6, 2023 1:05 AM
To: Jan Supol <jan.supol@xxxxxxxxxx>
Cc: jersey-dev@xxxxxxxxxxx <jersey-dev@xxxxxxxxxxx>
Subject: Re: [External] : [jersey-dev] Jakarta 9 code throws exception at runtime
Thank you Jan.
Unfortunately the error is still there.
Jim
Not sure why the injection does not work. You also need
org.glassfish.jersey.ext:jersey-entity-filtering org.glassfish.jersey.inject:jersey-hk2 org.glassfish.hk2:hk2-api:3.0.5 org.glassfish.hk2:hk2-core:3.0.5 org.glassfish.hk2:hk2-utils:3.0.5 org.glassfish.hk2:hk2-locator:3.0.5 jakarta.inject:2.0.x
--Jan
Thanks for your explanation.
I already have
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>4.0.1</version>
</dependency>
Not Jersey Moxy integration module.
For Jersey 3.1 (Jakarta EE 10 Jersey, not EE 9 as want) you need the actual
org.eclipse.persistence.moxy 4.0.x Moxy. For EE 9 Jersey (3.0.x) you need
org.eclipse.persistence.moxy 3.0.x Moxy.
--Jan
Hi Jan,
I use version 3.1.3
Thanks,
Jim
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>3.1.3</version>
</dependency>
Hi,
My guess is that some injection did not take place. Some dependencies might not be the one Jersey expects (jakarta), I assume. Have you updated the Moxy version, too?
Jan
I converted my code from JavaEE to Jakarta 9 and tried to run it on Jetty11.0.16.
I am getting intermittent exception below.
I was wondering if there was any information regarding that.
Thanks,
Jim
java.lang.NullPointerException: Cannot invoke "org.glassfish.jersey.message.filtering.spi.ObjectProvider.getFilteringObject(java.lang.reflect.Type, boolean, java.lang.annotation.Annotation[])" because the return value of "jakarta.inject.Provider.get()" is null
at org.glassfish.jersey.moxy.json.internal.FilteringMoxyJsonProvider.preWriteTo(FilteringMoxyJsonProvider.java:65)
at org.eclipse.persistence.jaxb.rs.MOXyJsonProvider.writeTo(MOXyJsonProvider.java:982)
|