|
WebLogic Server 6.1 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Interface Summary | |
| Account | The methods in this interface are the public face of AccountBean. |
| AccountHome | This interface is the home interface for the EJBean AccountBean, which in WebLogic is implemented by the code-generated container class AccountBeanC. |
| RMILogger | This remote interface is implemented by RMILoggerImpl. |
| Class Summary | |
| AccountBean | AccountBean is an EntityBean. |
| BankAppServlet | BankAppServlet is a servlet. |
| BankConstants | Constants class |
| Client | This class demonstrates calling an entity EJBean, followed by two exercises: |
| RMILoggerImpl | With WebLogic RMI, you don't need to extend UnicastRemoteObject. |
| Exception Summary | |
| ProcessingErrorException | This class is used with the WebLogic EJBean container-managed example package. |
This WebLogic 5.1 example shows how EJB, JSP, servlet, RMI, and ACL security work together. It is the basis for the migration tutorial, which details the process of migrating a WebLogic 5.1 application to a WebLogic 6.0 server. This sample application uses the container managed Account EJB. The application flows as follows:
| Additional Resources for examples.tutorials.migration.banking | |
| Login.html | The HTML to look up the account. |
| AccountDetail.jsp | The JSP that displays the account data. |
| Error.jsp | The JSP that displays the error. |
Since this is a WebLogic 5.1 example, the following instructions are specific to WebLogic 5.1 server:
We provide separate build scripts for Windows NT and UNIX:
These scripts will build the example and place the files in the correct locations in your WebLogic Server distribution:
With database persistence, each instance of an EJBean is written to a row in a table. The table (ejbAccounts) must be created and exist in the database before the example is run. If you are using the evaluation copy of Cloudscape that is included with WebLogic, this table has already been created in the "demo" database.
You'll need to:
"create table ejbAccounts (id varchar(15), bal float, type varchar(15))"
# Add a TXDataSource for the connection pool: weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool
# You can use this connection pool with any of the EJBean examples.
# Uncomment to use:
weblogic.jdbc.connectionPool.demoPool=\
url=jdbc:cloudscape:demo,\
driver=COM.cloudscape.core.JDBCDriver,\
initialCapacity=1,\
maxCapacity=2,\
capacityIncrement=1,\
props=user=none;password=none;server=none
You can use this pool for Cloudscape. For other databases, you'll need
to set an appropriate url and driver, such as
url=jdbc:weblogic:oracle,\ driver=weblogic.jdbc.oci.Driver,\
# Add an ACL for the connection pool: weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone
If you need more information about how to use connection pools, read Using WebLogic JDBC: Using connection pools.
Note: If you're running under the Microsoft SDK for Java, you'll also need to add the path to the .jar to the CLASSPATH for your WebLogic Server.
weblogic.httpd.register.banking=examples.tutorials.migration.banking.BankAppServlet
For more help with registering servlets, see the WebLogic Administrators Guide document, Setting WebLogic properties.
weblogic.system.startupClass.rmilogger=examples.tutorials.migration.banking.RMILoggerImpl
If you're starting the Server from the command line, you'll need to add an entry such as c:/weblogic/eval/cloudscape/lib/cloudscape.jar to the Java system classpath before starting the server, as described in the Administrators Guide Setting up and starting the WebLogic Server.
You can check that the EJBean has been deployed correctly either by checking the server command line window, or by opening the Console and examining "EJB" under the "Distributed objects"; you should see beanManaged.AccountHome deployed, and can monitor its activity.
http://localhost:7001/Login.html
|
Documentation is available at http://e-docs.bea.com/wls/docs61 |
|||||