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

3.1.1 Final - java.lang.IllegalArgumentException: Class java.util.UUID[] is instantiated reflectively but was never registered #34071

Closed
amoscatelli opened this issue Jun 15, 2023 · 9 comments · Fixed by #35319
Labels
area/hibernate-orm Hibernate ORM kind/bug Something isn't working
Milestone

Comments

@amoscatelli
Copy link
Contributor

Describe the bug

Upgrading from 3.1.0 Final to 3.1.1 Final leads to this is native mode only

2023-06-15 18:20:45.00 UTCgreetings-68cc87fc5-dvgsf[pod-event]Successfully pulled image "registry.cloud.okteto.net/amoscatelli/greetings:1.0.4" in 242.613097ms (242.629307ms including waiting)
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings__ ____ __ _____ ___ __ ____ ______ 
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \ 
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings--\___\_\____/_/ |_/_/|_/_/|_|\____/___/ 
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings18:31:02 WARN traceId=, parentId=, spanId=, sampled= [io.qu.ru.co.ConfigRecorder] (main) Build time property cannot be changed at runtime:
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings - quarkus.http.root-path is set to '/greetings' but it is build time fixed to '/'. Did you change the property quarkus.http.root-path after building the application?
2023-06-15 18:31:02.71 UTCgreetings-68cc87fc5-dvgsfgreetings18:31:02 WARN traceId=, parentId=, spanId=, sampled= [io.qu.op.ru.ex.ot.LateBoundBatchSpanProcessor] (main) No BatchSpanProcessor delegate specified, no action taken.
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings18:31:04 ERROR traceId=, parentId=, spanId=, sampled= [io.qu.ru.Application] (main) Failed to start application (with profile [prod]): java.lang.IllegalArgumentException: Class java.util.UUID[] is instantiated reflectively but was never registered.Register the class by adding "unsafeAllocated" for the class in reflect-config.json.
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.graalvm.nativeimage.builder/com.oracle.svm.core.graal.snippets.SubstrateAllocationSnippets.arrayHubErrorStub(SubstrateAllocationSnippets.java:345)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.loader.ast.internal.EntityBatchLoaderArrayParam.prepare(EntityBatchLoaderArrayParam.java:176)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.persister.entity.AbstractEntityPersister.prepareLoader(AbstractEntityPersister.java:3425)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:3419)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.metamodel.model.domain.internal.MappingMetamodelImpl.finishInitialization(MappingMetamodelImpl.java:204)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.internal.SessionFactoryImpl.initializeMappingModel(SessionFactoryImpl.java:320)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:270)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:84)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:74)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at jakarta.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:156)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at io.quarkus.hibernate.orm.runtime.JPAConfig$1.run(JPAConfig.java:64)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at [email protected]/java.lang.Thread.run(Thread.java:833)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
2023-06-15 18:31:04.25 UTCgreetings-68cc87fc5-dvgsfgreetings at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.1.1 Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@amoscatelli amoscatelli added the kind/bug Something isn't working label Jun 15, 2023
@gsmet
Copy link
Member

gsmet commented Jun 15, 2023

Could you give a bit more details about where you are using UUID in your model and how?

@gsmet gsmet added area/hibernate-orm Hibernate ORM and removed triage/needs-triage labels Jun 15, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 15, 2023

/cc @Sanne (hibernate-orm), @yrodiere (hibernate-orm)

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Jun 16, 2023
@amoscatelli
Copy link
Contributor Author

Here is the only class where I do use UUID ( anyway notice the error is talking about an array java.util.UUID[] ) :

package com.infolabtech.entities;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.PrePersist;
import java.util.Date;
import java.util.UUID;

@Entity
public class Greeting {

    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    private UUID id;

    @Column
    private String username;
    
    @Column
    private Date creation;

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public String getUser() {
        return username;
    }

    public void setUser(String user) {
        this.username = user;
    }

    public Date getCreation() {
        return creation;
    }

    public void setCreation(Date creation) {
        this.creation = creation;
    }

    @PrePersist
    protected void prePersist() {
        this.setCreation(
                new Date()
        );
    }

}

Thank you in advance

@yrodiere
Copy link
Member

I believe this is a regression caused by https://hibernate.atlassian.net/browse/HHH-16466

I'm opened a discussion this with the ORM team in https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/topic/HHH-16466

@yrodiere yrodiere removed the triage/needs-feedback We are waiting for feedback. label Jun 16, 2023
@yrodiere
Copy link
Member

yrodiere commented Jun 16, 2023

Created https://hibernate.atlassian.net/browse/HHH-16809 in an attempt to fix this upstream.

SailReal added a commit to cryptomator/hub that referenced this issue Jul 3, 2023
@amoscatelli
Copy link
Contributor Author

@yrodiere do you have any update ?
this kinda prevents any update to quarkus 3.2 so far ... for anybody using JPA/hibernate extension (I think?)

I took a look at the hibernate discussion and that's stuck at 20 June
Can I help ? What can we do to unblock the situation ?

@yrodiere
Copy link
Member

yrodiere commented Jul 4, 2023

for anybody using JPA/hibernate extension (I think?)

Probably only people using UUID in specific circumstances. Still, it remains an important regression.

As to progress, last I heard @sebersole had a branch with some work in progress but wasn't totally happy with the API changes.

For you, a workaround would be registering UUID[].class (the array type) for reflection. Putting @RegisterForReflection(targets = {UUID[].class}) on some entity class should work. See https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection

@amoscatelli
Copy link
Contributor Author

Thank you I'll try this workaround for the moment

@humcqc
Copy link
Contributor

humcqc commented Jul 27, 2023

for anybody using JPA/hibernate extension (I think?)

Probably only people using UUID in specific circumstances. Still, it remains an important regression.

As to progress, last I heard @sebersole had a branch with some work in progress but wasn't totally happy with the API changes.

For you, a workaround would be registering UUID[].class (the array type) for reflection. Putting @RegisterForReflection(targets = {UUID[].class}) on some entity class should work. See https://quarkus.io/guides/writing-native-applications-tips#registering-for-reflection

The workaround worked for my case, thanks! Waiting for the final fix.

@quarkus-bot quarkus-bot bot added this to the 3.4 - main milestone Aug 14, 2023
@gsmet gsmet modified the milestones: 3.4 - main, 3.3.0 Aug 15, 2023
@gsmet gsmet modified the milestones: 3.3.0, 3.2.5.Final Aug 24, 2023
benkard pushed a commit to benkard/mulkcms2 that referenced this issue Aug 29, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [flow-bin](https://github.com/flowtype/flow-bin) ([changelog](https://github.com/facebook/flow/blob/master/Changelog.md)) | devDependencies | minor | [`^0.214.0` -> `^0.215.0`](https://renovatebot.com/diffs/npm/flow-bin/0.214.0/0.215.1) |
| [org.liquibase:liquibase-maven-plugin](http://www.liquibase.org/liquibase-maven-plugin) ([source](https://github.com/liquibase/liquibase)) | build | patch | `4.23.0` -> `4.23.1` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | minor | `3.2.3.Final` -> `3.3.0` |
| [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | minor | `3.2.3.Final` -> `3.3.0` |
| [org.apache.maven.plugins:maven-enforcer-plugin](https://maven.apache.org/enforcer/) | build | minor | `3.3.0` -> `3.4.0` |

---

### Release Notes

<details>
<summary>flowtype/flow-bin</summary>

### [`v0.215.1`](flow/flow-bin@a92ce80...cbb038f)

[Compare Source](flow/flow-bin@a92ce80...cbb038f)

### [`v0.215.0`](flow/flow-bin@ca11e28...a92ce80)

[Compare Source](flow/flow-bin@ca11e28...a92ce80)

</details>

<details>
<summary>liquibase/liquibase</summary>

### [`v4.23.1`](https://github.com/liquibase/liquibase/blob/HEAD/changelog.txt#Liquibase-4231-is-a-patch-release)

[Compare Source](liquibase/liquibase@v4.23.0...v4.23.1)

</details>

<details>
<summary>quarkusio/quarkus</summary>

### [`v3.3.0`](https://github.com/quarkusio/quarkus/releases/tag/3.3.0)

[Compare Source](quarkusio/quarkus@3.2.4.Final...3.3.0)

##### Complete changelog

-   [#&#8203;35350](quarkusio/quarkus#35350) - Fix package type system property clearing
-   [#&#8203;35348](quarkusio/quarkus#35348) - quarkus-maven-plugin runs native building even if the profile is commented out
-   [#&#8203;35343](quarkusio/quarkus#35343) - ArC: fix StackOverflowError in AutoAddScopeBuildItem
-   [#&#8203;35319](quarkusio/quarkus#35319) - Register arrays of Hibernate ORM's JDBC basic types for reflection
-   [#&#8203;35315](quarkusio/quarkus#35315) - Fix Datasource timing issues with Liquibase / Flyway and OpenTelemetry
-   [#&#8203;35314](quarkusio/quarkus#35314) - Regression in 3.3.0.CR1: Synthetic bean instance for io.opentelemetry.api.OpenTelemetry not initialized yet
-   [#&#8203;35312](quarkusio/quarkus#35312) - Updates Infinispan to 14.0.13.Final
-   [#&#8203;35308](quarkusio/quarkus#35308) - Lock jib execution to avoid OverlappingFileLockException in parallel builds
-   [#&#8203;35305](quarkusio/quarkus#35305) - Fix the titles of the tables in RESTEasy Reactive doc
-   [#&#8203;35302](quarkusio/quarkus#35302) - Docs: Mention wilcard support in resteasy reactive XML serialisation exclude classes configuration
-   [#&#8203;35301](quarkusio/quarkus#35301) - Fix potential NPE in quarkus-csrf-reactive when no MediaType is found
-   [#&#8203;35299](quarkusio/quarkus#35299) - Output build graph using `quarkus.builder.graph-output` property
-   [#&#8203;35285](quarkusio/quarkus#35285) - NullPointerException during http post request when quarkus-csrf-reactive extension is added to a project
-   [#&#8203;35283](quarkusio/quarkus#35283) - Upgrade proto-google-common-protos to 2.23.0
-   [#&#8203;35282](quarkusio/quarkus#35282) - Avoid keeping references to BytecodeRecorderImpl
-   [#&#8203;35276](quarkusio/quarkus#35276) - Reinstate DevModeTestUtil to avoid breaking other projects that depend on it
-   [#&#8203;35273](quarkusio/quarkus#35273) - Fix small typo in comment
-   [#&#8203;35263](quarkusio/quarkus#35263) - Stop the recovery service while ArC is still around
-   [#&#8203;35245](quarkusio/quarkus#35245) - Add missing info to init Jobs
-   [#&#8203;35244](quarkusio/quarkus#35244) - Init Jobs are missing ServiceAccount and Image Pull Secrets
-   [#&#8203;35240](quarkusio/quarkus#35240) - Update SmallRye Health to 4.0.4
-   [#&#8203;34071](quarkusio/quarkus#34071) - 3.1.1 Final - java.lang.IllegalArgumentException: Class java.util.UUID\[] is instantiated reflectively but was never registered
-   [#&#8203;32800](quarkusio/quarkus#32800) - Duplicated checks in health check response
-   [#&#8203;11903](quarkusio/quarkus#11903) - Gradle multimodule project + quarkus-container-image-jib: OverlappingFileLockException

### [`v3.2.4.Final`](https://github.com/quarkusio/quarkus/releases/tag/3.2.4.Final)

[Compare Source](quarkusio/quarkus@3.2.3.Final...3.2.4.Final)

##### Complete changelog

-   [#&#8203;35300](quarkusio/quarkus#35300) - Fix `jandex-gradle-plugin-version` in CDI Reference
-   [#&#8203;35296](quarkusio/quarkus#35296) - Upgrade H2 to 2.2.220
-   [#&#8203;35258](quarkusio/quarkus#35258) - CDI Reference 1.1 has incomplete information for gradle
-   [#&#8203;35255](quarkusio/quarkus#35255) - Quartz: QuarkusMSSQLDelegate should extends MSSQLDelegate
-   [#&#8203;35211](quarkusio/quarkus#35211) - Document Maven config options that may be relevant when running tests
-   [#&#8203;35203](quarkusio/quarkus#35203) - Pass Maven user settings when initializing artifact resolver
-   [#&#8203;35193](quarkusio/quarkus#35193) - OpenTelemetry service name should have higher priority than app name when no resource attributes are set
-   [#&#8203;35189](quarkusio/quarkus#35189) - Quarkus CLI fixes
-   [#&#8203;35188](quarkusio/quarkus#35188) - SmallRyeGraphQLOverWebSocketHandler: use order value > Integer.MIN_VALUE
-   [#&#8203;35181](quarkusio/quarkus#35181) - REST Data with Panache should not produce links when hal is disabled
-   [#&#8203;35174](quarkusio/quarkus#35174) - Ensure the narayana-jta extension fully shuts down the recovery manager
-   [#&#8203;35172](quarkusio/quarkus#35172) - Kafka Streams: restore the feature name at Quarkus startup
-   [#&#8203;35171](quarkusio/quarkus#35171) - kafka-streams: feature not listed on startup
-   [#&#8203;35165](quarkusio/quarkus#35165) - Propagate all user methods in REST Data with Panache
-   [#&#8203;35160](quarkusio/quarkus#35160) - Properly use internal links to point to other guides
-   [#&#8203;35140](quarkusio/quarkus#35140) - ArC: fix deadlock when calling guarded methods on the same thread
-   [#&#8203;35136](quarkusio/quarkus#35136) - Deadlock while calling write-locked method from read-locked method
-   [#&#8203;34908](quarkusio/quarkus#34908) - `@RouteFilter` stopped working with WebSocket requests Quarkus 3.2.0.Final
-   [#&#8203;34875](quarkusio/quarkus#34875) - Quarkus build does not work since 3.2.0 with teamcity/plexus launcher
-   [#&#8203;34713](quarkusio/quarkus#34713) - Option to track build configuration for changes between builds
-   [#&#8203;34576](quarkusio/quarkus#34576) - Live reload stopped working on 3.2 when using XA transactions
-   [#&#8203;34514](quarkusio/quarkus#34514) - Support `@WithUnnamedKey` in documentation
-   [#&#8203;34065](quarkusio/quarkus#34065) - Add support for project Java version update based on extensions
-   [#&#8203;33317](quarkusio/quarkus#33317) - OpenTelemetry SDK autoconfiguration ignores OTEL service name in favor of Quarkus app name
-   [#&#8203;15461](quarkusio/quarkus#15461) - Quarkus tests fails mTLS authentication against internal Maven repository

</details>

<details>
<summary>quarkusio/quarkus-platform</summary>

### [`v3.3.0`](quarkusio/quarkus-platform@3.2.4.Final...3.3.0)

[Compare Source](quarkusio/quarkus-platform@3.2.4.Final...3.3.0)

### [`v3.2.4.Final`](quarkusio/quarkus-platform@3.2.3.Final...3.2.4.Final)

[Compare Source](quarkusio/quarkus-platform@3.2.3.Final...3.2.4.Final)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [x] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants