2

I'm trying to write an SVN Post-Commit hook to generate javadoc on a webpage whenever someone submits any changes to relevant files.

I was new to the hook concept, but I didn't expect to run in any strange errors when generating the javadoc.

java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl cannot be cast to com.sun.javadoc.AnnotationTypeDoc
    at com.sun.tools.javadoc.AnnotationDescImpl.annotationType(AnnotationDescImpl.java:46)
    at com.sun.tools.doclets.internal.toolkit.util.Util.isDeprecated(Util.java:811)
    at com.sun.tools.doclets.formats.html.AbstractIndexWriter.printComment(AbstractIndexWriter.java:186)

After a few succesful searches on StackOverFlow I discovered it had something to do with third-party-annotations. (I make use of the Play framework and that uses a number of other libraries)

So I included everything in a script:

#!/bin/sh

CLASSPATH="~/Play/play-1.1.1/;"

javadoc -d ~/svndoc/ -classpath $CLASSPATH -sourcepath ~/svntest/avon/trunk/ScoreDB/app @packages

But this generates the exact same errors. Sometimes there are 10 warnings, but most of the time there are 27 of them.

Could you guys help me out?

Thanks in advance, Jasper

Pascal Cuoq
  • 79,187
  • 7
  • 161
  • 281
Jasper
  • 233
  • 1
  • 4
  • 12
  • 1
    @razlebe Removing "Javadoc:" from the title is NOT an improvement. "Annotations from third-party libraries" without context is a terrible title. – Pascal Cuoq Mar 15 '11 at 16:34
  • @Pascal Appreciate your point of view. I edited in line with the general feeling in questions answered on Meta that pseudotagging a question in the title is undesirable. Admittedly, I could have found a better rewording. – razlebe Mar 15 '11 at 16:54

1 Answers1

1

Your classpath looks wrong. First, there should be no ; in it (in Unix, the separator is :, but it is not needed at the end). Secondly, do you really have the individual class files in this directory? If there are jar files, you need to either list them individually, or put a * there (but pay attention that bash does not expand it, since you would need : instead of spaces between).

I have no idea if this would solve the problem, though.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
  • I didn't know the classpath didn't search for .jar files recursively, thanks! That solved it! – Jasper Mar 15 '11 at 17:44