Package not found or wo package-info.java
WARN [org.hibernate.cfg.AnnotationBinder] HHH00194:Package not found or wo package-info.java: com.mycompany.myapp.mypackage
I get this WARNing message du开发者_开发技巧ring deployment of my hibernate app on JBoss 7. I'm still able to deploy successfully, and hibernate works. But I'd like to eliminate these WARN message at startup.
I tried placing a package-info.java file at the root of my package directory. So, in src/main/java/com/mycompany/myapp/mypackage I have a package-info.java file that looks like
package com.mycompany.myapp.mypackage;
This did not fix the problem. Am I doing the right thing? Thanks for any advice.
This issue is addressed in the JBoss forum here: http://community.jboss.org/message/622023#622023
did you fill the package-info.java as described in java documentation here? In particular, it requires that the comment separators /**
and /*
must be present ie the minimum requirement for file seems to be like:
/**
* Not sure if this line is necessary but ones above and below are.
*/
package com.mycompany.myapp.mypackage; // case sensitive correct package name
This was also discussed in How to add package level comments in Javadoc?
I ask because per my recollection, javadoc sometimes "refused" to generate package info in cases when particular rules like I refer to above were broken. That may explain why you're still getting warnings even though file is there. Check in particular if package is defined correctly in your file.
As a reference, structure of source code for java.lang package-info.java in JDK 6 looks about as follows:
/* ... lengthy copyright... */ /** * Provides classes that are fundamental to the design of the Java * ... */ package java.lang;
As @Riggs mentioned it in his link, the next Hibernate version would be trace this messages as DEBUG, no more WARN.
If I were you I would not worry too much about it (unless you have time to create a bunch of package-info.java :)
精彩评论