Eclipse Yasson project

Related tags

JSON yasson
Overview

Eclipse Yasson

Maven Central Sonatype Nexus (Snapshots) Gitter Javadocs Build Status License

Yasson is a Java framework which provides a standard binding layer between Java classes and JSON documents. This is similar to what JAXB is doing in the XML world. Yasson is an official reference implementation of JSON Binding (JSR-367).

It defines a default mapping algorithm for converting existing Java classes to JSON suitable for the most cases:

Jsonb jsonb = JsonbBuilder.create();
String result = jsonb.toJson(someObject);

For whom it's not enough it provides rich customization abilities through a set of annotations and rich programmatic API:

// Create custom configuration
JsonbConfig config = new JsonbConfig()
  .withNullValues(true)
  .withFormating(true);

// Create Jsonb with custom configuration
Jsonb jsonb = JsonbBuilder.create(config);

// Use it!
String result = jsonb.toJson(someObject);

Questions?

Something not working right? Have an idea for an enhancement? Get in touch with the Yasson community in the following ways:

  • Gitter: a free instant-messaging platform (similar to Slack) that anyone can join.
  • Stackoverflow: As a question tagged [jsonb-api] and [yasson]
  • Github Issues: Open issues for enhancement ideas or bug reports

Licenses

Links

Comments
  • json string prints new line between property and value

    json string prints new line between property and value

    When printing any json string to the logger (e.g. slf4j, log4j), then the output in the console is:

    // json string prints new line between property and value
    {
     "id": 
      1,
      "name":
      "ted",
      "description": null
    }
    

    instead of

    {
      "id": 1,
      "name": "ted",
      "description": null
    }
    

    tested with org.eclipse.yasson 1.0.4

    opened by nimo23 17
  • CollectionSerializer only processes first entry

    CollectionSerializer only processes first entry

    Hello together, I am currently struggling with deserializing a List using a custom deserializer for the generic type of the list. I think that I am missing something obvious but I can't get it to work and I didn't find any issue related to mine. My simplified implementation:

    @JsonbTypeDeserializer(ProxyDeserializer.class)
    public interface User {
        // only getters (following Java naming convention)
    }
    
    public class ProxyDeserializer implements JsonbDeserializer<Object> {
        public Object deserialize(final JsonParser parser, final DeserializationContext ctx, final Type rtType) {
            final JsonObject value = ctx.deserialize(JsonObject.class, parser);
            final Proxy proxy = ... // Create a Java dynamic proxy for rtType (User.class) and the JsonObject
            return proxy;
        }
    }
    

    In my test I am executing a GET as followed:

    ClientBuilder.newClient().target(url)
        .buildGet()
        .invoke(new GenericType<List<User>>() {
        });
    

    But I only get a List with one entry. My deserializer is not called a second time. I am using Yasson 1.0.3 in a Wildfly 14 container.

    I appreciate any hint!

    bug 
    opened by ghost 17
  • Fix JsonbTransient on getters and setters

    Fix JsonbTransient on getters and setters

    If @JsonbTransient is placed on getter implementation must not serialize this property. If @JsonbTransient is placed on setter implementation must not deserialize this property. If @JsonbTransient is placed on field implementation must not serialize and deserialize this property.

    bug 
    opened by m0mus 14
  • Yasson on SpringBoot: IOException Stream Closed

    Yasson on SpringBoot: IOException Stream Closed

    Hi guys,

    In Spring Boot 2.2.5, one can choose their own json provider.

    1. Exclude the default Jackson
    2. Add the Yasson dependency in pom.xml (which also brings the JSON-B API + JSON-P)
    <dependency>
        <groupId>org.eclipse</groupId>
        <artifactId>yasson</artifactId>
        <version>1.0.6</version>
        <scope>runtime</scope>
    </dependency>
    
    1. Specify in application.properties the following: spring.http.converters.preferred-json-mapper=jsonb

    This setup seems to work like a charm, except the logs contain an error at each request:

    2020-03-16 16:09:20.306 ERROR 1540 --- [io-8090-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
    
    java.io.IOException: Stream closed
            at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:45) ~[na:1.8.0_202]
            at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:140) ~[na:1.8.0_202]
            at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229) ~[na:1.8.0_202]
            at org.springframework.http.converter.json.AbstractJsonHttpMessageConverter.writeInternal(AbstractJsonHttpMessageConverter.java:130) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:104) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:287) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor.handleReturnValue(HttpEntityMethodProcessor.java:226) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:82) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:124) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.4.RELEASE.jar:5.2.4.RELEASE]
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_202]
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_202]
            at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.31.jar:9.0.31]
            at java.lang.Thread.run(Thread.java:748) [na:1.8.0_202]
    
    
    2020-03-16 16:09:20.354 ERROR 1540 --- [io-8090-exec-10]
    s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request [/country] and exception [Stream closed] as the response has already been committed. As a result, the response may have the wrong status code.
    
    

    Apparently more people are having the same issue. See here and here.

    Any idea why this could happen? Do you think it's a bug in Yasson or in Spring Boot? Since the error does not occur with Jackson, I assume it could also be a bug in Yasson.

    bug 
    opened by amihaiemil 13
  • Refactor strategies to functions instead of using inheritance

    Refactor strategies to functions instead of using inheritance

    • No changes in behaviour.
    • Removed 2 packages: .../customization/naming and .../customization/ordering with all strategy classes, moved PropertyOrdering.class to .../customization.
    • New class in .../customization: 'StrategiesProvider', that contains 2 static functions to select the correct strategy. It also contains all internal functions that are needed for the implementations of the strategies.
    • Fixed PropertyNaming test to use StrategiesProvider.
    • Got rid of an optional usage in JsonConfigProperties (getPropertyOrderStrategy return value), it was never shared outside of the class, not better than an explicit null check.
    • Less use of inheritance, less classes, more functions.
    • The only thing that might be questionable is replacing PropOrderStrategy with Function<Collection, List> because it's so long. I did it anyway, because the PropOrderStrategy interface was in an internal package and it didn't do anything special.

    Signed-off-by: Gyúróczki Gergő [email protected]

    enhancement 
    opened by Degubi 13
  • Turn JsonbComponentInstanceCreator into a service provider interface

    Turn JsonbComponentInstanceCreator into a service provider interface

    So that an integrator could provide a custom implementation of this interface. JsonbComponentInstanceCreatorFactory currently contains some reflection magic to detect the presence of a CDI container. In fact, the presence of the CDI API is enough.

    I believe it would be reasonable to define this SPI. Quarkus integration would definitely make use of it because our DI solution is compatible with CDI but we don't support all "portable extensions related" SPIs (they do not fit into our build time metadata processing approach) and so the invocation of the BeanManagerInstanceCreator#getOrCreateComponent() fails.

    enhancement 
    opened by mkouba 13
  • Yasson 3 fails to serialize a null Optional

    Yasson 3 fails to serialize a null Optional

    Describe the bug Yasson 3 is unable to serialize a null Optional, leading to a NullPointerException.

    jakarta.json.bind.JsonbException: Unable to serialize property 'optionalString' from io.quarkus.it.mongodb.pojo.Pojo
    	at org.eclipse.yasson.internal.serializer.ObjectSerializer.lambda$serialize$0(ObjectSerializer.java:43)
    	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
    	at org.eclipse.yasson.internal.serializer.ObjectSerializer.serialize(ObjectSerializer.java:38)
    	at org.eclipse.yasson.internal.serializer.RecursionChecker.serialize(RecursionChecker.java:38)
    	at org.eclipse.yasson.internal.serializer.KeyWriter.serialize(KeyWriter.java:41)
    	at org.eclipse.yasson.internal.serializer.NullVisibilitySwitcher.serialize(NullVisibilitySwitcher.java:40)
    	at org.eclipse.yasson.internal.serializer.NullSerializer.serialize(NullSerializer.java:67)
    	at org.eclipse.yasson.internal.SerializationContextImpl.serializeObject(SerializationContextImpl.java:197)
    	at org.eclipse.yasson.internal.SerializationContextImpl.marshall(SerializationContextImpl.java:133)
    	at org.eclipse.yasson.internal.SerializationContextImpl.marshall(SerializationContextImpl.java:159)
    	at org.eclipse.yasson.internal.JsonBinding.toJson(JsonBinding.java:121)
    	at io.quarkus.it.mongodb.OptionalTest.optional_null(OptionalTest.java:18)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
    	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
    	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
    	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
    	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
    	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:217)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:213)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:138)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:147)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:127)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:90)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:55)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:102)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:54)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    	at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:55)
    	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:223)
    	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:175)
    	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:139)
    	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:456)
    	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:169)
    	at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:595)
    	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:581)
    Caused by: java.lang.NullPointerException
    	at org.eclipse.yasson.internal.serializer.OptionalSerializer.serialize(OptionalSerializer.java:36)
    	at org.eclipse.yasson.internal.serializer.ValueGetterSerializer.serialize(ValueGetterSerializer.java:43)
    	at org.eclipse.yasson.internal.serializer.ObjectSerializer.lambda$serialize$0(ObjectSerializer.java:41)
    	... 82 more
    

    It worked with Yasson 1.0.11 but not with Yasson 3.0.1

    To Reproduce

            Jsonb jsonb = JsonbBuilder.create();
            Pojo pojo = new Pojo();
            pojo.description = "description";
            String pojoJson = jsonb.toJson(pojo);
            System.out.println(pojoJson);
            Pojo deserialized = jsonb.fromJson(pojoJson, Pojo.class);
    

    Expected behavior Serializing a null Optional works as expected.

    System information:

    • OS: Linux
    • Java Version: 11
    • Yasson Version: 3.0.1
    bug 
    opened by loicmathieu 12
  • Add support for EnumMap and Maps with stringable keys

    Add support for EnumMap and Maps with stringable keys

    Fixes #283

    Adds support for:

    • Map key types that are stringable (provides a static valueOf(String) or fromString(String) method)
    • Support for EnumMap
    • Improve error messages for when Yasson fails to deserialize a value by including the attempted value and the nested exception
    duplicate enhancement 
    opened by aguibert 12
  • How to exclude Weld metadata from JSON object serialization by Yasson

    How to exclude Weld metadata from JSON object serialization by Yasson

    Details posted here:

    https://stackoverflow.com/questions/56951279/how-to-exclude-weld-metadata-from-json-object-serialization-by-yasson

    Here is approximate call stack: at org.eclipse.yasson.internal.model.GetValueCommand.getValue(GetValueCommand.java:36) at org.eclipse.yasson.internal.model.ReflectionPropagation.getValue(ReflectionPropagation.java:73) at org.eclipse.yasson.internal.model.PropertyModel.getValue(PropertyModel.java:285) at org.eclipse.yasson.internal.serializer.ObjectSerializer.marshallProperty(ObjectSerializer.java:80) at org.eclipse.yasson.internal.serializer.ObjectSerializer.serializeInternal(ObjectSerializer.java:61) at org.eclipse.yasson.internal.serializer.AbstractContainerSerializer.serialize(AbstractContainerSerializer.java:64) at org.eclipse.yasson.internal.Marshaller.serializeRoot(Marshaller.java:148) at org.eclipse.yasson.internal.Marshaller.marshall(Marshaller.java:76) at org.eclipse.yasson.internal.Marshaller.marshall(Marshaller.java:102) at org.eclipse.yasson.internal.JsonBinding.toJson(JsonBinding.java:153) at com.ibm.ws.jaxrs21.providers.json.JsonBProvider.writeTo(JsonBProvider.java:171) at org.apache.cxf.jaxrs.utils.JAXRSUtils$3.run(JAXRSUtils.java:1474) at org.apache.cxf.jaxrs.utils.JAXRSUtils$3.run(JAXRSUtils.java:1471) at java.security.AccessController.doPrivileged(AccessController.java:703) at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1471) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:249) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:124) at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:85) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:90) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:124) at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:275) at com.ibm.ws.jaxrs20.endpoint.AbstractJaxRsWebEndpoint.invoke(AbstractJaxRsWebEndpoint.java:134)

    question 
    opened by akovac35 12
  • fix custom deserializer not working with generic types

    fix custom deserializer not working with generic types

    support for generic type and type variable deserialization with custom deserializer

    Signed-off-by: Alessandro Moscatelli [email protected]

    opened by amoscatelli 11
  • PropertyNamingStrategy translates property names of properties that should not be visible

    PropertyNamingStrategy translates property names of properties that should not be visible

    Currently the PropertyNamingStrategy#translateName method is called on all class fields and methods, regardless of the PropertyVisibilityStrategy assigned. I would assume that those 'invisible' properties would not have any reason to have their property name translated.

    This led to another somewhat edge case where using a lowercase PropertyNamingStrategy leads to a property being ignored:

    JsonbConfig config = new JsonbConfig().withPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CASE_WITH_UNDERSCORES);
    Jsonb jsonb = JsonbBuilder.create(config);
    Widget widget = new Widget();
    Widget2 widget2 = new Widget2();
    String widgetJson = jsonb.toJson(widget); //  {"url":"getter#www.google.com"}
    String widget2Json = jsonb.toJson(widget2); // {}
    
    public class Widget  {
    
            private String url = "www.google.com";
    
            public String getUrl() {
                return "getter#" + url;
            }
    
        }
    
    public class Widget2  {
    
            private String url = "www.google.com";
    
            public String getURL() {
                return "getter#" + url;
            }
    
        }
    

    Because the naming strategy changes 'URL' to 'url' in Widget2, it seems to conflict with the private 'url' field, and although no exception is thrown, no value is returned either. According to the default visibility strategy, the private 'url' field should not visible, so is the fact that a 'invisible' field can cause a conflict with a visible public method a separate issue in itself?

    bug 
    opened by etay2000 11
  • PropertyNamingStrategy is not considered for JsonbCreators

    PropertyNamingStrategy is not considered for JsonbCreators

    Describe the bug

    PropertyNamingStrategy is not considered for records

    To Reproduce

    • Create a record with camelCase fields
    • Add a constructor (no parameters, no implementation) with @JsonbCreator.
    • Create a propertyVisibilityStrategy:
      static class PrivateVisibilityStrategy implements PropertyVisibilityStrategy {
    
        @Override
        public boolean isVisible(Field field) {
          return true;
        }
    
        @Override
        public boolean isVisible(Method method) {
          return false;
        }
      }
    
    • Use the naming Strategy with underscores
    • Put it all together
            new JsonbConfig()
                .withAdapters(new AuthorIdAdapter())
                .withNullValues(Boolean.TRUE)
                .withFormatting(Boolean.TRUE)
                .withPropertyVisibilityStrategy(new PrivateVisibilityStrategy())
                .withPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CASE_WITH_UNDERSCORES);
    

    Try to read a JSON file and see this error:

    jakarta.json.bind.JsonbException: JsonbCreator parameter firstName is missing in json document.
    

    Expected behavior

    SHould have used first_name instead.

    System information:

    • OS: Linux
    • Java Version: 17 semeru
    • Yasson Version: 2.0.4 and 3.0.2

    Additional context

    Example on this commit: https://github.com/bmarwell/jaxrs-test-showcase/pull/61/commits/71348e8d153300a4699ec33314bb577ec1c87228

    bug 
    opened by bmarwell 3
  • Deceptive exception: Cannot serialize java.time.Instant, IllegalAccessException: class is not public

    Deceptive exception: Cannot serialize java.time.Instant, IllegalAccessException: class is not public

    When serializing a class with an Instant field, I get an exception: Caused by: java.lang.IllegalAccessException: class is not public: .../java.time.Instant/getField, from public Lookup at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:955) at java.base/java.lang.invoke.MethodHandles$Lookup.checkAccess(MethodHandles.java:3882) at java.base/java.lang.invoke.MethodHandles$Lookup.checkField(MethodHandles.java:3832) at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectFieldCommon(MethodHandles.java:4045) at java.base/java.lang.invoke.MethodHandles$Lookup.getDirectFieldNoSecurityManager(MethodHandles.java:4040) at java.base/java.lang.invoke.MethodHandles$Lookup.unreflectField(MethodHandles.java:3504) at java.base/java.lang.invoke.MethodHandles$Lookup.unreflectGetter(MethodHandles.java:3455) at org.eclipse.yasson.internal.model.PropertyModel.createReadHandle(PropertyModel.java:518) ... 35 common frames omitted

    It is not that the Instant class is not public, neither the return value or parameter type of getField, but the class containing the Instant field.

    System information:

    • Java Version: 17.0.5
    • Yasson Version: 3.0.2
    bug 
    opened by hontvari 0
  • Can't use Yasson in a Java EE 7 environment because java:comp/BeanManager is not jakarta.enterprise.inject.spi.BeanManager

    Can't use Yasson in a Java EE 7 environment because java:comp/BeanManager is not jakarta.enterprise.inject.spi.BeanManager

    Describe the bug I'm trying to use JSON-B 2 (from Jakarta EE 9) and Yasson 2 in an application that will be deployed on IBM WebSphere Application Server 9, which is a Java EE 7 environment. I know this is unusual, but it mostly works except for the below issue.

    Yasson tries to use JNDI to lookup java:comp/BeanManager and use it if it exists. The first problem is that jakarta.enterprise.inject.spi.BeanManager is not in the classpath, so we get a NoClassDefFoundError:

    Caused by: java.lang.NoClassDefFoundError: jakarta/enterprise/inject/spi/BeanManager
    	at org.eclipse.yasson.internal.components.BeanManagerInstanceCreator.<init>(BeanManagerInstanceCreator.java:49)
    	at org.eclipse.yasson.internal.components.JsonbComponentInstanceCreatorFactory.getComponentInstanceCreator(JsonbComponentInstanceCreatorFactory.java:69)
    	at org.eclipse.yasson.internal.JsonbContext.initComponentInstanceCreator(JsonbContext.java:148)
    	at org.eclipse.yasson.internal.JsonbContext.<init>(JsonbContext.java:64)
    	at org.eclipse.yasson.internal.JsonBinding.<init>(JsonBinding.java:49)
    	at org.eclipse.yasson.internal.JsonBindingBuilder.build(JsonBindingBuilder.java:61)
    	at jakarta.json.bind.JsonbBuilder.create(JsonbBuilder.java:86)
    	at com.example.TestBean.<init>(TestBean.java:11)
    

    After adding jakarta.enterprise:jakarta.enterprise.cdi-api jars, we get a more understandable error:

    Caused by: jakarta.json.bind.JsonbException: Internal error: beanManager instance should be of type 'interface jakarta.enterprise.inject.spi.BeanManager'
    	at org.eclipse.yasson.internal.components.BeanManagerInstanceCreator.<init>(BeanManagerInstanceCreator.java:50)
    	at org.eclipse.yasson.internal.components.JsonbComponentInstanceCreatorFactory.getComponentInstanceCreator(JsonbComponentInstanceCreatorFactory.java:69)
    	at org.eclipse.yasson.internal.JsonbContext.initComponentInstanceCreator(JsonbContext.java:148)
    	at org.eclipse.yasson.internal.JsonbContext.<init>(JsonbContext.java:64)
    	at org.eclipse.yasson.internal.JsonBinding.<init>(JsonBinding.java:49)
    	at org.eclipse.yasson.internal.JsonBindingBuilder.build(JsonBindingBuilder.java:61)
    	at jakarta.json.bind.JsonbBuilder.create(JsonbBuilder.java:86)
    	at com.example.TestBean.<init>(TestBean.java:11)
    

    To Reproduce Here's a simple maven project that reproduces the issue: test-servlet.zip

    Expected behavior

    To fix this, I suggest changing JsonbComponentInstanceCreatorFactory as follows:

    1. If jakarta.enterprise.inject.spi.BeanManager is not in the classpath, then it should skip trying to get a BeanManager from CDI or JNDI and jump directly to using DefaultConstructorCreator.
    2. If jakarta.enterprise.inject.spi.BeanManager is in the classpath but getJndiBeanManager somehow returned a javax.enterprise.inject.spi.BeanManager instead (note the javax), then just ignore it and use DefaultConstructorCreator.

    System information:

    • OS: Linux
    • Java Version: 8
    • Yasson Version: 2.0.4

    Additional context I was also able to reproduce this error using Open Liberty server with the javaee-7.0 feature enabled.

    bug 
    opened by e6c31d 0
  • Support retrieving lower bound from TypeVariable in Collection attribute

    Support retrieving lower bound from TypeVariable in Collection attribute

    https://github.com/eclipse-ee4j/yasson/issues/579

    The issue is related to TypeVariable having a GenericDeclaration different from the expected inherited one. In the example described in the issue, the GenericDeclaration is FindRequestDTO, and that doesn't match with FindCriteriaDTO.

    This is an issue for https://github.com/eclipse-ee4j/yasson/blob/master/src/main/java/org/eclipse/yasson/internal/VariableTypeInheritanceSearch.java#L98

    Tell me if you need a more structured approach.

    Thank you

    opened by amoscatelli 4
  • Generic bound not found in deserialization

    Generic bound not found in deserialization

    Describe the bug

    Defined this endpoint :

    public abstract class AbstractIdentifiableResource<T extends Identifiable, D extends IdentifiableDTO, C extends IdentifiableController<T>> extends AbstractEndpoint<T, D, C> implements IdentifiableEndpoint<T, D> {
    
        @POST
        @Path("find")
        @Consumes(MediaType.APPLICATION_JSON)
        @Produces(MediaType.APPLICATION_JSON)
        public FindResultDTO<D> find(FindRequestDTO<D> request) {
            return this.find(request.getCriterias(), request.getOrders(), request.getQuantity(), request.getOffset());
        }
    
    }
    
    

    And this parameter

    public class FindRequestDTO<T extends IdentifiableDTO> extends RequestDTO {
        
        private Collection<FindCriteriaDTO<T>> criterias;
    
        public Collection<FindCriteriaDTO<T>> getCriterias() {
            return criterias;
        }
    
        public void setCriterias(Collection<FindCriteriaDTO<T>> criterias) {
            this.criterias = criterias;
        }
    
    }
    

    I get this error during deserialization :

    11:18:01,241 ERROR [org.jboss.resteasy.core.providerfactory.DefaultExceptionMapper] (default task-1) RESTEASY002375: Error processing request POST /optoplus-services-web/api/credentialgrouping/find - org.visiontech.commons.authentication.impl.resource.CredentialGroupingResource.find: jakarta.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error: jakarta.json.bind.JsonbException: Internal error: Generic bound not found for type T declared in java.util.Collection<org.visiontech.commons.persistence.api.dto.FindCriteriaDTO<T>>.
    	at [email protected]//org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:80)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:101)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.ServerReaderInterceptorContext.readFrom(ServerReaderInterceptorContext.java:63)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:80)
    	at [email protected]//org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:35)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:88)
    	at [email protected]//org.jboss.resteasy.plugins.interceptors.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:111)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:88)
    	at [email protected]//org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:213)
    	at [email protected]//org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:95)
    	at [email protected]//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:128)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:408)
    	at [email protected]//org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:69)
    	at [email protected]//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
    	at [email protected]//org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
    	at [email protected]//org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
    	at [email protected]//org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
    	at [email protected]//org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
    	at [email protected]//org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
    	at [email protected]//org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:249)
    	at [email protected]//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:60)
    	at [email protected]//org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
    	at [email protected]//jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
    	at [email protected]//io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
    	at [email protected]//io.undertow.websockets.jsr.JsrWebSocketFilter.doFilter(JsrWebSocketFilter.java:172)
    	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at io.smallrye.opentracing-contrib//io.smallrye.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:69)
    	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at [email protected]//jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:126)
    	at deployment.optoplus.ear//org.visiontech.commons.persistence.impl.AbstractTransactionFilter.doFilter(AbstractTransactionFilter.java:30)
    	at [email protected]//jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
    	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at deployment.optoplus.ear//org.visiontech.commons.security.impl.http.AbstractRestrictionFilter.doFilter(AbstractRestrictionFilter.java:68)
    	at [email protected]//jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
    	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at deployment.optoplus.ear//org.visiontech.commons.security.impl.http.AbstractOptionsFilter.doFilter(AbstractOptionsFilter.java:18)
    	at [email protected]//jakarta.servlet.http.HttpFilter.doFilter(HttpFilter.java:97)
    	at [email protected]//io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:67)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
    	at [email protected]//io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
    	at [email protected]//io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
    	at [email protected]//io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
    	at [email protected]//io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
    	at [email protected]//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.lambda$handleRequest$1(ElytronRunAsHandler.java:68)
    	at [email protected]//org.wildfly.security.auth.server.FlexibleIdentityAssociation.runAsFunctionEx(FlexibleIdentityAssociation.java:103)
    	at [email protected]//org.wildfly.security.auth.server.Scoped.runAsFunctionEx(Scoped.java:161)
    	at [email protected]//org.wildfly.security.auth.server.Scoped.runAs(Scoped.java:73)
    	at [email protected]//org.wildfly.elytron.web.undertow.server.ElytronRunAsHandler.handleRequest(ElytronRunAsHandler.java:67)
    	at [email protected]//io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
    	at [email protected]//io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
    	at [email protected]//io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
    	at [email protected]//io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
    	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at [email protected]//io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53)
    	at [email protected]//io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
    	at [email protected]//io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
    	at [email protected]//io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59)
    	at [email protected]//io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
    	at org.wildfly.security.elytron-web.undertow-server-servlet@3.0.0.Final//org.wildfly.elytron.web.undertow.server.servlet.CleanUpHandler.handleRequest(CleanUpHandler.java:38)
    	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at [email protected]//org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
    	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at [email protected]//org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
    	at [email protected]//io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)
    	at [email protected]//io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
    	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)
    	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)
    	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)
    	at [email protected]//io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
    	at [email protected]//io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
    	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
    	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
    	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
    	at [email protected]//org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1435)
    	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
    	at [email protected]//io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)
    	at [email protected]//io.undertow.server.Connectors.executeRootHandler(Connectors.java:391)
    	at [email protected]//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
    	at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    	at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
    	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    	at [email protected]//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
    	at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: jakarta.json.bind.JsonbException: Internal error: Generic bound not found for type T declared in java.util.Collection<org.visiontech.commons.persistence.api.dto.FindCriteriaDTO<T>>.
    	at org.eclipse.yasson//org.eclipse.yasson.internal.DeserializationContextImpl.deserializeItem(DeserializationContextImpl.java:142)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.DeserializationContextImpl.deserialize(DeserializationContextImpl.java:127)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.JsonBinding.deserialize(JsonBinding.java:55)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.JsonBinding.fromJson(JsonBinding.java:69)
    	at deployment.optoplus.ear//org.visiontech.commons.service.impl.JsonbPolymorphicDeserializer.deserialize(JsonbPolymorphicDeserializer.java:104)
    	at deployment.optoplus.ear//org.visiontech.commons.service.impl.JsonbPolymorphicDeserializer.deserialize(JsonbPolymorphicDeserializer.java:33)
    	at deployment.optoplus.ear//org.visiontech.commons.service.impl.JsonbPolymorphicDeserializer$Proxy$_$$_WeldClientProxy.deserialize(Unknown Source)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.UserDefinedDeserializer.deserialize(UserDefinedDeserializer.java:69)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.UserDefinedDeserializer.deserialize(UserDefinedDeserializer.java:26)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.DeserializationContextImpl.deserializeItem(DeserializationContextImpl.java:138)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.DeserializationContextImpl.deserialize(DeserializationContextImpl.java:127)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.JsonBinding.deserialize(JsonBinding.java:55)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.JsonBinding.fromJson(JsonBinding.java:95)
    	at [email protected]//org.jboss.resteasy.plugins.providers.jsonb.ManagedJsonb.fromJson(ManagedJsonb.java:73)
    	at [email protected]//org.jboss.resteasy.plugins.providers.jsonb.JsonBindingProvider.readFrom(JsonBindingProvider.java:72)
    	... 95 more
    Caused by: java.lang.IllegalStateException: Generic bound not found for type T declared in java.util.Collection<org.visiontech.commons.persistence.api.dto.FindCriteriaDTO<T>>.
    	at org.eclipse.yasson//org.eclipse.yasson.internal.ReflectionUtils.resolveTypeArguments(ReflectionUtils.java:248)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.ReflectionUtils.resolveType(ReflectionUtils.java:141)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.ReflectionUtils.resolveType(ReflectionUtils.java:126)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.DeserializationModelCreator.createCollectionDeserializer(DeserializationModelCreator.java:271)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.DeserializationModelCreator.deserializerChainInternal(DeserializationModelCreator.java:183)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.DeserializationModelCreator.deserializerChain(DeserializationModelCreator.java:135)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.deserializer.DeserializationModelCreator.deserializerChain(DeserializationModelCreator.java:123)
    	at org.eclipse.yasson//org.eclipse.yasson.internal.DeserializationContextImpl.deserializeItem(DeserializationContextImpl.java:137)
    	... 109 more
    

    To Reproduce I pasted some example code above

    Expected behavior I believe it should be able to detect IdentifiableDTO as the bound.

    System information:

    • OS: Windows
    • Java Version: 11
    • Yasson Version: 3.0.1

    Additional context Migrating to Wildfly 27

    bug 
    opened by amoscatelli 0
Releases(3.0.2)
Owner
Eclipse EE4J
The Eclipse EE4J Project
Eclipse EE4J
Java EE project https://zarisa-boutique.herokuapp.com/

CSC584-Enterprise-Programming This repository contains the Enterprise Programming end-of-semester project. It's a basic Java EE project with CRUD (Cre

Farhana Ahmad 2 Oct 11, 2021
Vert.x PoC for Project Loom Support

Vert.x Loom Wrapper Codegen This project contains a proof of concept implementation for a codegen wrapper API that provides virtual async-await suppor

Johannes Schüth 13 Oct 10, 2022
Uber-project for (some) standard Jackson textual format backends: csv, properties, yaml (xml to be added in future)

Overview This is a multi-module umbrella project for Jackson standard text-format dataformat backends. Dataformat backends are used to support format

FasterXML, LLC 351 Dec 22, 2022
Eclipse Foundation 3k Dec 31, 2022
GS Collections has been migrated to the Eclipse Foundation, re-branded as Eclipse Collections. https://www.eclipse.org/collections/

GS Collections is now Eclipse Collections We are pleased to announce that GS Collections has been migrated to the Eclipse Foundation, re-branded as Ec

null 1.8k Dec 30, 2022
GS Collections has been migrated to the Eclipse Foundation, re-branded as Eclipse Collections. https://www.eclipse.org/collections/

GS Collections is now Eclipse Collections We are pleased to announce that GS Collections has been migrated to the Eclipse Foundation, re-branded as Ec

null 1.8k Dec 30, 2022
QuickShell is an Eclipse plugin to use Java JShell inside the Eclipse IDE.

QuickShell is an Eclipse plugin to use Java JShell (REPL) inside Eclipse IDE. JDK 9+ is not installed on your system? No worries, you can still use Qu

Nilesh Khaire 8 Oct 3, 2022
A JNI code generator based on the JNI generator used by the eclipse SWT project

HawtJNI Description HawtJNI is a code generator that produces the JNI code needed to implement java native methods. It is based on the jnigen code gen

FuseSource 153 Nov 17, 2022
Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

English | 中文 | Deutsch | Español | Ελληνικά | Français | 日本語 | Norsk (bokmål) | Português-Brasil | Русский | हिंदी Eclipse Collections is a comprehens

Eclipse Foundation 2.1k Jan 5, 2023
Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more

Eclipse Jetty Canonical Repository This is the canonical repository for the Jetty project, feel free to fork and contribute now! Submitting a patch or

Eclipse Foundation 3.5k Dec 28, 2022
Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.

English | 中文 | Deutsch | Español | Ελληνικά | Français | 日本語 | Norsk (bokmål) | Português-Brasil | Русский | हिंदी Eclipse Collections is a comprehens

Eclipse Foundation 2.1k Dec 29, 2022
Vim-like editing in Eclipse

Vim-like editing in Eclipse Vrapper is an Eclipse plugin which acts as a wrapper for Eclipse text editors to provide a Vim-like input scheme for movin

Vrapper team 1.1k Jan 1, 2023
Full Featured Eclipse Theme Customizer!

Jeeeyul's Eclipse Themes (former Eclipse Chrome Theme) Jeeeyul's Eclipse Themes allows you to customize every single details of Eclipse's appearance.

Jeeeyul Lee 821 Dec 17, 2022
Color themes for Eclipse

Eclipse Color Theme Color themes for Eclipse. Eclipse Color Theme makes it possible to import and switch color themes conveniently and without side ef

Eclipse Color Theme 884 Dec 13, 2022
Expose eclipse features inside of vim.

Welcome to Eclim on GitHub Overview The primary goal of eclim is to bring Eclipse functionality to the Vim editor. For more details, please visit ecli

Eric Van Dewoestine 1k Nov 3, 2022
Eclipse Temurin™ build scripts - common across all releases/versions

Repository for code and instructions for building OpenJDK binaries, defaulting to Eclipse Temurin™ These scripts can be used to build OpenJDK anywhere

Eclipse Adoptium 914 Jan 4, 2023
Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput.

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.

null 3k Jan 3, 2023
SBSRE is an eclipse plugin for extract method refactoring based on the single responsibility principle(SRP)

SBSRE is a slice-based single responsibility extraction approach supported by an eclipse plugin for identifying Single responsibility violations in the methods.

null 4 Jul 8, 2022
A log4j2 plugin to Eclipse.

Ganymede A log4j2 log viewer plugin for Eclipse. Installation Use the Eclipse update site: Ganymede2 - https://dbusche.github.io/Ganymede2/ History Th

null 3 Dec 15, 2022
Convenient search view for Eclipse to find/replace within the currently active editor.

Find/Replace View plugin for Eclipse Feedback and high-quality pull requests are highly welcome! About What is it? Installation Building from Sources

Sebastian Thomschke 3 May 25, 2022