Using the Java API example

RPE ships with an example application built on the java API. The source code for the application is found in %RPE_HOME%\lib\api\examples\

To build the application you need to follow the procedure described here: Building the sample application We use Eclipse as the development environment but you can use any Java IDE you want as long as it uses a Java 6 SDK. See Preparing the your environment to use the API

Once your application is built and you export it as a jar you can use it as described in the Command line switches for the example

More information on the API, such as most common use cases is available in the Using the Java API section of the RPE Infocenter.

A build of the example and a Windows script to launch it have been made available on the new RPE Wiki To use them you need to do the following:

  1. copy the SampleDocgen.jar in %RPE_HOME%\lib
  2. invoke SampleDocgen.bat with the full path of the DSX you want to run. If the path contains whitespaces you need to enclose it in “

Example:     SampleDocgen.bat “d:\rpe\test API\sample.dsx”

Author: Dragos Cojocari

Architect for Rational Publishing Engine

10 thoughts on “Using the Java API example”

  1. Hi Dragos,

    Thanks for this post, we are now using the java API extensively to configure specifications with user credentials and populate external variables at the time of generation. This has been vital to automating our document generation process.

    One question I have concerns licensing. When using the RPE application, a user may consume one licence but open multiple instances. This is useful as document generation may be carried out concurrently. Using the java API we have found that after one instance consumes a licence, other instances display the following error:

    CRRPE301E The license could not be verified.
    Licensed number of users already reached.
    Feature: RPE_PUBLISH
    License path: XXXXX@XXXXX
    FLEXnet Licensing error:-4,132

    Can this issue be avoided somehow, so as to use the Java API to run multiple generations concurrently on the same user account?

    Best Regards,


    1. Hey Sam,

      I’m glad you are using the Java API and it’s useful to you.

      >>> Using the java API we have found that after one instance consumes a licence, other instances display the following error:
      This is by design. Please raise an RFE for this to be reviewed in the product management team.


  2. Hello,
    This simple command worked before
    var cmd = “cmd /c ” + ‘”‘ + “echo ^” + ‘”‘ + “>>” + textFile;


    Now after getting upgraded to 2.1.1
    Error: TypeError: Cannot call property getRuntime in object [JavaPackage java.lang.Runtime]. It is not a function, it is “object”. (src1#3)Finished

    Does java API still work with 2.1.1 ?

  3. Hello Dragos

    I am trying to create plug-in to run RPE from context menu for package.
    it works if I run from main menu but when extend the class with RPUserPlugin and call the method from OnMenuItemSelect(), i am using rhapsody 8.2 and RPE 2.0.1.

    is there any limitation or something why the plugin is not working.

  4. Hi,
    I’m trying to use the api with RPE Version 2.1 Build 20160518_1200.
    I took the example IBM provided in file ‘’ from folder ‘C:\Program Files\IBM\Rational\Publishing Engine\lib\api\examples’.
    First I went trough java errors because some v1.3 classes where missing. I fixed these errors on missing jars by adding ‘C:\Program Files\IBM\Rational\DOORS\9.6\lib\dxl\standard\export\RPE_light\lib’ to my classpath.
    After this fixed I was able to run the ‘’ class and got the syntax help message returned by the showSyntax method.
    Then I tried with a valid syntax and a valid dsx file and I got the famous CRRPE3010E license error.

    Here is a part of the message (sorry it’s in french):
    2150 [RRDG_1:21-CORE] DEBUG – CRRPE3010E La licence n’a pas pu être vérifiée.
    Impossible d’accéder à la fabrique de licences. Impossible d’accéder à la fabrique de licences.
    Caused by: java.lang.UnsatisfiedLinkError: rcl_telelogic (Not found in java.library.path)

    ERROR [RRDG_1:21-CORE] – CRRPE3010E La licence n’a pas pu ?ªtre v??rifi??e.

    I found this Note :
    but it doesn’t solve my problem.

    Does RPE API still work in RPE 2.x?

    Thanks for your help.


Leave a Reply to Dragos Cojocari Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s