You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Eike Stepper <st...@sympedia.com> on 2006/02/15 07:16:55 UTC

NPE in Fop Task

Hi,

I get a NullPointerException when calling Fop from my Ant script:

	<macrodef name="pdf">
		<attribute name="filename" />
		<sequential>
			<ant antfile="${docbook.xsl.home}/scripts/build.xml" target="build.fo">
				<property name="file.name" value="@{filename}" />
				<property name="target.dir" value="pdf" />
			</ant>
			<fop fofile="pdf/@{filename}.fo" outfile="pdf/@{filename}.pdf" format="application/pdf" messagelevel="debug" />
		</sequential>
	</macrodef>

	<target name="generate">
		<pdf filename="TechReport" />
	</target>

No stacktrace ;-(
The .fo file is attached.

Any ideas?

Cheers
/Eike


Re: NPE in Fop Task

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I ran the script I attached earlier from within Eclipse (same VM and
separate VM). Both cases worked. Hmm.

On 15.02.2006 12:30:46 Eike Stepper wrote:
> If I configure my Eclipse launch config to start a separate JRE for the build, it works ;-)
> Unfortunately some other tasks require me to start the build in the same JRE as Eclipse runs in.
> It would be a hazzle to always trigger two separate builds.
> 
> The question has to be changed:
> Has anyone experience how to start Fop in an Eclipse environment (same VM)?
> 
> Cheers
> /Eike
> 
> 
> Jeremias Maerki schrieb:
> > I'm inclined to say so, yes. However, my biggest problem is that I
> > cannot even reproduce the problem. I've tried using the attached Ant
> > script with Ant 1.6.5 under JDK 1.5 with FOP 0.20.5 and FOP Trunk. Both
> > targets "doit" and your (slightly modified) "generate" work fine here
> > from the command line. To run it, put the attached Ant script in the
> > root directory of the FOP distribution and call "ant -f test-ant.xml".
> > Shrug.
> > 
> > On 15.02.2006 11:47:36 Eike Stepper wrote:
> >> Jeremias Maerki schrieb:
> >>> Actually, I wanted the FOP version, too. After searching through the
> >>> various FOP versions with the line number from the stack trace I found
> >>> that you're talking about 0.20.5.
> >> Sorry, you're right this is Fop 0.20.5, although the same thing happens with 0.91beta
> >>
> >>
> >>> You're using the "fop" task inside a "macrodef". I believe the NPE
> >>> happens due to the Project instance not being set on the task which the
> >>> Task.log() method needs. Maybe that's because the "fop" task is inside a
> >>> "macrodef", but I can't tell for sure. Better ask the Ant guys what's
> >>> wrong here, because I don't know. Ant is supposed to call setProject()
> >>> as far as I know.
> >> I tried it without the macrodef indirection, the same effect resulted.
> >> Do you still think, it's an Ant issue?
> >>
> >> Cheers
> >> /Eike
> >>
> >>
> >>> On 15.02.2006 10:55:15 Eike Stepper wrote:
> >>>> I use JDK1.5.0_06 and this is the trace (the switches are very useful!):
> >>>>
> >>>>
> >>>> Apache Ant version 1.6.5 compiled on June 2 2005
> >>>> Apache Ant version 1.6.5 compiled on June 2 2005
> >>> <snip/>
> >>>> --- Nested Exception ---
> >>>> java.lang.NullPointerException
> >>>> 	at org.apache.tools.ant.Task.log(Task.java:346)
> >>>> 	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
> >>>> 	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
> >>>> 	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
> >>> <snip/>
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> > For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: NPE in Fop Task

Posted by Eike Stepper <st...@sympedia.com>.
If I configure my Eclipse launch config to start a separate JRE for the build, it works ;-)
Unfortunately some other tasks require me to start the build in the same JRE as Eclipse runs in.
It would be a hazzle to always trigger two separate builds.

The question has to be changed:
Has anyone experience how to start Fop in an Eclipse environment (same VM)?

Cheers
/Eike


Jeremias Maerki schrieb:
> I'm inclined to say so, yes. However, my biggest problem is that I
> cannot even reproduce the problem. I've tried using the attached Ant
> script with Ant 1.6.5 under JDK 1.5 with FOP 0.20.5 and FOP Trunk. Both
> targets "doit" and your (slightly modified) "generate" work fine here
> from the command line. To run it, put the attached Ant script in the
> root directory of the FOP distribution and call "ant -f test-ant.xml".
> Shrug.
> 
> On 15.02.2006 11:47:36 Eike Stepper wrote:
>> Jeremias Maerki schrieb:
>>> Actually, I wanted the FOP version, too. After searching through the
>>> various FOP versions with the line number from the stack trace I found
>>> that you're talking about 0.20.5.
>> Sorry, you're right this is Fop 0.20.5, although the same thing happens with 0.91beta
>>
>>
>>> You're using the "fop" task inside a "macrodef". I believe the NPE
>>> happens due to the Project instance not being set on the task which the
>>> Task.log() method needs. Maybe that's because the "fop" task is inside a
>>> "macrodef", but I can't tell for sure. Better ask the Ant guys what's
>>> wrong here, because I don't know. Ant is supposed to call setProject()
>>> as far as I know.
>> I tried it without the macrodef indirection, the same effect resulted.
>> Do you still think, it's an Ant issue?
>>
>> Cheers
>> /Eike
>>
>>
>>> On 15.02.2006 10:55:15 Eike Stepper wrote:
>>>> I use JDK1.5.0_06 and this is the trace (the switches are very useful!):
>>>>
>>>>
>>>> Apache Ant version 1.6.5 compiled on June 2 2005
>>>> Apache Ant version 1.6.5 compiled on June 2 2005
>>> <snip/>
>>>> --- Nested Exception ---
>>>> java.lang.NullPointerException
>>>> 	at org.apache.tools.ant.Task.log(Task.java:346)
>>>> 	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
>>>> 	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
>>>> 	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
>>> <snip/>
> 
> 
> Jeremias Maerki
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: NPE in Fop Task

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
I'm inclined to say so, yes. However, my biggest problem is that I
cannot even reproduce the problem. I've tried using the attached Ant
script with Ant 1.6.5 under JDK 1.5 with FOP 0.20.5 and FOP Trunk. Both
targets "doit" and your (slightly modified) "generate" work fine here
from the command line. To run it, put the attached Ant script in the
root directory of the FOP distribution and call "ant -f test-ant.xml".
Shrug.

On 15.02.2006 11:47:36 Eike Stepper wrote:
> Jeremias Maerki schrieb:
> > Actually, I wanted the FOP version, too. After searching through the
> > various FOP versions with the line number from the stack trace I found
> > that you're talking about 0.20.5.
> 
> Sorry, you're right this is Fop 0.20.5, although the same thing happens with 0.91beta
> 
> 
> > You're using the "fop" task inside a "macrodef". I believe the NPE
> > happens due to the Project instance not being set on the task which the
> > Task.log() method needs. Maybe that's because the "fop" task is inside a
> > "macrodef", but I can't tell for sure. Better ask the Ant guys what's
> > wrong here, because I don't know. Ant is supposed to call setProject()
> > as far as I know.
> 
> I tried it without the macrodef indirection, the same effect resulted.
> Do you still think, it's an Ant issue?
> 
> Cheers
> /Eike
> 
> 
> > On 15.02.2006 10:55:15 Eike Stepper wrote:
> >> I use JDK1.5.0_06 and this is the trace (the switches are very useful!):
> >>
> >>
> >> Apache Ant version 1.6.5 compiled on June 2 2005
> >> Apache Ant version 1.6.5 compiled on June 2 2005
> > <snip/>
> >> --- Nested Exception ---
> >> java.lang.NullPointerException
> >> 	at org.apache.tools.ant.Task.log(Task.java:346)
> >> 	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
> >> 	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
> >> 	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
> > <snip/>


Jeremias Maerki

Re: NPE in Fop Task

Posted by Eike Stepper <st...@sympedia.com>.
Jeremias Maerki schrieb:
> Actually, I wanted the FOP version, too. After searching through the
> various FOP versions with the line number from the stack trace I found
> that you're talking about 0.20.5.

Sorry, you're right this is Fop 0.20.5, although the same thing happens with 0.91beta


> You're using the "fop" task inside a "macrodef". I believe the NPE
> happens due to the Project instance not being set on the task which the
> Task.log() method needs. Maybe that's because the "fop" task is inside a
> "macrodef", but I can't tell for sure. Better ask the Ant guys what's
> wrong here, because I don't know. Ant is supposed to call setProject()
> as far as I know.

I tried it without the macrodef indirection, the same effect resulted.
Do you still think, it's an Ant issue?

Cheers
/Eike


> On 15.02.2006 10:55:15 Eike Stepper wrote:
>> I use JDK1.5.0_06 and this is the trace (the switches are very useful!):
>>
>>
>> Apache Ant version 1.6.5 compiled on June 2 2005
>> Apache Ant version 1.6.5 compiled on June 2 2005
> <snip/>
>> --- Nested Exception ---
>> java.lang.NullPointerException
>> 	at org.apache.tools.ant.Task.log(Task.java:346)
>> 	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
>> 	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
>> 	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
> <snip/>
> 
> 
> Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: NPE in Fop Task

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Actually, I wanted the FOP version, too. After searching through the
various FOP versions with the line number from the stack trace I found
that you're talking about 0.20.5.

You're using the "fop" task inside a "macrodef". I believe the NPE
happens due to the Project instance not being set on the task which the
Task.log() method needs. Maybe that's because the "fop" task is inside a
"macrodef", but I can't tell for sure. Better ask the Ant guys what's
wrong here, because I don't know. Ant is supposed to call setProject()
as far as I know.

On 15.02.2006 10:55:15 Eike Stepper wrote:
> I use JDK1.5.0_06 and this is the trace (the switches are very useful!):
> 
> 
> Apache Ant version 1.6.5 compiled on June 2 2005
> Apache Ant version 1.6.5 compiled on June 2 2005
<snip/>
> --- Nested Exception ---
> java.lang.NullPointerException
> 	at org.apache.tools.ant.Task.log(Task.java:346)
> 	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
> 	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
> 	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
<snip/>


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: NPE in Fop Task

Posted by Eike Stepper <st...@sympedia.com>.
I use JDK1.5.0_06 and this is the trace (the switches are very useful!):


Apache Ant version 1.6.5 compiled on June 2 2005
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: C:\ws\genfw\com.sympedia.docs\scripts\build.xml
  +Datatype genfw com.sympedia.genfw.ant.GenfwTask
  +Datatype copy.changes com.sympedia.tools.ant.CopyChangesTask
  +Datatype resource.location com.sympedia.tools.ant.ResourceLocationTask
  +Datatype fop org.apache.fop.tools.anttasks.Fop
  +Datatype eclipse.convertPath org.eclipse.core.resources.ant.ConvertPath
  +Datatype eclipse.incrementalBuild org.eclipse.core.resources.ant.IncrementalBuild
  +Datatype eclipse.refreshLocal org.eclipse.core.resources.ant.RefreshLocalTask
  +Datatype emf.JETEmitter org.eclipse.emf.ant.taskdefs.codegen.JETEmitterTask
  +Datatype emf.JMerger org.eclipse.emf.ant.taskdefs.codegen.JMergerTask
  +Datatype emf.util.RemoveVersion org.eclipse.emf.ant.taskdefs.RemoveVersionTask
  +Datatype emf.Rose2Java org.eclipse.emf.importer.rose.taskdefs.RoseGeneratorTask
  +Datatype help.buildHelpIndex org.eclipse.help.internal.base.ant.BuildHelpIndex
  +Datatype eclipse.checkDebugAttributes org.eclipse.jdt.core.CheckDebugAttributes
  +Datatype eclipse.brand org.eclipse.pde.internal.build.tasks.BrandTask
  +Datatype eclipse.fetch org.eclipse.pde.internal.build.tasks.FetchTask
  +Datatype eclipse.buildScript org.eclipse.pde.internal.build.tasks.BuildScriptGeneratorTask
  +Datatype eclipse.buildManifest org.eclipse.pde.internal.build.tasks.BuildManifestTask
  +Datatype eclipse.assembler org.eclipse.pde.internal.build.tasks.PackagerTask
  +Datatype eclipse.idReplacer org.eclipse.pde.internal.build.tasks.IdReplaceTask
  +Datatype eclipse.jnlpGenerator org.eclipse.pde.internal.build.tasks.JNLPGeneratorTask
  +Datatype eclipse.unzipperBuilder org.eclipse.pde.internal.build.tasks.UnzipperGeneratorTask
  +Datatype eclipse.fetchFilesGenerator org.eclipse.pde.internal.build.tasks.FetchFileGeneratorTask
  +Datatype eclipse.versionReplacer org.eclipse.pde.internal.build.tasks.GenericVersionReplacer
  +Datatype pde.exportPlugins org.eclipse.pde.internal.ui.ant.PluginExportTask
  +Datatype pde.exportFeatures org.eclipse.pde.internal.ui.ant.FeatureExportTask
  +Datatype pde.convertSchemaToHTML org.eclipse.pde.ant.ConvertSchemaToHTML
  +Datatype emf.XSD2Java org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile C:\ws\genfw\com.sympedia.docs\scripts\build.xml with URI = file:///C:/ws/genfw/com.sympedia.docs/scripts/build.xml
Setting ro project property: ant.project.name -> com.sympedia.docs
Adding reference: com.sympedia.docs
Setting ro project property: ant.file.com.sympedia.docs -> C:\ws\genfw\com.sympedia.docs\scripts\build.xml
Project base dir set to: C:\ws\genfw\com.sympedia.docs
  +Target:
  +Target: generate
     [property] Loading C:\ws\genfw\org.docbook.xsl_1.69.1\scripts\build.properties
Setting project property: tidy.enable -> true
     [property] Loading C:\ws\genfw\com.sympedia.docs\build.properties
Setting project property: bin.includes -> META-INF/,copyright.txt,epl-v10.html,html/,plugin.xml
Setting project property: css.name -> sympedia.css
  +Datatype pdf org.apache.tools.ant.taskdefs.MacroInstance
Arguments: -d -v -Dorg.eclipse.ant.core.ANT_PROCESS_ID=1139997003437
Adding reference: eclipse.ant.targetVector
Build sequence for target(s) `generate' is [generate]
Complete build sequence is [generate, ]

generate:
Adding reference: eclipse.progress.monitor
Adding reference: eclipse.progress.monitor
Adding reference: eclipse.progress.monitor
          [fop] [INFO] Using org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser as SAX2 Parser
          [fop] Error in class org.apache.fop.tools.anttasks.Fop

BUILD FAILED
C:\ws\genfw\com.sympedia.docs\scripts\build.xml:23: The following error occurred while executing this line:
C:\ws\genfw\com.sympedia.docs\scripts\build.xml:18: java.lang.NullPointerException
	at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
	at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:380)
	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.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:704)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:455)
	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 org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
	at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:215)
	at java.lang.Thread.run(Thread.java:595)
Caused by: C:\ws\genfw\com.sympedia.docs\scripts\build.xml:18: java.lang.NullPointerException
	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131)
	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.taskdefs.Sequential.execute(Sequential.java:64)
	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.taskdefs.MacroInstance.execute(MacroInstance.java:378)
	... 18 more
Caused by: java.lang.NullPointerException
	at org.apache.tools.ant.Task.log(Task.java:346)
	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
	... 24 more
--- Nested Exception ---
C:\ws\genfw\com.sympedia.docs\scripts\build.xml:18: java.lang.NullPointerException
	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:131)
	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.taskdefs.Sequential.execute(Sequential.java:64)
	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.taskdefs.MacroInstance.execute(MacroInstance.java:378)
	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.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:704)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:455)
	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 org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
	at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:215)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
	at org.apache.tools.ant.Task.log(Task.java:346)
	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
	... 24 more
--- Nested Exception ---
java.lang.NullPointerException
	at org.apache.tools.ant.Task.log(Task.java:346)
	at org.apache.fop.tools.anttasks.FOPTaskStarter.run(Fop.java:354)
	at org.apache.fop.tools.anttasks.Fop.execute(Fop.java:256)
	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 org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:123)
	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.taskdefs.Sequential.execute(Sequential.java:64)
	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.taskdefs.MacroInstance.execute(MacroInstance.java:378)
	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.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
	at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:704)
	at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:455)
	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 org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
	at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:215)
	at java.lang.Thread.run(Thread.java:595)

Total time: 610 milliseconds



Jeremias Maerki schrieb:
> Always state the FOP and JDK version you're using.
> 
> You can run Ant using the "-d" or "-v" parameters and then you should
> get stack traces.
> 
> On 15.02.2006 07:16:55 Eike Stepper wrote:
>> Hi,
>>
>> I get a NullPointerException when calling Fop from my Ant script:
>>
>> 	<macrodef name="pdf">
>> 		<attribute name="filename" />
>> 		<sequential>
>> 			<ant antfile="${docbook.xsl.home}/scripts/build.xml" target="build.fo">
>> 				<property name="file.name" value="@{filename}" />
>> 				<property name="target.dir" value="pdf" />
>> 			</ant>
>> 			<fop fofile="pdf/@{filename}.fo" outfile="pdf/@{filename}.pdf" format="application/pdf" messagelevel="debug" />
>> 		</sequential>
>> 	</macrodef>
>>
>> 	<target name="generate">
>> 		<pdf filename="TechReport" />
>> 	</target>
>>
>> No stacktrace ;-(
>> The .fo file is attached.
>>
>> Any ideas?
>>
>> Cheers
>> /Eike
>>
> 
> 
> 
> Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: NPE in Fop Task

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Always state the FOP and JDK version you're using.

You can run Ant using the "-d" or "-v" parameters and then you should
get stack traces.

On 15.02.2006 07:16:55 Eike Stepper wrote:
> Hi,
> 
> I get a NullPointerException when calling Fop from my Ant script:
> 
> 	<macrodef name="pdf">
> 		<attribute name="filename" />
> 		<sequential>
> 			<ant antfile="${docbook.xsl.home}/scripts/build.xml" target="build.fo">
> 				<property name="file.name" value="@{filename}" />
> 				<property name="target.dir" value="pdf" />
> 			</ant>
> 			<fop fofile="pdf/@{filename}.fo" outfile="pdf/@{filename}.pdf" format="application/pdf" messagelevel="debug" />
> 		</sequential>
> 	</macrodef>
> 
> 	<target name="generate">
> 		<pdf filename="TechReport" />
> 	</target>
> 
> No stacktrace ;-(
> The .fo file is attached.
> 
> Any ideas?
> 
> Cheers
> /Eike
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org