Deploying components to an application server

The deployment tool provided with the server plug-in wraps PowerBuilder NVOs as standard EJB session beans and generates target-specific deployment descriptors to bind JNDI names and JDBC data source resource references automatically.

StepsDeploying PowerBuilder components

  1. Open the PowerBuilder Application Server Component project in the Project painter.

  2. Select Edit | Properties from the menu, or click Properties on the PainterBar.

  3. On the Server Host page in the Properties dialog, verify that the properties you specified in the Application Server Profiles dialog are correct. See “Creating an application server profile”.

    NoteYou can override the host name and port number that the server uses for its deployment listener by changing the iiopListeners property in %PB_SERVER_HOME%\config\pb-server-<targetServerName>.xml. If you change this property, re-run the configure command.

  4. In the Standard Options group on the Components page, verify that you have selected Stateless Session Bean if you want the component to be stateless.

  5. If your scripts reference DataWindow objects dynamically, on the Libraries page, select the Include Unreferenced Objects in Consolidated PBD to make the DataWindow definitions available to the component.

  6. On the Advanced page, optionally specify the names and values of custom EJB properties.

  7. Click OK to apply your changes.

  8. Select Design | Deploy Project from the menu or click the Deploy button on the PainterBar.

StepsValidating deployment

To validate that your NVOs deployed successfully, you can run the test program pb-server-test. pb-server-test must communicate directly with the application server, not with a proxy server.

  1. Verify that the application server with the server plug-in is running.

  2. Use the PowerBuilder IDE to define a component called “MyComp” (case sensitive) in a package called “pbtest.”

  3. Add a few business methods to the component; perhaps methods that access the database.

  4. To generate basic performance metrics, create a method called “perftest”; for example, as in the following pseudocode:

    integer perftest(integer a, integer b)
    {
       return a+b;
    }
    
  5. In pb-server-<targetServerName>.xml (for example, pb-server-weblogic.xml), verify that these properties are set correctly:

    <property name="test.username" value="weblogic”/>
    <property name="test.password" value="weblogic"/>
    

    NoteIf you change the XML configuration file, re-run configure—see “Configuring the server plug-in”.

  6. For WebSphere only, use the IBM JVM, instead of the Sun JVM:

    1. Set JAVA_HOME to %WAS_HOME%\java.

    2. Add %JAVA_HOME%\bin to the path.

  7. Deploy the package to your application server.

  8. Change to %PB_SERVER_HOME%\bin, and run:

    pb-server-test
    

    The test program tries to call all the methods in your component, using fake parameter values; for example, 1, 2, “S1,” “S2.” If you created a “perftest” method, the test program calls it repeatedly. If the program runs successfully, you see something similar to the following:

    Looking up home interface using JNDI name: pbtest/MyComp
    Obtaining EJB meta data...
    Resolving home interface class...
    Home interface type is: ejb.components.pbtest.MyCompHome
    Narrowing home interface...
    Looking up home create() method...
    Calling home create method...
    Remote interface type is: ejb.components.pbtest.MyComp
    Business method signatures:
    perftest(integer, integer)
    mymethod(java.lang.String, java.lang.String)
    Calling business methods:
    perftest(1, 2) -> 3
    ... checking application server remote call performance
    #remote calls/sec = 1189
    #remote calls/sec = 1641
    #remote calls/sec = 1650
    #remote calls/sec = 1739
    #remote calls/sec = 1749
    #remote calls/sec = 1748
    #remote calls/sec = 1748
    #remote calls/sec = 1749
    #remote calls/sec = 1768
    #remote calls/sec = 1768
    mymethod(S1, S2) -> S1S2
    Test passed.
    

    NoteIf you see an error such as LoadLibrary Failed: pbjag100.dll, verify that the PowerBuilder directory that contains pbvmXXX.dll is in the system PATH.

Source code for the test program is located in %DJC_HOME%\src\java\com\sybase\pb\server\PbServerTest.java.