hibernate-reactive icon indicating copy to clipboard operation
hibernate-reactive copied to clipboard

Postgres Quarkus Panache Suppressed: io.vertx.core.impl.NoStackTraceThrowable: Parameter at position[2] with class = [org.hibernate.engine.jdbc.BlobProxy] and value = [org.hibernate.engine.jdbc.BlobProxy@6949d1f3] can not be coerced to the expected class = [io.vertx.core.buffer.Buffer] for encoding.

Open dkostakev opened this issue 1 year ago • 4 comments

Hi, I am new to Quarkus and Hibernate reactive. I am using it with Postgres and I am getting the following error :

Suppressed: io.vertx.core.impl.NoStackTraceThrowable: Parameter at position[2] with class = [org.hibernate.engine.jdbc.BlobProxy] and value = [org.hibernate.engine.jdbc.BlobProxy@6949d1f3] can not be coerced to the expected class = [io.vertx.core.buffer.Buffer] for encoding.

My code looks like :

I have an entity class which I define as @Lob public byte[] data;

and in database I have a column with the following definition

data BYTEA NOT NULL

I am using Quarkus version 3.1.0.Final

with dependency management :

<dependencyManagement> <dependencies> <dependency> <groupId>${quarkus.platform.group-id}</groupId> <artifactId>${quarkus.platform.artifact-id}</artifactId> <version>${quarkus.platform.version}</version> <type>pom</type> <scope>import</scope> </dependency>

The repository is defined as :

@ApplicationScoped public class LogoRepository extends AbstractRepository implements PanacheRepository<LogoEntity> { ...

This exception is being thrown when calling "repository.persist(entity)".

Could you please help me resolve this issue?

dkostakev avatar Jun 23 '24 19:06 dkostakev

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

gavinking avatar Jun 24 '24 09:06 gavinking

It's probably related to this issue in Hibernate Reactive.

DavideD avatar Jun 24 '24 09:06 DavideD

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

I am trying to use byte[] instead of String

dkostakev avatar Jun 24 '24 09:06 dkostakev

It's probably related to this issue in Hibernate Reactive.

I don't think so. The user states that the database column is declared:

data BYTEA NOT NULL

So they should not be using @Lob in the first place.

gavinking avatar Jun 24 '24 09:06 gavinking