Closed nkavian closed 11 years ago
Eclipse uses its own Java compiler which is not strictly standard compliant and requires extra configuration. See screenshot below:
Instructions from Eclipse page: http://www.eclipse.org/jdt/apt/introToAPT.php
Let me know if that helps. I will add relevant info to the README file.
Thanks so much, I'm so excited that this is going to work. I found that screen but would never have figured out to load both jars. I ran into another error afterwards when using this with a Java EE Tomcat 7 project. I found out to turn off "Serve modules without publishing" because when it was enabled it would cause this exception:
java.lang.RuntimeException: Evo Class Index: Cannot read class index at org.atteo.evo.classindex.ClassIndex.readIndexFile(ClassIndex.java:174) ...... Caused by: java.io.FileNotFoundException: /Website/Java/WebContent/WEB-INF/classes/META-INF/annotations/model.internal.client.Entity (No such file or directory) at java.io.FileInputStream.open(Native Method) ......
During compilation, the output was in: /Website/Java/build/classes/META-INF/annotations/model.internal.client.Entity
But when run it expects it in: /Website/Java/WebContent/WEB-INF/classes/META-INF/annotations/model.internal.client.Entity
A few links that kind of talk about similar problems but no solutions except to disable the feature: http://stackoverflow.com/questions/5924720/serve-modules-without-publishing-not-working-in-helios https://github.com/SpringSource/spring-mvc-showcase/issues/18
Any chance you have a solution?
In this file I think there needs to be a try/catch inside the first while loop before the second while loop to avoid an exception from breaking the iteration..
If the first URL resources throws an IOException then it will not scan the rest of the URL resources..
I noticed the exception referenced ClassIndex line 154..
Caused by: java.io.FileNotFoundException: /Website/Java/WebContent/WEB-INF/classes/META-INF/annotations/model.internal.client.Entity (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileInputStream.(FileInputStream.java:97) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at java.net.URL.openStream(URL.java:1035) at org.atteo.evo.classindex.ClassIndex.readIndexFile(ClassIndex.java:154) ... 25 more
This may be why my earlier problem happend..?..
Part of the solution may just be ignoring the IOException and return an empty classes list.
So there really is some index file because it is returned from getResources method in ClassIndex line 150, but somehow it cannot be opened.
Would You be able to provide me with a sample project with which I could reproduce the issue?
Thanks, for the sample project.
Fixed in 1.4. Thanks for all your support.
As of version 3.0 it is no longer necessary to load Guava in Eclipse, because ClassIndex was rewritten to not use it.
I created a new Java project in Eclipse, added the evo and guava jars, followed the example in the "Usage", but I don't see any index file being generated and it doesn't print out what it's supposed to print out.
What am I missing?
Using evo-classindex-1.3.jar and guava-14.0.1.jar
It only print out the first line, not the others:
Eclipse Juno on a Mac