java.lang.ClassCastException: jgrouse.jgdoc.elements.DocElement cannot be cast to jgrouse.jgdoc.api.IContainerElement

11 views
Skip to first unread message

kwek

unread,
Oct 2, 2008, 6:50:17 AM10/2/08
to jgrousedoc
Hi im trying jgrousedoc against some of my company projects but for
almost every it ends up with the the cast exception. I also get this
when settings inputDir.default to a fresh yui installation. Anyone
know what can be the issue? thanks.

martijn@meow ~/src/jGrouseDoc-2.0 $ java-config --set-user-vm 2
Now using sun-jdk-1.6 as your user JVM

martijn@meow ~/src/jGrouseDoc-2.0 $ ant -v -f build.xml
Apache Ant version 1.7.0 compiled on October 2 2008
Buildfile: build.xml
Detected Java version: 1.6 in: /opt/sun-jdk-1.6.0.07/jre
Detected OS: Linux
parsing buildfile /mnt/stuff/src/jGrouseDoc-2.0/build.xml with URI =
file:/mnt/stuff/src/jGrouseDoc-2.0/build.xml
Project base dir set to: /mnt/stuff/src/jGrouseDoc-2.0
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
Build sequence for target(s) `default' is [setup, clean,
makeProjectFile, antgenxml, antgenvm, antgen, antrun,
cleanupTempFiles, default]
Complete build sequence is [setup, clean, makeProjectFile, antgenxml,
antgenvm, antgen, antrun, cleanupTempFiles, default, ]

setup:
[property] Loading /mnt/stuff/src/jGrouseDoc-2.0/
jgrousedoc.properties

clean:
[delete] Deleting directory /mnt/stuff/src/jGrouseDoc-2.0/api
[delete] Deleting directory /mnt/stuff/src/jGrouseDoc-2.0/api

makeProjectFile:
[mkdir] Created dir: /mnt/stuff/src/jGrouseDoc-2.0/api
[jgdoc] Building jGrouseDoc project file (BIN) /mnt/stuff/src/
jGrouseDoc-2.0/api/jgrouse.jgd

BUILD FAILED
/mnt/stuff/src/jGrouseDoc-2.0/build.xml:27:
java.lang.ClassCastException: jgrouse.jgdoc.elements.DocElement cannot
be cast to jgrouse.jgdoc.api.IContainerElement
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
115)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:
1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.ClassCastException:
jgrouse.jgdoc.elements.DocElement cannot be cast to
jgrouse.jgdoc.api.IContainerElement
at jgrouse.jgdoc.elements.DocManager.getNamespace(DocManager.java:
293)
at jgrouse.jgdoc.elements.DocManager.processMember(DocManager.java:
381)
at jgrouse.jgdoc.elements.DocManager.addComment(DocManager.java:434)
at jgrouse.jgdoc.DocParser.doExtract(DocParser.java:172)
at jgrouse.jgdoc.ant.JGTask.execute(JGTask.java:133)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
105)
... 11 more
--- Nested Exception ---
java.lang.ClassCastException: jgrouse.jgdoc.elements.DocElement cannot
be cast to jgrouse.jgdoc.api.IContainerElement
at jgrouse.jgdoc.elements.DocManager.getNamespace(DocManager.java:
293)
at jgrouse.jgdoc.elements.DocManager.processMember(DocManager.java:
381)
at jgrouse.jgdoc.elements.DocManager.addComment(DocManager.java:434)
at jgrouse.jgdoc.DocParser.doExtract(DocParser.java:172)
at jgrouse.jgdoc.ant.JGTask.execute(JGTask.java:133)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:
288)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:
105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:
1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:
41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 2 seconds

denis.r...@gmail.com

unread,
Oct 2, 2008, 7:30:28 AM10/2/08
to jgrousedoc
Wow! That's a good one. Will take a look at it this evening.

Note that even without that exception you would be out of luck re-
creating documentation for YUI - their documentation syntax is
different from jGrouseDoc, although quite close.

Regards,
Denis

kwek

unread,
Oct 2, 2008, 8:08:43 AM10/2/08
to jgrousedoc
Well yeah we base all our classes on the YUI framework but we are
flexible in the documentation syntax. I just gave YUI as an example
that even that wont run. I hope you can reproduce the errors else let
me know. Good luck and thanks :)

denis.r...@gmail.com

unread,
Oct 2, 2008, 8:20:19 AM10/2/08
to jgrousedoc
I was able to reproduce it. The first-phase fix would be a proper
handling of it (i.e. issue user-friendly error), but I am also
thinking about supporting YUI syntax,

It is quite unlikely that you would experience this problem if you
would stick to jGrouseDoc syntax.
Reply all
Reply to author
Forward
0 new messages