The following comment has been added to this issue:
Author: Andrew Stevens
Created: Sun, 23 Jan 2005 6:11 PM
Body:
The class you included in the issue description had
/**
*
* @javabean.class name="DateFacility"
*
* @author Kannan
*/
package com.i3l.custom.facilities;
public class DateFacility implements java.io.Serializable {
but the one in the attachment contains no package. Which one should we be
looking at? I suspect it's the attachment that gives the error; the error
message mentions the packageOf template tag, which is likely to have problems
if there is no package...
Or, if the class is of the form quoted above, it's not likely to be processed
anyway as the class-level javadocs are in the wrong place and therefore won't
be recognised by the parser. They need to immediately precede the class
declaration, not the package line.
---------------------------------------------------------------------
View this comment:
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1120?page=comments#action_15748
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1120
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XDT-1120
Summary: Error while trying to create a beaninfo for a java file using
XDoclet
Type: Bug
Status: Open
Priority: Critical
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: XDoclet
Components:
Java Module
Versions:
1.2 Beta 2
Assignee: xdoclet-devel (Use for new issues)
Reporter: kannan
Created: Thu, 14 Oct 2004 10:04 AM
Updated: Sun, 23 Jan 2005 6:11 PM
Environment: windows and netbeans ide
Description:
Hi ,
I am trying to create a BeanInfo for a java file using XDoclet and i get the
follwing error. following is the error and java and build script file. xdoclet
version is xdoclet-1.2b2. any help on this would be appreciated
thanks
kannan
******************
error:
*************
init:
compile:
Compiling 1 source file to D:\Facility
generate-beaninfo:
xxxxxxxxxxxxxxxx
Running <beaninfo/>
Generating BeanInfo class for DateFacility.
(TemplateEngine.invokeMethod 490 ) Invoking method failed:
xdoclet.tagshandler.PackageTagsHandler.packageOf, line=4 of template file:
jar:file:/D:/NB/ide4/ant/lib/xdoclet-java-module-1.2b2.jar!/xdoclet/modules/java/javabean/resources/beaninfo.xdt
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at xdoclet.template.TemplateEngine.invoke(TemplateEngine.java:584)
at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:483)
at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:908)
at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:875)
at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:425)
at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:324)
at xdoclet.template.TemplateEngine.start(TemplateEngine.java:373)
at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:559)
at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:765)
at
xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:665)
at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:592)
at
xdoclet.modules.java.javabean.BeanInfoSubTask.execute(BeanInfoSubTask.java:96)
at xdoclet.XDocletMain.start(XDocletMain.java:46)
at xdoclet.DocletTask.start(DocletTask.java:457)
at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at
org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:216)
at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: -1
at java.lang.String.substring(String.java:1768)
at
xdoclet.tagshandler.PackageTagsHandler.packageOf(PackageTagsHandler.java:167)
... 28 more
(XDocletMain.start 51 ) Running XDoclet failed.
(XDocletMain.start 52 ) <<Running XDoclet failed.>>
xdoclet.template.TemplateException: Invoking method in class
xdoclet.tagshandler.PackageTagsHandler failed: packageOf, line=4 of template
file:
jar:file:/D:/NB/ide4/ant/lib/xdoclet-java-module-1.2b2.jar!/xdoclet/modules/java/javabean/resources/beaninfo.xdt,
exception: null
at
xdoclet.template.TemplateEngine.invokeMethod(TemplateEngine.java:491)
at
xdoclet.template.TemplateEngine.invokeBlockMethod(TemplateEngine.java:908)
at
xdoclet.template.TemplateEngine.handleBlockTag(TemplateEngine.java:875)
at xdoclet.template.TemplateEngine.handleTag(TemplateEngine.java:425)
at xdoclet.template.TemplateEngine.generate(TemplateEngine.java:324)
at xdoclet.template.TemplateEngine.start(TemplateEngine.java:373)
at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:559)
at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:765)
at
xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:665)
at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:592)
at
xdoclet.modules.java.javabean.BeanInfoSubTask.execute(BeanInfoSubTask.java:96)
at xdoclet.XDocletMain.start(XDocletMain.java:46)
at xdoclet.DocletTask.start(DocletTask.java:457)
at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at
org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:216)
at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
D:\Facility\Build.xml:47: XDoclet failed.
at xdoclet.DocletTask.start(DocletTask.java:460)
at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at
org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:216)
at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: xdoclet.XDocletException: Running XDoclet failed.
at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:773)
at
xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:665)
at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:592)
at
xdoclet.modules.java.javabean.BeanInfoSubTask.execute(BeanInfoSubTask.java:96)
at xdoclet.XDocletMain.start(XDocletMain.java:46)
at xdoclet.DocletTask.start(DocletTask.java:457)
... 10 more
--- Nested Exception ---
xdoclet.XDocletException: Running XDoclet failed.
at xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:773)
at
xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:665)
at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:592)
at
xdoclet.modules.java.javabean.BeanInfoSubTask.execute(BeanInfoSubTask.java:96)
at xdoclet.XDocletMain.start(XDocletMain.java:46)
at xdoclet.DocletTask.start(DocletTask.java:457)
at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:69)
at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at
org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:216)
at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:236)
at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
D:\Facility\Build.xml:47: Unexpected error
BUILD FAILED (total time: 4 seconds)
*********************
Java file
*****************
/**
*
* @javabean.class name="DateFacility"
*
* @author Kannan
*/
package com.i3l.custom.facilities;
public class DateFacility implements java.io.Serializable {
/** Creates a new instance of DateFacility */
private DateFacility() {
}
/**
* Returns the current date
*
* @javabean.method
* displayName="getCurrentDate"
* name="getCurrentDate"
* shortDescription="returns the current date."
*
*/
public static long getCurrentDate() {
return (System.currentTimeMillis());
}
}
******************************************************
build script
****************************************************
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="all" name="facility builder">
<!-- =================================================================== -->
<!-- Define project properties -->
<!-- =================================================================== -->
<property name="src.dir" location="${basedir}"/>
<property name="Doclet.root.dir" location="D:\NB\ide4\ant\lib"/>
<property name="Doclet.force" value="false"/>
<!-- =================================================================== -->
<!-- Define the class path for XDOCLET -->
<!-- =================================================================== -->
<target name="init">
<taskdef
name="xdoclet"
classname="xdoclet.DocletTask"
/>
</target>
<target depends="init" name="compile">
<javac debug="true" deprecation="true" destdir="." srcdir=".">
<filename name="DateFacility.java"/>
</javac>
</target>
<target depends="init,generate-beaninfo,compile" name="jar">
<jar basedir="." compress="true" destfile="."
jarfile="facility.jar">
<include name="*.class"/>
</jar>
</target>
<target depends="init,compile,generate-beaninfo,jar"
description="Build everything." name="all">
<echo message="Application built."/>
</target>
<target name="generate-beaninfo" depends="init">
<echo> xxxxxxxxxxxxxxxx </echo>
<xdoclet
destdir="."
mergedir="parent-fake-to-debug"
excludedtags="@version,@author,@todo"
force="${Doclet.force}"
verbose="true"
>
<fileset dir="D:/Facility">
<include name="DateFacility.java"/>
</fileset>
<beaninfo/>
</xdoclet>
</target>
</project>
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
xdoclet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel