RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-17 Thread Cai, Judy
Thanks, Ganesh

Is XML parsers xercesImpl-2.2.1.jar? I can not find other XML Parsers in my
classpath and current fop0.20.5 directory. I tried running the Sample
document on the command line on the linux machine? There is also
java.lang.NoSuchMethodError: org.apache.batik.dom.AbstractAttr: method
isReadonly()Z not found.
I narrowed down the problem to the input image file from my xsl file. 
If I comment fo:blockfo:external-graphic src=file:nsf_logo.svg /
/fo:block from my xsl file, it did generate PDF file. Otherwise, it will
cause java.lang.NoSuchMethodError method: org.apache.batik.dom.AbstractAttr:
isReadonly()Z not found. But I put svg image files, xml file, xsl file, pdf
file and fop.sh in the same folder fop-0.20.5. There is no reason FOP can
not find the image file. Could you explain the reason?  


Thanks

Judy Cai

-Original Message-
From: Ganesh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 11:41 PM
To: [EMAIL PROTECTED]
Subject: RE: embedding fop0.20.5 working on jdk1.3.1-linux?




java.lang.NoSuchMethodError: org.apache.batik.dom.AbstractAttr: method
isReadonly()Z not found
   at org.apache.batik.dom.GenericAttr.(GenericAttr.java:42)
   at
org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)
   at
org.apache.batik.dom.svg.AbstractElement$ExtendedNamedNodeHashMap.setUns
peci
fiedAttribute(AbstractElement.java:238)

These isReadonly error comes only when there is more than one XML
parsers are available in your classpath or current directory. Check it
out.

Ganesh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-17 Thread Cai, Judy
I just change (fo:external-graphic src) to jpg file from svg file. Fop did
work for me. Now I guess the reason why the same code works fine in jdk1.4.1
on windows XP not in jdk1.3.1 on linux. My Open BSD may not support
graphical environment for SVG. Am I right? Any solution for it?

Thanks

Judy Cai



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-16 Thread Cai, Judy
Hi, Maerki

I find out tomcat logs file. But there is log information from linux: 
 [INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] [1]
[INFO] JkCoyoteHandler - -RESET 

And at the same time the browser show the exception:
( HTTP Status 500 - 
  exception 
  javax.servlet.ServletException: Servlet execution threw an exception )

But the same servlet display PDF page in windows xp browser, the tomcat log
info is: 
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] Parsing of document complete, stopping renderer
[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] Parsing of document complete, stopping renderer

Do you have any idea about this error?

Thanks

Judy Cai

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 8:32 AM
To: [EMAIL PROTECTED]
Subject: Re: embedding fop0.20.5 working on jdk1.3.1-linux?

Try to find out if anything is logged in the Tomcat Logs. If not try to
set your own logger for FOP:

[1] http://xml.apache.org/fop/embedding.html#basic-logging
[2] http://xml.apache.org/fop/embedding.html#logging

If your Linux is running in a headless environment (no X subsystem) then
the following link may help:

http://xml.apache.org/fop/graphics.html#batik

Good luck!

On 15.09.2003 22:54:30 Cai, Judy wrote:
   I have a java servlet to generate a PDF page using
 fop0.20.5. It works fine in the windows XP ( jdk1.4.1 on tomcat-4.1.24
 server). But when I moved to Open BSD with jdk1.3.1-linux on
tomcat-4.1.24,
 there was nothing to display, no any error or exception, just blank page. 
 
   I was exhausted to figure it out. Will anybody tell me some
 experience working fop on jdk1.3.1-linux?


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-16 Thread Cai, Judy
One more thing:

After I run this servlet, I will get a java.lang.OutOfMemoryError when I try
to display another web page.  

Here is my code about FOP:

public static final String XSLFILE = /hr/xsl/jobdesc.xsl;
protected Logger log = null;

protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
{
...

if (log == null) {
log = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
MessageHandler.setScreenLogger(log);
}

try {
...

String fullPath = getServletContext().getRealPath( XSLFILE
);
File xslfile = new File(fullPath);

// create StreamSource for XSLT document
Source xslSource = new StreamSource( xslfile );

// create DOMSource for source XML document
Source xmlSource = new DOMSource( jobDocument );

renderBrowser(xmlSource, xslSource, response );

}
// catch XML parser exceptions
catch ( ParserConfigurationException pcException ) {
pcException.printStackTrace();
}
catch (ServletException ex) {
throw ex;
}
catch (Exception ex) {
throw new ServletException(ex);
}

}  

 private void renderBrowser( Source xmlSource, Source xslSource,
HttpServletResponse response ) throws ServletException
   {
try {
//Construct driver
Driver driver = new Driver();

//Setup logger  Renderer (output format)
driver.setLogger(log);
driver.setRenderer(Driver.RENDER_PDF);

//Setup output
ByteArrayOutputStream out = new
ByteArrayOutputStream();
driver.setOutputStream(out);

// create TransformerFactory to obtain a Transformer
TransformerFactory transformerFactory =
TransformerFactory.newInstance();

// create Transformer for performing XSL
transformation
Transformer transformer =
transformerFactory.newTransformer( xslSource );

//Resulting SAX events (the generated FO) must be
piped through to FOP
Result result = new
SAXResult(driver.getContentHandler());

// perform transformation and deliver content to
client
transformer.transform( xmlSource, result );

byte[] content = out.toByteArray();
response.setContentType(application/pdf);
response.setContentLength(content.length);
response.getOutputStream().write(content);
response.getOutputStream().flush();
}
// handle exception when transforming XML document
catch ( TransformerException transformerException ) {
 transformerException.printStackTrace( System.err );
}
catch (Exception ex) {
 throw new ServletException(ex);
}
   }

I really need help to fix this problem.

Thanks

Judy Cai

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 8:32 AM
To: [EMAIL PROTECTED]
Subject: Re: embedding fop0.20.5 working on jdk1.3.1-linux?

Try to find out if anything is logged in the Tomcat Logs. If not try to
set your own logger for FOP:

[1] http://xml.apache.org/fop/embedding.html#basic-logging
[2] http://xml.apache.org/fop/embedding.html#logging

If your Linux is running in a headless environment (no X subsystem) then
the following link may help:

http://xml.apache.org/fop/graphics.html#batik

Good luck!

On 15.09.2003 22:54:30 Cai, Judy wrote:
   I have a java servlet to generate a PDF page using
 fop0.20.5. It works fine in the windows XP ( jdk1.4.1 on tomcat-4.1.24
 server). But when I moved to Open BSD with jdk1.3.1-linux on
tomcat-4.1.24,
 there was nothing to display, no any error or exception, just blank page. 
 
   I was exhausted to figure it out. Will anybody tell me some
 experience working fop on jdk1.3.1-linux?


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-16 Thread Cai, Judy
)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1129)
at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:
1107)
at
cec.bms.servlets.hr.job.AddJobXML.renderBrowser(AddJobXML.java:270)
at cec.bms.servlets.hr.job.AddJobXML.doGet(AddJobXML.java:184)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:619)
at java.lang.Thread.run(Thread.java:479)



Thanks

Judy Cai

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 12:07 PM
To: [EMAIL PROTECTED]
Subject: Re: embedding fop0.20.5 working on jdk1.3.1-linux?


On 16.09.2003 17:52:33 Cai, Judy wrote:

snip/

 [INFO] JkCoyoteHandler - -RESET 

This here could give an indication what went wrong. I don't know.

 And at the same time the browser show the exception:
 ( HTTP Status 500 - 
   exception 
   javax.servlet.ServletException: Servlet execution threw an exception )

Is that all? Didn't Tomcat display a full stacktrace? If yes, you could
find the original exception down in the stacktrace. The above alone
doesn't help.

snip/

 Do you have any idea about this error?

Not really. If logging the error doesn't help, modify the servlet, catch
Exception and log it explicitely. That way you should get more
information. Happy hunting.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-16 Thread Cai, Judy
Thanks, Maerki.

I use batik.jar that comes with the FOP. I tried running the
Sample doucment on the command line on the linux machine? The result is the
same: 
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
[INFO] FOP 0.20.5
[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser

[INFO] building formatting object tree
[INFO] setting up fonts
[INFO] [1]
[INFO] [1]
Exception in thread main java.lang.NoSuchMethodError:
org.apache.batik.dom.AbstractAttr: method isReadonly()Z not found
at org.apache.batik.dom.GenericAttr.init(GenericAttr.java:42)
at org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)

I am a new graduate from school and programming experience is kind of poor.
I don't know how to enable classloading verbosity. Help me!

Thanks

Judy Cai

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 2:26 PM
To: [EMAIL PROTECTED]
Subject: Re: embedding fop0.20.5 working on jdk1.3.1-linux?


On 16.09.2003 19:47:03 Cai, Judy wrote:
 I tried to trace the exception stack. But I still don't know where is
going
 wrong. Is the problem is batik.jar or something else. Could you give me
some
 hint? Here is the output:
 
 root cause 
 
 java.lang.NoSuchMethodError: org.apache.batik.dom.AbstractAttr: method
 isReadonly()Z not found
   at org.apache.batik.dom.GenericAttr.(GenericAttr.java:42)
   at org.apache.batik.dom.AbstractAttr.setValue(AbstractAttr.java:177)

Obviously, this has something to do with Batik, right? Have you checked
that you're using the right batik.jar (the one that comes with the FOP
version you're using) and that no other batik.jar is somewhere in the
classpath. You could enable classloading verbosity (-verbos:class) to
find out where the classes are loaded from. Have you tried running the
same document on the command line on the linux machine?

 AbstractElement.setUnspecifiedAttribute

This method may (!) indicate that you have an unsupported attribute
somewhere in your SVG code. I'm not sure. Try commenting out all SVG
elements and see if that changes anything.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-16 Thread Cai, Judy
Thank you so much, Jeremias.

I narrow down the problem to the input image file from xsl file. 
If I add fo:blockfo:external-graphic src=file:nsf_logo.svg /
/fo:block to my xsl file, it will cause java.lang.NoSuchMethodError. If I
comment it out, it did generate PDF file. But I am wondering I put image
files, xml file, xsl file, pdf file and fop.sh in the same folder
fop-0.20.5. There is no reason FOP can not find the image file. Could you
explain the reason?  

Thanks

Judy Cai

-Original Message-
From: Jeremias Maerki [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 16, 2003 3:48 PM
To: [EMAIL PROTECTED]
Subject: Re: embedding fop0.20.5 working on jdk1.3.1-linux?


On 16.09.2003 21:12:12 Cai, Judy wrote:
 Thanks, Maerki.

Well, Maerki is my lastname, you know. :-)

 I use batik.jar that comes with the FOP. I tried running the
 Sample doucment on the command line on the linux machine? The result is
the
 same: 

snip/

You get the same result so it must be something with your input document,
not with the Tomcat environment (Error-finding by exclusion).

 I am a new graduate from school and programming experience is kind of
poor.
 I don't know how to enable classloading verbosity. Help me!

I meant calling java.exe with the -verbose:class option. When you call
java -? on the command line you see all its available options. When
-verbose:class is set, you should receive lots of lines, one for each
loaded class with information where the class was loaded from. This can
help identify classloading problems (duplicate jars in the classpath,
for example). But this step is now mostly superfluous because you saw
that the same result happens on the command line.

As the next step I suggest commenting out portions of your input
document or stylesheet to further narrow down the problem point. That's
a tedious job but it is a technique I often use with success.


Jeremias Maerki


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



embedding fop0.20.5 working on jdk1.3.1-linux?

2003-09-15 Thread Cai, Judy
Title:  embedding fop0.20.5 working on jdk1.3.1-linux?





I have a java servlet to generate a PDF page using fop0.20.5. It works fine in the windows XP ( jdk1.4.1 on tomcat-4.1.24 server). But when I moved to Open BSD with jdk1.3.1-linux on tomcat-4.1.24, there was nothing to display, no any error or exception, just blank page. 

I was exhausted to figure it out. Will anybody tell me some experience working fop on jdk1.3.1-linux?

Thanks

Judy Cai