@javax.json.bind.annotation.JsonbTypeSerializer(Serializer.class) @jakarta.json.bind.annotation.JsonbTypeSerializer(JakartaSerializer.class)
public final class DataModel implements Comparable<DataModel>, Serializable {
…
}
and Serializer’s
public class JakartaSerializer implements JsonbSerializer<DataModel> {
…
}
public class Serializer implements JsonbSerializer<DataModel> {
…
}
When i invoke remote ejb with
<dependency>
<groupId>fish.payara.extras</groupId>
<artifactId>ejb-http-client</artifactId>
<version>5.2022.5</version>
</dependency>
custom serializer work perfect
When i use
<dependency>
<groupId>fish.payara.extras</groupId>
<artifactId>ejb-http-client</artifactId>
<version>6.2023.10</version>
</dependency>
custom serializer don’t work.
What am I doing wrong?
Hi Max,
let me double-check:
Do you have 2 sources, 1 for Jakarta 8/javax and one for Jakarta 10/jakarta or just one source with both dependencies and annotations?
If you have both, I suppose you use JsonbSerializer from the javax package. This would result in Jakarta 10 not finding this serializer.
@jakarta.json.bind.annotation.JsonbTypeSerializer(JakartaSerializer.class) @jakarta.json.bind.annotation.JsonbTypeDeserializer(JakartaDeserializer.class)
public final class DataModel implements Comparable<DataModel>, Serializable {
…
}
When i use
Jsonb jsonb = JsonbBuilder.create();
jsonb.toJson(model);
custom serializer run perfectly.
When i run
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, RemoteEJBContextFactory.FACTORY_CLASS);
properties.put(Context.PROVIDER_URL, “http://localhost:8080/ejb-invoker”);
Context context = new InitialContext(properties);
TestRemote lookup = (TestRemote) context.lookup(“java:global/MyApp/Test!” + TestRemote.class.getName());
lookup.test(model);
Custom serializer don’t run. (Custom deserializer run perfectly)