4 Replies Latest reply on Mar 16, 2010 3:56 PM by screenname345989487

    OutputClient - a starter qu

    screenname345989487

      Hi,

       

      I am testing the OutputClient.generatePDFOutput() method, and get the follwoing error:

       

      com.adobe.livecycle.output.exception.OutputException

       

       

       

       

       

      : java.lang.IllegalStateException

      at com.adobe.livecycle.output.client.OutputClient.generatePDFOutput(

       

       

      OutputClient.java:149)

      at com.ytzsys.output.TEST.CreatePDFDocument.main(

       

      CreatePDFDocument.java:82)

      Caused by:

       

      java.lang.IllegalStateException

      at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable(

       

       

      ServiceClientFactory.java:69)

      at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(

       

      ServiceClient.java:220)

      at com.adobe.livecycle.output.client.OutputClient.invokeRequest(

       

      OutputClient.java:607)

      at com.adobe.livecycle.output.client.OutputClient.generatePDFOutput(

       

      OutputClient.java:132)

      ... 1 more

      Caused by: java.lang.NoClassDefFoundError:

       

      javax/ejb/EJBException

      at com.adobe.idp.dsc.clientsdk.ServiceClientFactory.evaluateMessageDispatcher(

       

       

      ServiceClientFactory.java:587)

      at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(

       

      ServiceClient.java:215)

      ... 3 more

       

       

      The LiveCycle server is a JBoss turn-key installation on my Windows machine.  The code is basically copied form the API quick start, with a change of the file names only, and is attched below.  

       

      Your help on this problem is greatly appreciated.

       

      Thanks.

       

      Kelvin

       

       

       

        • 1. Re: OutputClient - a starter qu
          screenname345989487 Level 1

          Here is the source code:

           

           

          /*

          * This Java Quick Start uses the EJB mode and contains the following JAR files

          * in the class path:

          * 1. adobe-output-client.jar

          * 2. adobe-livecycle-client.jar

          * 3. adobe-usermanager-client.jar

          * 4. adobe-utilities.jar

          * 5. jbossall-client.jar (use a different JAR file if LiveCycle ES is not deployed

          * on JBoss)

          *

          * These JAR files are located in the following path:

          * <install directory>/Adobe/LiveCycle9.0/LiveCycle_ES_SDK/client-libs/common

          *

          * The adobe-utilities.jar file is located in the following path:

          * <install directory>/Adobe/LiveCycle9.0/LiveCycle_ES_SDK/client-libs/jboss

          *

          * The jbossall-client.jar file is located in the following path:

          * <install directory>/Adobe/LiveCycle9.0/jboss/client

          *

          * If you want to invoke a remote LiveCycle ES instance and there is a

          * firewall between the client application and LiveCycle ES, then it is

          * recommended that you use the SOAP mode. When using the SOAP mode,

          * you have to include additional JAR files located in the following

          * path

          * <install directory>/Adobe/LiveCycle9.0/LiveCycle_ES_SDK/client-libs/thirdparty

          *

          * For information about the SOAP

          * mode and the additional JAR files that need to be included,

          * see "Setting connection properties" in Programming

          * with LiveCycle ES

          *

          * For complete details about the location of the LiveCycle ES JAR files,

          * see "Including LiveCycle ES library files" in Programming

          * with LiveCycle ES

          */

          import

           

           

           

           

           

          com.adobe.livecycle.output.client.*;

          import

           

           

           

           

           

          java.util.*;

          import

           

           

          import

           

           

          import

           

           

          import

           

           

          import

           

           

          public

           

           

          public static void main(String[] args) {

           

           

          try{

           

          //Set connection properties required to invoke LiveCycle ES

          Properties connectionProps =

          new Properties();

          connectionProps.setProperty(ServiceClientFactoryProperties.

          DSC_DEFAULT_EJB_ENDPOINT, "jnp://localhost:1099");

          connectionProps.setProperty(ServiceClientFactoryProperties.

          DSC_TRANSPORT_PROTOCOL,ServiceClientFactoryProperties.DSC_EJB_PROTOCOL);

          connectionProps.setProperty(ServiceClientFactoryProperties.

          DSC_SERVER_TYPE, "JBoss");

          connectionProps.setProperty(ServiceClientFactoryProperties.

          DSC_CREDENTIAL_USERNAME, "administrator");

          connectionProps.setProperty(ServiceClientFactoryProperties.

          DSC_CREDENTIAL_PASSWORD, "password");

           

           

          //Create a ServiceClientFactory object

          ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);

           

           

          //Create an OutputClient object

          OutputClient outClient =

          new OutputClient(myFactory);

           

           

          //Reference form data

          FileInputStream fileInputStream =

          new FileInputStream("C:\\Adobe\\PurchaseOrder_2_pages.xml");

          Document inXMData =

          new Document (fileInputStream);

           

           

          //Set PDF run-time options

          PDFOutputOptionsSpec outputOptions =

          new PDFOutputOptionsSpec();

          outputOptions.setFileURI(

          "C:\\Adobe\\PurchaseOrder.pdf");

           

           

          //Set rendering run-time options

          RenderOptionsSpec pdfOptions =

          new RenderOptionsSpec();

          pdfOptions.setLinearizedPDF(

          true);

          pdfOptions.setPdfVersion(

          "1.6");

          pdfOptions.setAcrobatVersion(AcrobatVersion.

          Acrobat_8);

           

           

          //Create a PDF document

          OutputResult outputDocument = outClient.generatePDFOutput(

          TransformationFormat.

          PDF,

           

          "PurchaseOrder.xdp",

           

          "C:\\Adobe",

          outputOptions,

          pdfOptions,

          inXMData

          );

           

           

          //Retrieve the results of the operation

          Document metaData = outputDocument.getStatusDoc();

          File myFile =

          new File("C:\\Adobe\\Output.xml");

          metaData.copyToFile(myFile);

          }

           

          catch (Exception ee)

          {

          ee.printStackTrace();

          }

          }

          }

           

          class CreatePDFDocument {

           

           

          com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;

           

            

          com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
          com.adobe.idp.Document;
          java.io.FileInputStream;
          java.io.File;
          • 2. Re: OutputClient - a starter qu
            Jasmin Charbonneau Level 4

            You get a ClassDefNotFound error.

             

            Are you sure you have all the client jar files setup properly in your application?

             

            Jasmin

            • 3. Re: OutputClient - a starter qu
              screenname345989487 Level 1

              Hi Jasmin,

               

              Thanks for your quick response.  I have everything in the client-libs/common folder added to the library of my project.  I am thinking the ClassDefNotFound error is thrown because of a class can not be found from the server side.

               

              On the server side, I only selected the Output module during intallation.  I hope this is not a problem.

               

               

              Thanks.

               

              Kevin

              • 4. Re: OutputClient - a starter qu
                screenname345989487 Level 1

                The problem was indeed because of missing jars.  It worked after I included all the jars listed in the quick start guide and the jars in the client-libs/thirty-party.

                 

                Thanks, Jasmin!