From 6bdbde973432822f783216b4c9b1400a685da715 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Wed, 5 Feb 2014 17:03:35 -0600 Subject: [PATCH] HHH-8934 - ignore missing package-info.class files during jandex indexing --- .../java/org/hibernate/metamodel/MetadataSources.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java b/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java index 50344d4987..acf11953c7 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/MetadataSources.java @@ -623,7 +623,14 @@ public class MetadataSources { // add package-info from the configured packages for ( String packageName : sources.getAnnotatedPackages() ) { - indexResource( packageName.replace( '.', '/' ) + "/package-info.class" ); + // older code seemed to simply ignore packages that did not have package-info, + // so do same + try { + indexResource( packageName.replace( '.', '/' ) + "/package-info.class" ); + } + catch (Exception e) { + log.debugf( "Skipping package [%s] which caused error indexing : %s", packageName, e.getMessage() ); + } } // the classes referenced in any orm.xml bindings (unless it is "metadata complete")