Apache-fop classloading error ....

HI,
I am deploying a big EAR in WL 6.1 on solaris and I am bundling FOP 1.20.3
within it, I am
also including avalon 4.0 and logkit 1.0 jars within it as they are needed by
fop.jar. Whenever I
try to construct a "Driver()" class I get a NoClassDefFoundError on the org.apache.framework.logger.Loggable
interface that it needs. The strange thing is that when I do the following :
try {
ClassLoader cl = this.getClass().getClassLoader();
cl.loadClass("org.apache.avalon.framework.logger.Loggable"); // .........this
works OK
// the following .... fails with NoClassDefFoundError on Loggable
org.apache.fop.apps.Driver d = new org.apache.fop.apps.Driver();
} catch (Throwable t) {
cat.error("failed:", t);
It DOES work when I put the necessary jars on the server startup class path,
however it would obviously be
better to be able to bundle the 3rd party jars within my EAR ....... I know this
seems like it would be a general
weblogic classloader question - but I have had no problems with any other 3rd
party jars that are similar to
this one.
Has anyone else had these kinds of problems ?
Cheers,
Brian.

I have a similar problem, I tried to package the fop library with an ear also. I think it has to do with System properties. The fop library loads it's parser class from a system property, the class it finds is a weblogic library and that's when the problem begins. I was never able to solve this, but hope this gives you starting point. Keep us abreast of your findings.

Similar Messages

  • Apache fop classloading problem in EAR file

    HI,
    I am deploying a big EAR in WL 6.1 on solaris and I am bundling FOP 1.20.3
    within it, I am
    also including avalon 4.0 and logkit 1.0 jars within it as they are needed by
    fop.jar. Whenever I
    try to construct a "Driver()" class I get a NoClassDefFoundError on the org.apache.framework.logger.Loggable
    interface that it needs. The strange thing is that when I do the following :
    try {
    ClassLoader cl = this.getClass().getClassLoader();
    cl.loadClass("org.apache.avalon.framework.logger.Loggable"); // .........this
    works OK
    // the following .... fails with NoClassDefFoundError on Loggable
    org.apache.fop.apps.Driver d = new org.apache.fop.apps.Driver();
    } catch (Throwable t) {
    cat.error("failed:", t);
    It DOES work when I put the necessary jars on the server startup class path,
    however it would obviously be
    better to be able to bundle the 3rd party jars within my EAR ....... I know this
    seems like it would be a general
    weblogic classloader question - but I have had no problems with any other 3rd
    party jars that are similar to
    this one.
    Has anyone else had these kinds of problems ?
    Cheers,
    Brian.

    Dear Brian,
    It looks to me like org.apache.fop.apps.Driver might be doing a
    Class.forName() for the Loggable class. If Class.forName() does not pass a
    specific classloader, the system classpath loader is used; which is why it
    works when you put the classes on the system classpath.
    Best regards,
    Timothy Potter
    Senior Software Engineer
    eCommerce Server Division
    BEA Systems, Inc.
    "Brian Dowd" <[email protected]> wrote in message
    news:3c8c9ba0$[email protected]..
    >
    HI,
    I am deploying a big EAR in WL 6.1 on solaris and I am bundling FOP1.20.3
    within it, I am
    also including avalon 4.0 and logkit 1.0 jars within it as they are neededby
    fop.jar. Whenever I
    try to construct a "Driver()" class I get a NoClassDefFoundError on theorg.apache.framework.logger.Loggable
    interface that it needs. The strange thing is that when I do thefollowing :
    >
    try {
    ClassLoader cl = this.getClass().getClassLoader();
    cl.loadClass("org.apache.avalon.framework.logger.Loggable"); //.........this
    works OK
    // the following .... fails with NoClassDefFoundError on Loggable
    org.apache.fop.apps.Driver d = new org.apache.fop.apps.Driver();
    } catch (Throwable t) {
    cat.error("failed:", t);
    It DOES work when I put the necessary jars on the server startup classpath,
    however it would obviously be
    better to be able to bundle the 3rd party jars within my EAR ....... Iknow this
    seems like it would be a general
    weblogic classloader question - but I have had no problems with any other3rd
    party jars that are similar to
    this one.
    Has anyone else had these kinds of problems ?
    Cheers,
    Brian.

  • Error while configuring apache FOP for printing

    Dear All,
    I have a requirement to print a report using custom layout.
    I have installed apex 4.2 by configuring embedded PL/SQL gateway. I used the link:
    http://docs.oracle.com/cd/E37097_01/doc/install.42/e35123/overview.htm#CJABBFIH
    And for printing purpose I am installing apache FOP. I have installed oc4j in standalone mode. I followed the link:
    http://www.oracle.com/technetwork/developer-tools/apex/application-express/configure-printing-093060.html
    But after setting oc4jadmin password, I am getting following error
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    I am not well versed with java.
    Can anyone please throw light on this issue and help me resolve this problem. This is an urgent requirement.
    Thanks and regards,
    Deepika.

    Deepika R wrote:
    13/01/15 12:52:07 WARNING: EJBContainer.postInit Error generating wrappers for f
    ile:/E:/app/OracleDb/j2ee/home/applications/admin_ejb.jarjava.lang.Instantiation
    Exception: javac.exe not found under C:\Program Files\Java\jre7, please use a va
    lid jdk or specify the location of your java compiler in server.xml using the <j
    ava-compiler .../> tag
    I have JAVA_HOME and ORACLE_HOME system environment variables set up as mentioned in the guide.
    Seems like the Java EE container is looking for the Java compiler. Try installing the Java Development Kit (JDK) and respecify your JAVA_HOME accordingly. HTH.

  • Apache FOP getClassLoader problem

    I have loaded Apache FOP 1.1 into an 11g database, and a driver class to retrieve XML/XSLT and save PDF as CLOBs. When I try to execute this in the DB, I get
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.transform.TransformerException: java.security.AccessControlException: the Permission (java.lang.RuntimePermission getClassLoader) has not been granted to ProtectionDomain  (null <no signer certificates>)
    com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl$TransletClassLoader@98644313
    <no principals>
    java.security.Permissions@b0558743 (
    (java.lang.RuntimePermission modifyThreadGroup)
    (java.lang.RuntimePermission createSecurityManager)
    (java.lang.RuntimePermission modifyThread)
    (java.lang.RuntimePermission preferences)
    (java.lang.RuntimePermission exitVM)
    (java.util.PropertyPermission user.language write)
    (java.util.PropertyPermission * read)
    (oracle.aurora.security.JServerPermission LoadClassInPackage.*)
    It looks like the SecurityManager is only looking at PUBLIC permissions, even though the FOP classes were loaded into a schema with 'SYS:java.lang.RuntimePermission', 'getClassLoader', ''.
    Any ideas on how to get around this?
    Thanks!

    Dear Brian,
    It looks to me like org.apache.fop.apps.Driver might be doing a
    Class.forName() for the Loggable class. If Class.forName() does not pass a
    specific classloader, the system classpath loader is used; which is why it
    works when you put the classes on the system classpath.
    Best regards,
    Timothy Potter
    Senior Software Engineer
    eCommerce Server Division
    BEA Systems, Inc.
    "Brian Dowd" <[email protected]> wrote in message
    news:3c8c9ba0$[email protected]..
    >
    HI,
    I am deploying a big EAR in WL 6.1 on solaris and I am bundling FOP1.20.3
    within it, I am
    also including avalon 4.0 and logkit 1.0 jars within it as they are neededby
    fop.jar. Whenever I
    try to construct a "Driver()" class I get a NoClassDefFoundError on theorg.apache.framework.logger.Loggable
    interface that it needs. The strange thing is that when I do thefollowing :
    >
    try {
    ClassLoader cl = this.getClass().getClassLoader();
    cl.loadClass("org.apache.avalon.framework.logger.Loggable"); //.........this
    works OK
    // the following .... fails with NoClassDefFoundError on Loggable
    org.apache.fop.apps.Driver d = new org.apache.fop.apps.Driver();
    } catch (Throwable t) {
    cat.error("failed:", t);
    It DOES work when I put the necessary jars on the server startup classpath,
    however it would obviously be
    better to be able to bundle the 3rd party jars within my EAR ....... Iknow this
    seems like it would be a general
    weblogic classloader question - but I have had no problems with any other3rd
    party jars that are similar to
    this one.
    Has anyone else had these kinds of problems ?
    Cheers,
    Brian.

  • Java.lang.IllegalArgumentException: org.apache.fop.svg.SVGElementMapping

    Hi,
    I have an FOP application which presents the data retrieved from database in a PDF format.
    Now when Iam trying to deploy the FOP application to OC4J and I get the following error.
    java.lang.IllegalArgumentException: org.apache.fop.svg.SVGElementMapping is not an ElementMapping
         at org.apache.fop.apps.Driver.addElementMapping(Driver.java:464)
         at org.apache.fop.apps.Driver.setupDefaultMappings(Driver.java:314)
         at org.apache.fop.apps.Driver.<init>(Driver.java:222)
         at org.appfuse.fop.FOPHelper.createPDF(FOPHelper.java:48)
         at FOPServlet.execute(FOPServlet.java:168)
         at FOPServlet.doPost(FOPServlet.java:109)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    I believe its the problem with the class loaders.
    I even configured my orion-web.xml to load the local classes and following is the conf file:
    <orion-web-app
         deployment-version="9.0.4.0.0"
         temporary-directory="./temp"
         internationalize-resources="false"
         default-mime-type="application/octet-stream"
         servlet-webdir="/servlet/"
    >
         <web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="false" />
    </orion-web-app>
    I have loaded the most stable jar files(fop-0.20.5) required for the generation of PDF.
    The same application runs well in JDeveloper(10.1.2.0.0)
    Could somebody help me out with this.
    Its very urgent.
    Need to be able to deploy this by evening.
    Thanks
    Sridhar
    Message was edited by:
    Sridhar

    This means the code loading the element mappings does not recognize
    the SVGElementMapping as an ElementMapping, as it expects. The most
    likely reason is that they are loaded from different class loaders -That was the reason of my simple suggestion above.
    There are many ways that you can try now.
    One way is to put all libraries in your war into ORACLE_HOME/j2ee/home/applib. Also remove the following line
    <web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="false" />
    since this search-local-classes-first is problematic sometimes.
    It might be nice if you can verify that the classloader that loads SVGElementMapping is different from the one that loads Elementmapping at that point of code.
    Now Could somebody help me out as this is the problem of OC4J .Hmm, I would not say "problem of OC4J". A usage error or a false incompatibility at worst. "False" because there should be many normal and standard ways to make it work.

  • LOGO in PDF file (Apache FOP)

    Hi all...I'm using the Apache FOP PDF printing option with the jsp packaged in the AppEx 3.0.1 install. I would like to put a logo in the header of the generated PDF file. I made a compy of the default generic columns layout and added this to the header section in Page Template:
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="file:///tmp/FastenalLogo.png"/>
    </fo:block>
    The following error is then generated in the logs:
    07/10/31 10:50:44 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    07/10/31 10:50:44 [INFO] building formatting object tree
    07/10/31 10:50:44 [INFO] setting up fonts
    07/10/31 10:50:51 [INFO] [1]
    07/10/31 10:50:51 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 10:50:53 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:54 [INFO] [2]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:55 [INFO] [3]
    07/10/31 10:50:55 [ERROR] Error while creating area : Error creating FopImage ob ject (file:/tmp/FastenalLogo.png) : Jimi image library not available
    07/10/31 10:50:56 [INFO] Parsing of document complete, stopping renderer
    I also tried using a URL (with appropriate syntax), but that generated these errors:
    07/10/31 10:44:14 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:14 [INFO] [3]
    07/10/31 10:44:15 [ERROR] Could not load external SVG: http://epsilon.fastenal.c om:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespa ce required.
    07/10/31 10:44:15 [ERROR] Error while creating area : No ImageReader for this ty pe of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 10:44:15 [INFO] Parsing of document complete, stopping renderer
    Is it not possible to import an external image file into a PDF rendered by the Apache FOP? Any help would be greatly appreciated.
    Thanks,
    Leigh

    Hi Carl --
    I changed the image source to this:
    <xsl:variable name="_SECTION_NAME" select="string('master0')"/>
    <fo:static-content flow-name="region-header">
    <fo:block>
    Test Header Changes
    <fo:external-graphic src="http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg" />
    </fo:block>
    <fo:block xsl:use-attribute-sets="text text_2 text_0 #PAGE_HEADER_ALIGNMENT#">
    <fo:inline xsl:use-attribute-sets="page-header">#PAGE_HEADER#</fo:inline>
    </fo:block>
    </fo:static-content>
    I can access the image through my web browser using the URL, but my log is throwing these errors:
    07/10/31 13:01:18 [WARNING] table-layout=auto is not supported, using fixed!
    07/10/31 13:01:20 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:20 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:20 [INFO] [2]
    07/10/31 13:01:21 [ERROR] Could not load external SVG: http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg<Line 1, Column 50>: XML-20190: (Fatal Error) Whitespace required.
    07/10/31 13:01:21 [ERROR] Error while creating area : No ImageReader for this type of image (http://epsilon.fastenal.com:7784/i/FastenalLogo.jpg)
    07/10/31 13:01:21 [INFO] Parsing of document complete, stopping renderer
    Could the fo block be in the wrong place in the document? I'm not very familiar with XSL-FO and may have just placed it wrong.
    One other thing I just noticed. The webserver is actually using SSL, which on windows systems results in a pop-up about security. If I change the URL to https using the SSL port, I receive a message about security certificates.
    Thanks,
    Leigh
    Message was edited by:
    ljohnson74

  • APEX 4.1 - APACHE FOP PDF generation problem.

    Hi all,
    I'm having problem with PDF generation using APACH FOP on OC4J.
    When I test my print server as described here:
    http://marcsewtz.blogspot.com/2008/06/heres-another-posting-on-pdf-printing.html
    everything works without problem. But when I upload my Layout to APEX and try to generate PDF from apex I'm getting error:
    oracle.xml.parser.v2.XMLParseException: Unexpected EOF.
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)
         at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:549)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1375)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:362)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:308)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:337)
         at oracle.xml.xslt.XSLProcessor.newXSLStylesheet(XSLProcessor.java:714)
         at oracle.xml.xslt.XSLStylesheet.<init>(XSLStylesheet.java:322)
         at oracle.xml.parser.v2.XSLStylesheet.<init>(XSLStylesheet.java:114)
         at apex_fop._jspService(_apex__fop.java:71)
         [SRC:/apex_fop.jsp:21]
    I could see similar post here:
    Handling Special characters in call to apex_util.download_print_document
    But it doesn't explain my case as it's crashing even when I generate empty pdf(no data so no special characters, only empty XML file with no data should be sent to print server)
    Is there any way to see what xml is sent do print server for processing? That could eventually show where is a problem.
    Palo

    My mistake, there was really an "&" character in my template. now when I replaced it with %26 it works.
    However I would be still interested if there is a way to see what data is APEX engine sending to print server cause it will help me to find this kind of errors.
    Palo

  • PDF PRINTING using Apache FOP and Oracle Containers for J2EE

    Hi,
    I am having major confusion about the pdf printing in Oracle XE and Apex 3.1.2.00.02
    It clearly states that this is an available option on the Oracle website.
    According to Apex there are two options for printing report regions.
    Standard - which is free
    Advanced - which uses BI and requires a licence
    Standard requires me to have Apache FOP (which is provided by Oracle in the Apex release) and Oracle Containers for J2EE (OC4J)
    Where my understanding of all this falls down is the part where I am downloading the Oracle Containers for J2EE and the license agreement states this cannot be used in a production system (only as a protptype). Can anyone clarify this? This is surely a required componenet and for the standard report printing which is supposed to be free.
    My problem is that I need to have a database system on a laptop that will go off site for a number of weeks. We need report printing options.
    Can anyone help with this. im desperate.
    Kind regards
    colin mclay

    no not yet with Application Server.
    I have tried to compare the settings to another installation with a separeted oc4j as described in the howto. But at the moment i found no mistakes.
    If i call the url adresse like:
    http://localhost:18101/fop/apex_fop.jsp
    i get:
    500 Internal Server Error
    Servlet error: java.lang.ClassNotFoundException: fop.apex__fop
    I installed it another time with these settings:
    Web Anwendung= .../fop.war (selected war file from apex install directory)
    Anwendungsname= fop
    URL zuordnen= /fop
    I would like to know if its possible to use the fop.war out of apex install directory with the Application server? In the standalone version (as described in howto) it works. But if you install it there you don't need to define an URL.
    Is the URL /fop correct or what do i have to insert there?

  • PDF Printing with XSL-FO and Apache FOP

    Can anyone show me in the right direction for this? I've been hitting a wall for the past 2 weeks or so and it's really starting to infuriate me. How am I supposed to work this out? Where do I start? Let's say I create a layout file with a WYSIWYG XSL editor, in what format do I export it? XSL, XSLT or XSL-FO? I figured it was XSL-FO, but who knows. I tried them all anyways, but nothing seems to work. I seem to be missing a step or something, 'cause something's definitely not right.
    I created a report query (which actually contains two queries):
    select distinct
    V_Usager.NUMEROPERSONNE NoPersonne,
    V_Usager.NOMUSUEL || ', ' || V_Usager.PRENOM Usager,
    V_Usager.DATENAISSANCE DateNaissance,
    V_Usager.DESCRIPTION Sexe,
    ID_Demande,
    NomNature || nvl2(PrecisionNature,', Précision: ' || PrecisionNature,'') Nature,
    NomCadre,
    decode(IND_Securitaire, 1, 'Oui', '0', 'Non') Securitaire,
    NomRessource,
    DT_Demande,
    Note,
    ltrim(decode(IND_DEMANDEIVAC,1,'Dossier IVAC','') || decode(IND_DEMANDEFLORES,1,', Dossier Florès','') || decode(IND_RISQUECRISE,1,', Risque de crise','') || decode(IND_MENOTTES,1,', Menottes nécessaires','') || decode(IND_ADRESSECONFIDENTIELLE,1,', Adresse confidentielle','') || decode(IND_TELEPHONECONFIDENTIEL,1,', Téléphone confidentiel','') || decode(IND_RISQUEFUGUE,1,', Risque de fugue','') || decode(IND_RISQUEVIOLENCE,1,', Risque de violence','') || decode(IND_MALDESTRANSPORTS,1,', Mal des transports','') || decode(IND_MEDICAMENT,1,', Médicament à remettre','') || decode(IND_SIEGE,1,'',2,', Siège fourni',3,', Siège d''enfant requis',4,', Siège de nouveau-né requis',5,', Siège d''appoint requis') || decode(IND_HANDICAP,1,'',2,', Handicap mental',3,', Handicap physique') || decode(IND_MEDICAMENT,1,', Médicament à remettre','') || decode(IND_JUMELER,1,'',2,', Ne pas jumeler',3,', Ne pas jumeler avec une fille',4,', Ne pas jumeler avec un garçon') || decode(IND_TRANSPORTEUR,1,'',2,', Transporteur féminin',3,', Transporteur masculin') || nvl2(REMARQUEPRECISIONS,', ' || REMARQUEPRECISIONS,''),',') Precisions,
    Disp1.PRENOM || ' ' || Disp1.NOM SaisiePar,
    Disp2.PRENOM || ' ' || Disp2.NOM || nvl2(Elem2.Description, ', ' || Elem2.Description,'') Requerant,
    ltrim(nvl(NOMPERSONNEAVISER,'') || nvl2(TELEPHONEPERSONNEAVISER_1,' ' || substr(TELEPHONEPERSONNEAVISER_1,1,3) || '-' || substr(TELEPHONEPERSONNEAVISER_1,4,3) || '-' || substr(TELEPHONEPERSONNEAVISER_1,7,4),'') || nvl2(TELEPHONEPERSONNEAVISER_2,' ' || substr(TELEPHONEPERSONNEAVISER_2,1,3) || '-' || substr(TELEPHONEPERSONNEAVISER_2,4,3) || '-' || substr(TELEPHONEPERSONNEAVISER_2,7,4),''),',') PersonneAAviser
    from
    TBL_Demande_1,
    TBL_Demande_TRSP_1,
    V_Dispensateur Disp1,
    V_Dispensateur Disp2,
    V_ElemStruct Elem2,
    V_Usager,
    TBL_CadresLegaux,
    TBL_Natures,
    TBL_Ressources
    where
    DemandeID = :P7_IDDEMANDE
    and ID_Demande = DemandeID
    and ID_Usager = UsagerID
    and ID_CLegal = IDCadre
    and ID_Nature = IDNature
    and IND_Ressource = IDRessource
    and ID_Intervenant LIKE Disp1.NumeroDispensateur
    and ID_SaisiePar LIKE Disp2.NumeroDispensateur
    and Elem2.ElemStructID = ID_ElemStructSaisiePar
    select
    to_char(DT_TRANSPORT, 'dd/mm/yyyy') || ' à ' || HR_TRANSPORT || nvl2(DUREE,' durée: ' || DUREE,'') DateTRSP,
    decode(IND_TYPETRANSPORT,1,'Aller',2,'Retour',3,'Aller/Retour') TypeTransport,
    case IND_TYPETRANSPORT
    when 1 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    when 2 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    when 3 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    end AdresseDEP,
    case IND_TYPETRANSPORT
    when 1 then
    DEP_PRECISION
    when 2 then
    DEST_PRECISION
    when 3 then
    DEP_PRECISION
    end ContactDEP,
    case IND_TYPETRANSPORT
    when 1 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    when 2 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    when 3 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    end TelDEP,
    case IND_TYPETRANSPORT
    when 1 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    when 2 then
    DEP_NOM || ', ' || DEP_ADRESSE || ', ' || DEP_CPOSTAL
    when 3 then
    DEST_NOM || ', ' || DEST_ADRESSE || ', ' || DEST_CPOSTAL
    end AdresseDEST,
    case IND_TYPETRANSPORT
    when 1 then
    DEST_PRECISION
    when 2 then
    DEP_PRECISION
    when 3 then
    DEST_PRECISION
    end ContactDEST,
    case IND_TYPETRANSPORT
    when 1 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    when 2 then
    substr(DEP_TELEPHONE,1,3) || '-' || substr(DEP_TELEPHONE,4,3) || '-' || substr(DEP_TELEPHONE,7,4) || nvl2(DEP_POSTE,' poste ' || DEP_POSTE,'')
    when 3 then
    substr(DEST_TELEPHONE,1,3) || '-' || substr(DEST_TELEPHONE,4,3) || '-' || substr(DEST_TELEPHONE,7,4) || nvl2(DEST_POSTE,' poste ' || DEST_POSTE,'')
    end TelDEST,
    decode(RET_NOM || ', ' || RET_ADRESSE || ', ' || RET_CPOSTAL, ', , ', '', RET_NOM || ', ' || RET_ADRESSE || ', ' || RET_CPOSTAL) AdresseRET,
    RET_PRECISION ContactRET,
    substr(RET_TELEPHONE,1,3) || '-' || substr(RET_TELEPHONE,4,3) || '-' || substr(RET_TELEPHONE,7,4) || nvl2(RET_POSTE,' poste ' || RET_POSTE,'') TelRET
    from
    TBL_Demande_1,
    TBL_Demande_TRSP_1
    where
    DemandeID = :P7_IDDEMANDE
    and ID_Demande = DemandeIDI then created a report layout in XSL-FO with XSLfast, but it won't work at all. I always get the dreaded "corrupted file" when I test my PDF Report... any ideas why it doesn't work? Have I missed something obvious?
    Best regards,
    Mathieu

    Hello Mathieu
    i assume that the default PDF printing is working, but that you want to create some better looking reports and therefore use a different non-generic XSL-FO.
    You can do several things in Apex but you can use the Apache-Fop conversion also indepent from Apex.
    What you need is:
    1) An XML (Data) File. You can get it from your report query when you say export it to XML.
    2) The XSL-FO (Layout) file. THis is the processing instruction that says how convert the XML Data into an XML-FO. You can create it manually or with some tool.
    3) The next step is to render the XML-FO into any output format (pdf, rtf, html)
    The creation of the XML-FO and of the PDF are done by the apache fop converter (cocoon or Batik framework if I remember correctly) in a single process but you can influence it so that both steps are done separately. See also: http://xmlgraphics.apache.org/fop/0.95/running.html
    The advantage is that you usually get much better error messages from the single steps.
    My recommendation would be to do all the steps with a very basic report first.
    Then gradually improve the complexity of the report, the data and the layout.

  • Help generate dynamic table in xslt for apache FOP

    down vote favorite
    For the following xml file, i need to generate an xsl-fo file to be converted into pdf.
    I am new to style sheets and struggling to create dynamic table. Please help.
    Also, the width for each column varies,based on the column.How would i include this into the code?
    The Column Headers and Column Values are dynamically populated in the xml file. Below is a sample.
    Can anybody please help in generating xsl-fo or xslt code?
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <ReportData>
    <ColumnHeaders>
    <ColumnHeader>
    <Name>Col-Header1</Name>
    <Width>5</Length>
    </ColumnHeader>
    <ColumnHeader>
    <Name>Col-Header2</Name>
    <Width>10</Length>
    </ColumnHeader>
    <ColumnHeader>
    <Name>Col-Header3</Name>
    <Width>8</Length>
    </ColumnHeader>
    </ColumnHeaders>
    <Rows>
    <Row>
    <Column>Row1-Col1</Column>
    <Column>Row1-Col2</Column>
    <Column>Row1-Col3</Column>
    </Row>
    <Row>
    <Column>Row2-Col1</Column>
    <Column>Row2-Col2</Column>
    <Column>Row2-Col3</Column>
    </Row>
    </Rows>
    </ReportData>

    I did some xsl-fo a few years ago for a project.
    It was an invoice generator spawning multiple PDFs out of single XML document generated from the database. Pretty cool stuff but very resource-consuming.
    I'm a bit rusty but here's a basic example for a single table, based on your sample data :
    XSLT stylesheet :
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <xsl:output indent="yes"/>
      <xsl:template match="/ReportData">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
            <fo:simple-page-master master-name="Main" margin="8mm"
              page-width="250mm"
              page-height="100mm">
              <fo:region-body />
            </fo:simple-page-master>
          </fo:layout-master-set>
          <fo:page-sequence master-reference="Main">
            <fo:flow flow-name="xsl-region-body">
              <fo:block>
                <fo:table table-layout="fixed" border-style="solid">
                  <xsl:apply-templates select="ColumnHeaders/ColumnHeader" mode="column"/>
                  <xsl:apply-templates select="ColumnHeaders"/>
                  <fo:table-body>
                       <xsl:apply-templates select="Rows/Row"/>
                  </fo:table-body>
                </fo:table>     
              </fo:block>
            </fo:flow>
          </fo:page-sequence>
        </fo:root>
      </xsl:template>
      <xsl:template match="ColumnHeaders">
        <fo:table-header>
             <fo:table-row background-color="rgb(200,200,200)">
                  <xsl:apply-templates select="ColumnHeader" mode="header"/>
             </fo:table-row>
        </fo:table-header>
      </xsl:template>
      <xsl:template match="ColumnHeader" mode="column">
        <fo:table-column column-width="{concat(Width*10,'mm')}"/>
      </xsl:template>
      <xsl:template match="ColumnHeader" mode="header">
        <fo:table-cell border-style="solid">
          <fo:block font-weight="bold"><xsl:value-of select="Name"/></fo:block>
        </fo:table-cell>
      </xsl:template>
      <xsl:template match="Row">
           <fo:table-row>
          <xsl:apply-templates select="Column"/>
        </fo:table-row>
      </xsl:template>
      <xsl:template match="Column">
        <fo:table-cell border-style="solid">
          <fo:block><xsl:value-of select="."/></fo:block>
        </fo:table-cell>
      </xsl:template>
    </xsl:stylesheet>
    {code}
    Calling the XSLT engine and FOP :
    {code}
    D:\XSLT>gen_pdf_otn.bat
    D:\XSLT>java -jar saxon9he.jar -s:in/reportdata.xml -xsl:testfo.xsl -o:out/testfo.xml  2>errors.log
    D:\XSLT>java -jar fop.jar org.apache.fop.cli.Main -fo out/testfo.xml -pdf out/testfo.pdf -c morefontsconfig.xml  2>errors.log
    D:\XSLT>pause
    Appuyez sur une touche pour continuer...
    {code}
    Ouput :
    - The intermediate XSL-FO document :
    {code:xml}
    <?xml version="1.0" encoding="UTF-8"?>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
       <fo:layout-master-set>
          <fo:simple-page-master master-name="Main" margin="8mm" page-width="250mm" page-height="100mm">
             <fo:region-body/>
          </fo:simple-page-master>
       </fo:layout-master-set>
       <fo:page-sequence master-reference="Main">
          <fo:flow flow-name="xsl-region-body">
             <fo:block>
                <fo:table table-layout="fixed" border-style="solid">
                   <fo:table-column column-width="50mm"/>
                   <fo:table-column column-width="100mm"/>
                   <fo:table-column column-width="80mm"/>
                   <fo:table-header>
                      <fo:table-row background-color="rgb(200,200,200)">
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block font-weight="bold">Col-Header3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                   </fo:table-header>
                   <fo:table-body>
                      <fo:table-row>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row1-Col3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                      <fo:table-row>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col1</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col2</fo:block>
                         </fo:table-cell>
                         <fo:table-cell border-style="solid">
                            <fo:block>Row2-Col3</fo:block>
                         </fo:table-cell>
                      </fo:table-row>
                   </fo:table-body>
                </fo:table>
             </fo:block>
          </fo:flow>
       </fo:page-sequence>
    </fo:root>
    {code}
    - and the PDF document :
    http://mbperso.pagesperso-orange.fr/oracle/testfo.pdf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Apache FOP

    I am trying to install Apache FOP. I have downloaded from the Oracle website. I have then saved the file in c:\program files\java\oc4j.
    When I change directory I can locate the file but can not start oc4j? All of the related files mentioned in the installation notes are included in the ocj4 file.

    Hi Dimitri,
    Thanks for the reply.
    The environment variables have been set.
    ORACLE_HOME c:\program files\oracle\oc4j
    JAVA_HOME c:\program files\java\j2re1.4.2_8
    Move to c:\
    Path: c:\program files\oracle\oc4j\j2ee\home
    Command: oc4j -start
    Error: 'oc4j' is not recognised as an internal or external command, operable program or batch file.
    OR I also tried
    Command: java -jar oc4j.jar
    The first time I did this I was asked to create a password but then the initialization failed. If I try to execute this command again I get a Missing Class and Fatal Error????
    No idea.
    If you have any ideas on how to fix this it would be great appreciated.
    Many thanks
    Ros

  • Apache FOP format text

    I'm using Apex en Apache FOP to producce PDF reports.
    In the table i have some text for example: 'This is a <strong>short</strong> letter for me'
    When i have print the report, the text will not be parsed, because the text 'short' isn't bold. How can i do that ?

    Hi Bruinsmm,
    Thanks for reply.
    I did what you mentioned and it is working fine.
    I could generate pdf file,
    but when i am using report layout, it is giving me error
    (The adope reader could not open test.pdf because it is either not a supported file type or because the file has been damaged
    (for example, it was sent as an email attachment and wasn't correctly decoded)
    is there any thing should be running with tomcat??
    Thans and best regards.
    mohd.

  • APACHE FOP  LOGGER NOT SET

    In this day I have one issue and I was not able to resolve.
    Basically I found many post that speak of something similar. But don´t found one particular solution.
    I have one installation of APEX 3.1 and installed APache FOP 10.1.3.2.0, but this installations are on E-business suite 11.5.10.2
    First installed EBS 11.5.10.2 , then migrated DAtabase a 10.2.0.3, then installed APEX 3.1 and now installed OC4J Containers 10.1.3.2.0 and configured Apache FOP, my SO is Linux 4, I have jdk 1.4.2.
    I'm trying to print some reports as PDF and I have the following problem:
    I followed the step "5.Installing and Configuring Apache FOP" of http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
    When I try to print my report I get this message on OC4J console:
    08/07/24 20:39:52 [ERROR] Logger not set
    08/07/24 20:39:52 [WARNING] Screen logger not set - Using ConsoleLogger.
    08/07/24 20:39:52 [INFO] Using oracle.xml.parser.v2.SAXParser as SAX2 Parser
    08/07/24 20:39:52 [INFO] building formatting object tree
    08/07/24 20:39:52 [INFO] setting up fonts
    08/07/24 20:39:53 [INFO] [1]
    08/07/24 20:39:53 [WARNING] table-layout=auto is not supported, using fixed!
    08/07/24 20:39:53 [WARNING] Sum of fixed column widths 660000 greater than maximum specified IPD 658800
    08/07/24 20:39:53 [INFO] Parsing of document complete, stopping renderer
    I get this message on Log Apache
    [Thu Jul 24 20:39:53 2008] [warn] mod_plsql: Stale Connection due to Oracle error 22293
    [Thu Jul 24 20:39:53 2008] [error] mod_plsql: /pls/apex/wwv_flow.accept ORA-22293
    ORA-22293: LOB already opened in the same transaction
    anybody help me ?

    When I pressing the button does export writes that "it is impossible to display the page".Export does not occur.
    However, I added apex_fop.jsp following:
    java.io.FileOutputStream os = new java.io.FileOutputStream ("/tmp/out.test");
    driver.setOutputStream(os);
    driver.run();
    os.close();
    Once I click on the button in the apex export all the information stored in a file out.test.Open the file are all displayed correctly. However, the apex does not return the file, and writes "it is impossible to display the page"

  • Org.apache.fop.apps classes wanted

    in what *.jar files do these classes exist?
    The following lines give an error:
    import org.apache.fop.apps.Driver;
    import org.apache.fop.apps.Version;
    I currently get an error as I don't have the right jar files in my machine. So where to get them?
    Or could somebody possibly send them to my e-mail?
    [email protected]
    OK!
    AUlo

    fop.jar, under the Apache fop installation directory

  • Apache FOP not displaying Cyrillic properly

    Hi,
    I am using apache FOP to generate pdfs' in Russian. I have embedded the fonts into the application but the output is being displayed as html numerical codes.
    The html numerical codes are stored in the database but I am unable to render them properly. I know the fonts are embedded correctly because when I apply the fonts to English text, Russian characters are displayed in the pdf correctly.
    e.g the Russian characters are displayed like this:
    &#1087;&#1088;&#1086;&#1076;... etc
    Why are my codes not displaying properly ? I'm a bit lost at this point.
    thanks in advance

    Hi,
    thanks for the reply.
    To clarify things a bit. My web page is submitting Russian text which is being stored in an Oracle database. This text is being stored in the &#xxxx; format. This formatting is displayed properly in a web browser but I am using Apache FOP to produce a pdf and the Russian text is not being displayed as the Russian characters but as the relative &#xxxx; codes. So these codes are not being translated back into their Russian Cyrillic symbols.
    I have configured FOP and embedded the Cyrillic TTF but these codes are still not displayed. I can apply the Cyrillic font style to English text and Russian characters are displayed so it seems that that cyrillic TTF is embedded properly.
    I am not generating an serialized xml file but rather creating a javax.xml.transform.dom.DOMSource object and with my xsl file I create the pdf code snippet below:
    thanks
    Paul
              //Setup a buffer to obtain the content length
              ByteArrayOutputStream out = new ByteArrayOutputStream();
              // add fonts for Russian and Chinese certificates
              String fontConfig = path + "fonts/fontcfg.xml";
           FopFactory fopFactory = FopFactory.newInstance();
           fopFactory.setUserConfig(fontConfig);
           FOUserAgent foAgent = fopFactory.newFOUserAgent();
              //Setup FOP
              Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF,foAgent , out);
              //Setup Transformer
              Source xsltSrc = new StreamSource(new File(xslFile));
              TransformerFactory tFactory = TransformerFactory.newInstance();
              Transformer transformer = tFactory.newTransformer(xsltSrc);
              //Make sure the XSL transformation's result is piped through to FOP
              Result res = new SAXResult(fop.getDefaultHandler());
              //Setup input
              Source domSrc = new DOMSource(xmlDom);         
           //Start the transformation and rendering process
              transformer.transform(domSrc, res);
              //Prepare response
              response.setContentType("application/pdf");
              response.setContentLength(out.size());
              //Send content to Browser
              response.getOutputStream().write(out.toByteArray());
              response.getOutputStream().flush();

Maybe you are looking for

  • Getting error while deploying application in weblogic server 9.2

    Im getting below error in production in weblogic 9.2 server. ####<Jan 27, 2010 8:17:02 PM AST> <Error> <Deployer> <hpw2k3los01> <LOSWebServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1264

  • Problem with plug-ins in Photoshop Elements 10

    I imported plug-ins from CS3 to Photoshop Elements 10 plug-ins folder.  Why do othey not show up in Filters in Photoshop Elements 10?

  • Special characters in file names and directories

    I'm building a site that lets users create directories to which they give the name they want. Using PHP, is there one universal solution to avoid any special characters in directories, yet will display the directory/file names in html the way the use

  • Issue with importing data using data pump

    Hi Guys, Need your expertise here. I have just exported a table using the following datapump commands. Please note that I used *%U* to split the export into chunk of 2G files. expdp "'/ as sysdba'" dumpfile=DP_TABLES:PT_CONTROL_PS_083110_*%U*.dmp log

  • How to update firmaware with a PC

    I can download a package meant for a Mac. But how to unwrap it, and not the least how to push it to the AirPort Expressas a (assuming) binary file. My firmaware is 6.2 and want to upgrade to see if that gets me rid og the 80 minutes problem.