Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #1944

Open
dkostakev opened this issue Jun 23, 2024 · 4 comments

Comments

@dkostakev
Copy link

dkostakev commented Jun 23, 2024

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 { ...

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

Could you please help me resolve this issue?

@dkostakev dkostakev changed the title 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. Postgres Quarkus 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. Jun 23, 2024
@dkostakev dkostakev changed the title Postgres Quarkus 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. 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. Jun 24, 2024
@gavinking
Copy link
Member

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

@DavideD
Copy link
Member

DavideD commented Jun 24, 2024

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

@dkostakev
Copy link
Author

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

@gavinking
Copy link
Member

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.

@DavideD DavideD added problem A limitation or source of discomfort and removed problem A limitation or source of discomfort labels Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants