The following issue has been updated: Updater: Paddu Ramachandran (mailto:[EMAIL PROTECTED]) Date: Mon, 25 Jul 2005 12:44 PM Comment: Patch for egineStarted() method of HibernateSubTask that avoids the NPE by performing a null check Changes: Attachment changed to patch.diff --------------------------------------------------------------------- For a full history of the issue, see:
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1484?page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1484 Here is an overview of the issue: --------------------------------------------------------------------- Key: XDT-1484 Summary: Specifying "destinationFile" attribute in the <hibernate> ant task causes a NullPointerException Type: Bug Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: XDoclet Components: Hibernate Module Versions: 1.2.3 Assignee: xdoclet-devel (Use for new issues) Reporter: Paddu Ramachandran Created: Mon, 25 Jul 2005 12:34 PM Updated: Mon, 25 Jul 2005 12:44 PM Environment: Windows XP Pro SP2, Java 1.4.2_08, Ant 1.6.5, Eclipse 3.1 Description: when you use Xdoclet 1.2.3 and the <hibernatedoclet> ant task to generate Hibernate 3.0 mapping files from POJOs, setting the destinationFile attribute on the <hibernate> sub-task causes a NullPointerException in xdoclet.modules.hibernate.HibernateSubTask.engineStarted(HibernateSubTask.java:149). The cause of the problem seems to be that the current class stack is never populated when the destinationFile attribute is set, leading to the NPE, when the engineStarted() method attempts to access the top frame of the current class stack. Details of the NPE: [hibernatedoclet] java.lang.NullPointerException [hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.engineStarted(HibernateSubTask.java:149) [hibernatedoclet] at xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:557) [hibernatedoclet] at xdoclet.TemplateSubTask.startProcessForAll(TemplateSubTask.java:618) [hibernatedoclet] at xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:599) [hibernatedoclet] at xdoclet.XmlSubTask.startProcess(XmlSubTask.java:227) [hibernatedoclet] at xdoclet.modules.hibernate.HibernateSubTask.execute(HibernateSubTask.java:136) [hibernatedoclet] at xdoclet.XDocletMain.start(XDocletMain.java:48) [hibernatedoclet] at xdoclet.DocletTask.start(DocletTask.java:468) [hibernatedoclet] at xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:105) [hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364) [hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341) [hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369) [hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [hibernatedoclet] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37) [hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30) [hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [hibernatedoclet] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382) [hibernatedoclet] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [hibernatedoclet] at org.apache.tools.ant.Task.perform(Task.java:364) [hibernatedoclet] at org.apache.tools.ant.Target.execute(Target.java:341) [hibernatedoclet] at org.apache.tools.ant.Target.performTasks(Target.java:369) [hibernatedoclet] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216) [hibernatedoclet] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [hibernatedoclet] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40) [hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) [hibernatedoclet] at org.apache.tools.ant.Project.executeTargets(Project.java:1068) [hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423) [hibernatedoclet] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137) Ant code to reproduce: <!-- Generate hibernate mappings --> <path id="xdoclet.lib.path"> <fileset dir="${lib.home}"> <include name="xdoclet*.jar"/> <include name="xjavadoc*.jar"/> <include name="commons*.jar"/> </fileset> </path> <taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask" classpathref="xdoclet.lib.path"/> <target name="hibernate-map"> <echo>Generating hibernate maps</echo> <hibernatedoclet destdir="${src.home}" excludedtags="@version,@author,@todo" verbose="true"> <fileset dir="${src.home}"> <include name="**/*.java"/> </fileset> <hibernate version="3.0" destinationFile="out.hbm.xml" /> </hibernatedoclet> </target> --------------------------------------------------------------------- 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 ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel