On Thu, 2005-02-17 at 01:16, Herrick, Mike wrote: > Hi, > > I have been banging my head against a wall trying to upgrade our > XDoclet from 1.2.0 Beta 2 to 1.2.2. > > I fear that this is a trivial oversight, but I can't seem to figure it > out. > > All I did for the upgrade is replace the XDoclet jars in our lib > directory. I verified that taskdefs haven't changed in the XDoclet > docs. > <target name="init.xdoclet" depends="init"> > <taskdef name="xdoclet" classname="xdoclet.DocletTask" > classpathref="lib.classpath"/> > <taskdef name="ejbdoclet" > classname="xdoclet.modules.ejb.EjbDocletTask" > classpathref="lib.classpath"/> > <taskdef name="webdoclet" > classname="xdoclet.modules.web.WebDocletTask" > classpathref="lib.classpath"/> > </target> > > I really dumbed down one of current tasks that uses XDoclet to this: > <target name="short.xdoclet" depends="init.xdoclet"> > <ejbdoclet destdir="${src.root}" mergedir="parent-fake-to-debug" > excludedtags="@author,@todo,@copyright" addedtags="@xdoclet-generated > at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version > ${version}" ejbspec="2.0" force="false" verbose="true"> > <fileset dir="${src.root}"> > <include > name="com/mentor/supportnet/profile/ProfileBean.java"/> > </fileset> > <valueobject/> > <localinterface/> > <localhomeinterface/> > <remoteinterface/> > <homeinterface/> > <entitypk/> > <entitybmp/> > <deploymentdescriptor > destdir="${tmp.root}/supportnet/profile/meta-inf" validatexml="true" > mergedir="${tmp.root}/supportnet/profile"/> > <weblogic version="8.1" xmlencoding="UTF-8" > createtables="Disabled" > destdir="${tmp.root}/supportnet/profile/meta-inf" validatexml="true" > persistence="weblogic"/> > </ejbdoclet> > </target> > > The error I get is: > [ejbdoclet] Generating Local interface for > 'com.mentor.supportnet.profile.ProfileBean'. > [ejbdoclet] java.lang.NullPointerException > [ejbdoclet] at > xdoclet.template.TemplateEngine.start(TemplateEngine.java:424)
Regardless of what else is going on, the NPE is a bug; please raise an issue in JIRA. I can see how it might come about (the "out" variable in the finally clause is out of the scope of the local variable the rest of the method was using, so refers to the instance variable of the same name which obviously hadn't been set). In fact, there must have been some other error occurring first which caused an exception to be thrown before it reached the setWriter(out) on line 412. But because of the subsequent NPE in the finally clause, the other error never got reported :-( My guess is an IOException - the various destdir directories you've specified do exist, I take it? And you have write access to them? Andrew. > [ejbdoclet] at > xdoclet.TemplateSubTask.startEngine(TemplateSubTask.java:561) > [ejbdoclet] at > xdoclet.TemplateSubTask.generateForClass(TemplateSubTask.java:778) > [ejbdoclet] at > xdoclet.TemplateSubTask.startProcessPerClass(TemplateSubTask.java:678) > [ejbdoclet] at > xdoclet.TemplateSubTask.startProcess(TemplateSubTask.java:595) > [ejbdoclet] at > xdoclet.TemplateSubTask.execute(TemplateSubTask.java:487) > [ejbdoclet] at xdoclet.XDocletMain.start(XDocletMain.java:48) > [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:468) > [ejbdoclet] at > xjavadoc.ant.XJavadocTask.execute(XJavadocTask.java:95) > [ejbdoclet] at > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269) > [ejbdoclet] at org.apache.tools.ant.Task.perform(Task.java:364) > [ejbdoclet] at > org.apache.tools.ant.Target.execute(Target.java:301) > [ejbdoclet] at > org.apache.tools.ant.Target.performTasks(Target.java:328) > [ejbdoclet] at > org.apache.tools.ant.Project.executeTarget(Project.java:1215) > [ejbdoclet] at > org.apache.tools.ant.Project.executeTargets(Project.java:1063) > [ejbdoclet] at org.apache.tools.ant.Main.runBuild(Main.java:632) > [ejbdoclet] at org.apache.tools.ant.Main.startAnt(Main.java:183) > [ejbdoclet] at > org.apache.tools.ant.launch.Launcher.run(Launcher.java:197) > [ejbdoclet] at > org.apache.tools.ant.launch.Launcher.main(Launcher.java:56) > > The reason I think it is probably something trivial is I took this > bean (ProfileBean) and put it in the sample directory that came with > the XDoclet distro. It generated it ok. I also took the sample beans > from the sample and put them in our src directory. This failed the > same way. > > I appreciate your help. > > Mike -- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user