0 Replies Latest reply on Nov 17, 2003 2:17 PM by cbeauvois

    JBoss setup + launching child processes

    cbeauvois Newbie

      (Apologies for the cross post, I wasn't sure exactly where to post this.)

      We're trying to distill an eps into a pdf from within JBoss/Win32 using Acrodist (Adobe Distiller). We launch the job via COM/OLE in order to know when the job has completed, and the current thread just waits for the job to return. For the OLE connection we are using Jawin.

      We've succesfully run the code below in a command line tool, but when we run the same code from a Stateless Session bean(on JBoss 3.2.2), the resulting PDF does not get written out and no errors are reported.

      In both cases, we see Acrodist running in Task Manager, and see the CPU and memory spike; JBoss is running as admin, and the registry setting for Component control is set to 'full control' (On the command line, it already worked with just 'read control').

      Any ideas as to what we're missing to get this to work in JBoss?

      Thanks for your time.

      Chris


      Here is the code:

      try {
      log.info("initializing ole");
      Ole32.CoInitialize();
      log.info("initialized ole");
      String source = sourceName;
      String destination = "c:\\";
      if( !jobOptions.endsWith(".joboptions") )
      jobOptions = jobOptions + ".joboptions";
      DispatchPtr pdf = new DispatchPtr("PdfDistiller.PdfDistiller.1");
      log.info("got distiller COM object");
      pdf.invoke("FileToPDF", source, destination, jobOptions);
      log.info("FileToPDF complete");
      }
      catch( COMException e ) {
      log.error("COMException");
      log.error(" message:" + e.getMessage());
      log.error(" hresult:" + e.hresult);
      return false;
      }
      finally {
      try {
      Ole32.CoUninitialize();
      log.info("uninitialized ole");
      }
      catch( COMException x ) {
      log.warning( "Could not CoUninitialize OLE system");
      log.warning(" message:" + x.getMessage());
      log.warning(" hresult:" + x.hresult);
      }
      }


      JBoss Error log (showing no errors though):

      2003-11-17 12:40:19,669 INFO [com.myadguys.ejb.RenderOpsSession] initializing ole
      2003-11-17 12:40:19,685 INFO [com.myadguys.ejb.RenderOpsSession] initialized ole
      2003-11-17 12:40:19,794 INFO [com.myadguys.ejb.RenderOpsSession] got distiller COM object
      2003-11-17 12:40:26,060 INFO [com.myadguys.ejb.RenderOpsSession] FileToPDF complete
      2003-11-17 12:40:26,075 INFO [com.myadguys.ejb.RenderOpsSession] uninitialized ole