File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes hibernate search - webapp compilation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate search - webapp compilation problem" Watch "hibernate search - webapp compilation problem" New topic
Author

hibernate search - webapp compilation problem

Camilo Diaz
Greenhorn

Joined: Sep 03, 2009
Posts: 19
Hello:

recently, i am trying to use hibernate search on glassfish 2.1, using @field annotation in one of my classes. e.g:

@Field(index=Index.TOKENIZED)
private String lastName;

However, when compiling the project i get the following error:
warning: Cannot find annotation method 'index()' in type 'org.hibernate.search.annotations.Field': class file for org.hibernate.search.annotations.Field not found
An exception has occurred in the compiler (1.6.0_17). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.

I am sure that the hibernate search library is in the classpath with its dependencies .

Does anybody know about this kind of error?.

I'm using netbeans 6.7 and i've been thinking to update it to 6.8, however i don't think that's the problem.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
You can easily check whether NetBeans has anything to do with it by compiling from the command line, or using Ant.

But it sounds as if a bug in the compiler may have been triggered, so you could try a different one. Eclipse has its own compiler, and jikes (on SourceForge) may be another option (it may not work with Java 6 class libraries if that's all you have).
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
I just looked at jikes - while it has some support for Java 5 features (such as generics), it doesn't even understand annotations, making it just about useless these days.
Camilo Diaz
Greenhorn

Joined: Sep 03, 2009
Posts: 19
Hello:

I solved it !!!.

I have two build,xml files (one for the ebj-module and another for the web-module)
It seems that i was adding the hibernate search jar into the ejb-module's build.xml file, but not into the web-module, so i added it and worked.
Somehow, i'm using the hibernate search annotations only in the entities (ejb-module), not in the backing beans (web-module), so it shouldn't be necessary to add the hibernate search jar into the web-module. Weird. It's like add the hibernate core jar into the web-module.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: hibernate search - webapp compilation problem