执行时: mvn clean package -Pnative -Dquarkus.native.container-build = true
我希望: 本机映像将成功构建。
实际: 在quarkus版本1.7.5中,它可以按预期工作,但是 从1.8.0版开始,它会失败,并显示一些错误消息。
22:35:07,244 INFO [org.hib.Version] HHH000412: Hibernate ORM core version 0.0.3-SNAPSHOT
22:35:07,257 INFO [org.hib.ann.com.Version] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
22:35:07,317 INFO [org.hib.dia.Dialect] HHH000400: Using dialect: io.quarkus.hibernate.orm.runtime.dialect.QuarkusPostgreSQL10Dialect
22:35:07,430 INFO [org.hib.orm.beans] HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
22:35:38,532 INFO [org.jbo.threads] JBoss Threads version 3.1.1.Final
[kassa-service-0.0.3-SNAPSHOT-runner:27] (clinit): 740,93 ms, 6,20 GB
[kassa-service-0.0.3-SNAPSHOT-runner:27] (typeflow): 36.535,89 ms, 6,20 GB
[kassa-service-0.0.3-SNAPSHOT-runner:27] (objects): 60.944,79 ms, 6,20 GB
[kassa-service-0.0.3-SNAPSHOT-runner:27] (features): 1.608,81 ms, 6,20 GB
[kassa-service-0.0.3-SNAPSHOT-runner:27] analysis: 104.453,70 ms, 6,20 GB
Error: Unsupported features in 21 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved field during parsing: **de.lstrobel.quarkus.articles.service.persistence.ArticleKeyEntity.article**. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing field is then reported at run time when it is accessed the first time.
Trace:
at parsing de.lstrobel.quarkus.articles.service.ArticleService.afterMap(ArticleService.java:31)
Call path from entry point to de.lstrobel.quarkus.articles.service.ArticleService.afterMap(ArticleTO, ArticleEntity):
at de.lstrobel.quarkus.articles.service.ArticleService.afterMap(ArticleService.java:30)
at de.lstrobel.quarkus.articles.service.ArticleService_Subclass.afterMap$$superaccessor9(ArticleService_Subclass.zig:1599)
at de.lstrobel.quarkus.articles.service.ArticleService_Subclass$$function$$9.apply(ArticleService_Subclass$$function$$9.zig:41)
at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:331)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved field during parsing: de.lstrobel.quarkus.articles.service.persistence.ArticleKeyEntity.article. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing field is then reported at run time when it is accessed the first time.
Trace:
at parsing de.lstrobel.quarkus.articles.service.ArticleService.findByArticleKey(ArticleService.java:56)
Call path from entry point to de.lstrobel.quarkus.articles.service.ArticleService.findByArticleKey(String):
at de.lstrobel.quarkus.articles.service.ArticleService.findByArticleKey(ArticleService.java:52)
at de.lstrobel.quarkus.articles.service.ArticleService_Subclass.findByArticleKey$$superaccessor16(ArticleService_Subclass.zig:2398)
at de.lstrobel.quarkus.articles.service.ArticleService_Subclass$$function$$16.apply(ArticleService_Subclass$$function$$16.zig:33)
at sun.security.ec.XECParameters$1.get(XECParameters.java:183)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:190)
at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperty(SystemPropertiesSupport.java:143)
at com.oracle.svm.core.jdk.Target_java_lang_System.getProperty(JavaLangSubstitutions.java:331)
at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_lang_System_2_0002egetProperty_00028Ljava_lang_String_2_00029Ljava_lang_String_2(generated:0)
ArticleKeyEntity如下:
@Entity
@Table(name = "article_key", schema = "master_data")
public class ArticleKeyEntity extends KeyEntity {
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "article_id", nullable = false)
public ArticleEntity article;
}
ArticleEntity如下:
@Entity
@Table(name = "article", schema = "master_data")
public class ArticleEntity extends BaseEntity {
@Column(name = "article_number")
public String articleNumber;
public String description;
@Column(name = "long_description")
public String longDescription;
...
// each article may be identified by different unique keys like numbers barcodes, ....
@OneToMany(mappedBy = "article", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
public List<ArticleKeyEntity> articleKeys;
}
我的错误是什么?有谁能够帮助我? 谢谢
答案 0 :(得分:0)
已解决: 这是一个多模块项目,每个工件中都有实体。 META-INF中的“ panache-archive.marker”文件解决了该问题。参见Quarkus Panache指南。