Here is the servlet we use to generate PDF and HTML from XML which is stored
in the user's session on Weblogic 6.1. There is some extra stuff in it, but
you should be able to filter the relevant parts. It also has a partial fix
to the IE-pre-5.0 servlet called twice or three times problem. I'm working
on what I hope will be the final solution right now. Here is the classpath
and startup command I use on our Windows development boxes:

set
CLASSPATH=.\config\isappdev\lib\fop.jar;.\config\isappdev\lib\xalan-2.0.0.ja
r;.\config\isappdev\lib\xmlparserv2.jar;.\config\isappdev\lib\xsu12.jar;.\co
nfig\isappdev\lib\classes12.zip;.\config\isappdev\lib\batik.jar;.\config\isa
ppdev\lib\xerces-1.2.3.jar;.;.\lib\weblogic_sp.jar;.\lib\weblogic.jar;

%JAVA_HOME%\bin\java -hotspot -verbose:gc -ms380m -mx380m -classpath
%CLASSPATH%
-Dpropfile="%BEA_HOME%\wlserver6.1.\config\isappdev\applications\RVWebApp1\W
EB-INF\resultview.properties"
-Ddomain_propfile="%BEA_HOME%\wlserver6.1.\config\isappdev\isappdev.properti
es" -Dweblogic.Domain=isappdev -Dweblogic.Name=NT4Dev
"-Dbea.home=%BEA_HOME%"
"-Djava.security.policy==%BEA_HOME%\wlserver6.1\lib\weblogic.policy"
-Dweblogic.management.password=%WLS_PW% weblogic.Server


As you can see we have a domain-level properties file called
isappdev.properties. These properties, which include the XSLTPathPrefix
property, are loaded into the servlet context on boot. Still haven't figured
out how to get a relative or dynamic image file path to work in my XSLT
styleshhet that converts XML->FO. Anyone? (HTTP won't work because of the
constantly changing environments from Windows-dev to Unix - dev, QA and
Prod.)

Also, if anyone has any questions or notices anything silly or inneficient
in this servlet, please let me know.

Hope this helps,
Matt Savino


> -----Original Message-----
> From: James Richardson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 02, 2002 2:54 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: weblogic and fop
> 
> 
> 
> OK, the problem is that weblogic contains in its classpath some XML 
> parser stuff. (Off topic, but why anybody ever decided that using a 
> single static method to get an XML parser (which one you get only 
> controlled by the classpath is totally beyond me. It might 
> work fine in 
> some cases, but since everybody and their dog started writing 
> specialised versions the whole thing has turned into a classpath 
> nightmare. Forget it if you want dynamic classpaths - Webapp, anyone?)
> 
> So, to fix this, you have to include the FOP versions in the system 
> CLASSPATH BEFORE the weblogic ones. You then need to set up 
> the type of 
> parser in the system property. (Again, this is a bad idea 
> conceptually, 
> IMHO)
> 
> So, to get the thing running, I have the following:
> 
> CLASSPATH=$WL_HOME:$WL_HOME/classes:$WL_HOME/lib/weblogic_sp.j
> ar:$WL_HOME/lib/weblogic.jar:$WL_HOME/xmlx.jar
> 
> LOCAL_CLASSPATH=$LOCAL_LIBDIR/xalan-2.0.0.jar:$LOCAL_LIBDIR/ba
> tik.jar:$LOCAL_LIBDIR/fop.jar:$LOCAL_LIBDIR/avalon-fr
> amework-4.0.jar:$LOCAL_LIBDIR/logkit-1.0b4.jar:
> 
> JAVA_CMD_LINE="$JAVA_HOME/bin/java $JAVA_OPTIONS -classpath 
> $LOCAL_CLASSPATH:$CLASSPATH (weblogic stuff here) 
> -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser 
> weblogic.Server
> 
> $JAVA_CMD_LINE
> 
> However, YMMV....
> 
> Other warning(s): Due to the (by design) limitations of the java 
> classloader, you will have to make sure that any extensions that you 
> write to FOP/XSL are also in the system classpath, and I pity 
> you if you 
> want to do any of this in an EJB.... I reckon I will spin the 
> whole PDF 
> rendering thing off as a Jini service and be done with the whole 
> classpath problem. You will also need to be aware of 
> limitations of FOP 
> wrt headless servers. (It won't work) (Actually, any program that 
> requres a graphics context will have problems.) You may want 
> to look at 
> PJA as a way around this. (Alternatively, VNC will also work).
> 
> In terms of the programs etc to write, the examples work fine.....
> 
> Cheers
> 
> James
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> > 
> > 
> > Hi James,
> > 
> > I am facing problem compiling and deploying , xml xsl to 
> pdf using fop
> > on weblogic 6.1.
> > Would you please send me following please,
> > 
> > [1] a sample stand alone java code generating pdf using xml 
> and xsl file
> > [2] a servlet generating pdf using xml and xsl file on weblogic 6.x
> > 
> > Please help with whatever knowledge you have.
> > 
> > Thanks and regards.
> > 
> > Rakesh
> > 
> > BDY.RTF
> > 
> > Content-Type:
> > 
> > application/rtf
> > Content-Encoding:
> > 
> > base64
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 

Attachment: ReportGeneratorServlet.java
Description: Binary data

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

Reply via email to