0

I am getting some weird issue in my Quarkus application while executing query not getting response. I am using quarkus-hibernate-reactive and quarkus-reactive-client. Getting below error:

[org.jbo.res.res.i18n] (vert.x-eventloop-thread-3) RESTEASY002020: Unhandled asynchronous exception, sending 
back 500: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.smallrye.mutiny.context.ContextPropagationUniInterceptor$2 and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
        at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
        at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277)
        at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
        at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
        at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1516)
        at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1006)
        at org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider.writeTo(ResteasyJackson2Provider.java:329)
        at org.jboss.resteasy.core.messagebody.AsyncBufferedMessageBodyWriter.asyncWriteTo(AsyncBufferedMessageBodyWriter.java:24)
        at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:87) 


@Inject
URepository uRepository;
    
@POST
@javax.ws.rs.Path("/add") 
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN})
@Consumes({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN })
public Uni<Response> addUser(UBean userIN,@HeaderParam("userName") String addedBy) throws Exception{
    
            Uni<Integer> cf = createNewFolders(userIN.getUserName());
                return Response.ok(cf.onItem().transform(c -> {
                  if (c.intValue() == 1) {
                    return  uRepository.addUser(userIN).onItem().transform(h -> h.longValue());
                  } else {
                     return null;
                  }
                });
         
    
}
    
public Uni<Integer> createNewFolders(String addedBy) {
       //creating FBean Object
        FBean f=new FBean(addedBy);
        calladdFile(f);
        Uni.createFrom().item(1);
}

public void calladdFile(FBean fileIN) {
   addFile(fileIN).onItem().transform(m -> m);
}

public Uni<Integer> addFile(FBean fileIN) { 

     Object[] array = {fileIN.getName(), fileIN.getExt(),
                fileIN.getOwner(), fileIN.getFrom(), fileIN.Date(),
                fileIN.getType()};

        List<Object> l = Arrays.asList(array);
        Tuple t = Tuple.tuple(l);

        return SqlClientHelper.inTransactionUni(client, tx -> {
            return tx.preparedQuery(sql)
                    .execute(t).onItem().
                    transform(pg -> pg.iterator().next().getInteger("id"));
        });
 }

Please let me know what is wrong I am doing why I am getting this error?

user3458271
  • 638
  • 12
  • 31
  • Which quarkus quarkus-resteasy* extensions are you using? – geoand Sep 10 '21 at 11:29
  • I am using this io.quarkus quarkus-reactive-pg-client io.quarkus quarkus-resteasy-jackson io.quarkus quarkus-resteasy-mutiny – user3458271 Sep 11 '21 at 05:04
  • If I am not using quarkus-hibernate-reactive it is working fine, not sure what is worng with it – user3458271 Sep 11 '21 at 13:01
  • Could you create a test case or a project that we can run somewhere, please? You are not even using Hibernate Reactive in the code you are showing in the question, so it could be a bug in the hibernate reactive extension. – Davide D'Alto Sep 13 '21 at 14:16
  • @Davide I am using Hibernate Reactive but this the middle process which happening before Hibernate User persist method I have updated code. – user3458271 Sep 13 '21 at 14:29
  • It doesn't seem like you are using Hibernate Reactive, you are using the Reactive SQL clients: https://quarkus.io/guides/reactive-sql-clients Hibernate Reactive does the CRUD operations via the session. If your code is not using it right now, you probably don't need that dependency – Davide D'Alto Sep 13 '21 at 15:10

0 Answers0