【发布时间】:2021-04-29 07:28:40
【问题描述】:
我正在尝试将现有 Quarkus (1.7.5) 项目迁移到 Quarkus 版本 1.11.0 我可以一直构建到版本 1.10.3。从版本 1.10.4 在构建期间我得到以下异常(这是查看 changlog #13894 的新功能 - 在模型类和没有数据源时抛出异常)
但是,我根据使用 jdbc postgres 的文档在应用程序属性中声明数据源: https://quarkus.io/guides/hibernate-orm
通过 quarkus-extension.yaml 了解了 agroal,但没有帮助
我错过了什么?感谢任何指针
application.properties
..further declarations
...
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=my_user
quarkus.datasource.password=my_password
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/mydatabase
...
..further declarations
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.11.0.Final:build (default) on project isp-testArch11-core: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#configurationDescriptorBuilding threw an exception: io.quarkus.runtime.configuration.ConfigurationException: Model classes are defined for the default persistence unit but no default datasource found: the default EntityManagerFactory will not be created.
[ERROR] at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.handleHibernateORMWithNoPersistenceXml(HibernateOrmProcessor.java:697)
[ERROR] at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.configurationDescriptorBuilding(HibernateOrmProcessor.java:310)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2415)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :isp-testArch11-core
直到 1.10.3 的版本都可以工作。 使用:
Maven 3.6.3
Java 11
【问题讨论】:
标签: hibernate exception build datasource quarkus