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

Adding Hibernate panache dependency + driver and no config leads to error #1732

Closed
emmanuelbernard opened this issue Mar 28, 2019 · 2 comments
Assignees
Labels
area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Milestone

Comments

@emmanuelbernard
Copy link
Member

When I add Hibernate Panache as a dependency, and do mvn compile quarkus:dev, I get

        [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#doParseAndRegisterSubstrateResources threw an exception: io.quark
us.deployment.configuration.ConfigurationError: Hibernate extension cannot guess the dialect as no JDBC driver is specified by 'quarkus.datasource.driv
er'
        at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:134)
        at io.quarkus.dev.DevModeMain.doStart(DevModeMain.java:105)
        at io.quarkus.dev.DevModeMain.main(DevModeMain.java:66)
Caused by: org.jboss.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#doParseAndRegisterSubstrateResources threw an exception: io.quark
us.deployment.configuration.ConfigurationError: Hibernate extension cannot guess the dialect as no JDBC driver is specified by 'quarkus.datasource.driv
er'
        at org.jboss.builder.Execution.run(Execution.java:123)
        at org.jboss.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:136)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:110)
        at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:99)
        ... 2 more
Caused by: io.quarkus.deployment.configuration.ConfigurationError: Hibernate extension cannot guess the dialect as no JDBC driver is specified by 'quar
kus.datasource.driver'
        at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.guessDialect(HibernateOrmProcessor.java:473)
        at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.handleHibernateORMWithNoPersistenceXml(HibernateOrmProcessor.java:330)
        at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.doParseAndRegisterSubstrateResources(HibernateOrmProcessor.java:127)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:506)
        at org.jboss.builder.BuildContext.run(BuildContext.java:413)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1998)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1525)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1416)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Note that I have no @Entity annotations. I think we did fix that issue in the past @gsmet but it might have resurfaced.

@gsmet
Copy link
Member

gsmet commented Mar 28, 2019

We only "start" ORM if there are entities in the classpath. The issue is that it's entities in the large sense of the term (embeddables and mapped super classes are considered too) and with Panache, we have one abstract mapped super class: PanacheEntity.

Thus it tries to start ORM and you have this error.

We should probably be stricter and only start ORM if we have at least one class marked with @Entity.

@gsmet gsmet added this to the 0.13.0 milestone Mar 28, 2019
@gsmet gsmet added the kind/bug Something isn't working label Mar 28, 2019
@gsmet gsmet self-assigned this Mar 28, 2019
@gsmet gsmet removed this from the 0.13.0 milestone Apr 4, 2019
@gsmet
Copy link
Member

gsmet commented Apr 4, 2019

I have a patch for it but it's a bit more invasive than planned and we release soon. Let's move it to the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/panache area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants