2
WARN  [org.hibernate.cfg.AnnotationBinder] HHH00194:Package not found or wo package-info.java: com.mycompany.myapp.mypackage

I get this WARNing message during 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.

Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
user619804
  • 2,286
  • 12
  • 46
  • 71

3 Answers3

3

This issue is addressed in the JBoss forum here: http://community.jboss.org/message/622023#622023

Thomas Traude
  • 840
  • 7
  • 17
  • 1
    And the stamenent on the forums is that this is nothing to worry about. In future versions the message will be displayed as debug instead of warning. – Juha Palomäki Nov 30 '11 at 20:39
0

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;
    
Community
  • 1
  • 1
gnat
  • 6,213
  • 108
  • 53
  • 73
  • Package name is correct. I don't have any comments to add - should i just add empty /** */ comments? I'm not sure what comments has to do with it – user619804 Aug 30 '11 at 15:44
  • I updated the answer wrt `/** */`. If you find this still doesn't get you there, re-check the doc for there may be more requirements – gnat Aug 30 '11 at 15:56
0

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 :)

Xavier Portebois
  • 3,354
  • 6
  • 33
  • 53