All Examples  All WebLogic Enterprise Connectivity Examples

package examples.wlec.ejb.simpapp

WebLogic Enterprise Connectivity EJB simpapp example

Interface Index

  • Converter
  • ConverterHome
  • Class Index

  • Client
  • ConverterBean
  • ConverterResult
  • ProcessingErrorException
  • ejbSimpappServlet
  • Deployment

  • DeploymentDescriptor.txt
  • manifest
  • about this example

    This example demonstrates how to use WebLogic Enterprise Connectivity to access a WebLogic Enterprise CORBA object from a stateless EJB (Enterprise JavaBean) on a WebLogic Server. There are two ways to run this example:

    This is what happens when you run the EJB examples:
    1. At startup:

    2. At runtime:

      or

    3. Acting as a WebLogic Enterprise client, the EJB:

    4. The Simple object performs the specified operation and returns the results to the EJB. The Simple object can perform two operations:

    5. The EJB sends the results to the application or servlet.

    6. If you are running the example that uses the servlet, the servlet compiles the results into a dynamically generated HTML page and sends the page to the HTML client.

    how to use this example

    Prerequisites

    Install and set up WebLogic Server, JDK, and WebLogic Enterprise. See WebLogic platform support for information about supported versions of these products.

    Setting up the example

    1. Build and run the WebLogic Enterprise Simpapp sample.

      See The Java Simpapp Sample Application in the WebLogic Enterprise documentation. The build procedure for the Java version of the Simpapp sample generates the client stubs and puts them in your working directory. Client stubs provide the programming interface for CORBA object operations.

      You can use the C++ version of the Simpapp sample, which uses C++ client stubs instead of Java client stubs. If you use the C++ version, you must run the idltojava compiler on the simple.idl file to generate Java client stubs. For information about manually generating client stubs, see Creating CORBA Client Applications in the WebLogic Enterprise documentation. You can get the idltojava compiler from Sun's Java IDL Web page. The idltojava compiler must be run on a computer with a C++ development environment, since it runs the C precompiler on the .idl source.

    2. Set up your WebLogic Server development environment as described in Setting your development environment.

    3. Copy the compiled WebLogic Enterprise Simpapp client stubs to your SERVER_CLASSES directory. The files you need to copy are:

    4. Build the ejbSimpapp EJB application.

      Run the build.cmd (Windows NT) or build.sh (UNIX) command in this directory. On UNIX, you might need to change the permissions on the build.sh file.

    5. Copy the file ejbSimpapp.html into your registered document root, which defaults to myserver/public_html.

    6. Register the servlet by modifying the weblogic.properties file.

      Add the following lines to the weblogic.properties file or, if these lines are already in the file but are commented out, uncomment them:

      weblogic.httpd.register.ejbSimpappServlet=examples.wlec.ejb.simpapp.ejbSimpappServlet
      weblogic.allow.execute.weblogic.servlet.ejbSimpappServlet=everyone

      Additionally, to let everyone request HTML files via the servlet, add the following line to the weblogic.properties file:

      weblogic.allow.execute.servlet.file=everyone

      For information about the weblogic.properties file, see HTTP- and servlet-related properties in the WebLogic Administrator's Guide.

    7. Initialize an IIOP session pool by modifying the weblogic.properties file. You can uncomment and edit the weblogic.CORBA.connectionPool.simplepool property in the weblogic.properties file.

      See the Administrators Guide Setting up WebLogic Enterprise Connectivity.

    8. Deploy wlec_ejb.jar by adding the wlec_ejb.jar file to the weblogic.ejb.deploy property in the weblogic.properties file.

      See Enterprise JavaBeans (WebLogic EJB) in the Administrator's Guide.

    Running the example

    1. Start the WebLogic Server in your server shell.

    2. To run the example with the HTML file and servlet:

    3. To run the example with the Client application:

      In your development shell, execute the application with a command like this:

        $ java examples.wlec.ejb.simpapp.Client

      You should get output similar to this from the client application:

      Beginning simpapp.Client...
      
      Start of Conversion for: It Works
      
      Converting to lower case: It Works
      
      ...Converted: it works
      
      Converting to upper case: It Works
      
      ...Converted: IT WORKS
      
      Removing Converter
      
      End simpapp.Client...
      

      The parameters are optional, but if any are supplied, they are interpreted in this order:

      url
      URL of the WebLogic Server, for example, t3://localhost:7001
      user
      User name, default null
      password
      User password, default null. It should be at least 8 characters.

      For more information, see Client.

    there's more...

    Read more about installing, configuring, and using WebLogic Enterprise Connectivity in:

    Copyright © 1999 BEA Systems, Inc. All rights reserved.

    Last updated 09/06/1999