23 Development Environment Setup

This chapter covers development environment setup topics that are relevant to Oracle Service Bus.

This chapter contains the following topics:

23.1 Running Multiple Development Servers with Derby

This section describes how to successfully run multiple development domains with one or more instances of the Apache Derby database provided with Oracle Service Bus.

Use this section in conjunction with the full documentation on creating domains, which is covered in "Configuring Oracle Service Bus" in the Oracle Fusion Middleware Installation Guide for Oracle Service Bus Installation Guide.

Note:

Derby is designed for development and testing environments only and is not supported for production use.

23.1.1 Derby Best Practices and Troubleshooting

When you create an Oracle Service Bus domain with the Oracle Fusion Middleware Configuration Wizard, the wizard by default creates a Derby database in the following location:

WL_HOME/common/derby/demo/databases/

With Derby selected as the Vendor on the wizard's JDBC configuration window, the name you provide in the DBMS/Service field determines the name of the Derby database that is created.

In Figure 23-1, the DBMS/Service field is populated with the default database name "osbexamples," and the corresponding /osbexamples directory is created.

Figure 23-1 The Derby Database for a Domain

Description of Figure 23-1 follows
Description of "Figure 23-1 The Derby Database for a Domain"

As a best practice, to avoid problems with server startup, always provide a unique DBMS/Service for each domain you create.

In addition, you can also avoid Derby conflicts by disabling the default Oracle Service Bus JMS reporting provider during the domain creation process. The reporting provider is the only Oracle Service Bus module that persists data in a database. While normal server startup also starts up the Derby database, no tables are created in the database, so no database conflicts occur.

If you disable the reporting provider, you can safely suppress Derby startup when you start the domain with the following command:

startWebLogic.cmd(.sh) noderby

For more information, see "How to Untarget the Default JMS Reporting Provider Before Domain Creation" in the Oracle Fusion Middleware Administrator's Guide for Oracle Service Bus at http://www.oracle.com/pls/as1111/lookup?id=OSBAG786.

For problems starting existing development servers that use Derby, see the section that follows, Section 23.1.1.1, "Troubleshooting Derby Configuration with Multiple Domains."

For more advanced use of Derby in a development environment, see the following sections:

23.1.1.1 Troubleshooting Derby Configuration with Multiple Domains

If you create multiple domains without changing the Derby database name in the Oracle Fusion Middleware Configuration Wizard's JDBC configuration window, new domains will not successfully start even though no other servers are running. This is because another domain is already associated with the default "osbexamples" domain.

To fix existing domains that cannot start because of database conflicts, do one of the following:

  • Delete the WL_HOME/common/derby/demo/databases/osbexamples directory and restart the server. The new domain creates a new osbexamples database.

    or

  • Edit DOMAIN_HOME/config/jdbc/wlsbjmsrpDataSource-jdbc.xml. Search for the database name (such as "osbexamples") and replace all instances of the name with a unique database name. On server restart, the new database directory is created with the new name you provided.

23.1.2 Sharing a Single Derby Database Instance Between Multiple Domains

In your development environment, you can configure multiple domains to share a single Derby database instance. Sharing a database instance improves development environment performance, because only one database instance is running rather than one per domain.

An instance means a run-time instance of Derby that is using a single port (the default port is 1527). However, each domain still creates a unique database to run on that instance.

To configure and run multiple domains that share a single Derby database instance:

  1. Create the first domain with the following JDBC configuration in the Oracle Fusion Middleware Configuration Wizard:

    Schema Owner: DEV_SOAINFRA (or another unique name)

    Schema Password: enter a password

    DBMS/Service: devdomain1 (or another unique name)

    Host Name: localhost

    Port: 1527

  2. After clicking Next, connection testing will fail (if Derby is not running). This is expected. Skip connection testing. At server startup, Oracle Service Bus automatically creates the reporting tables in Derby.

  3. Create the second domain.

    1. Use the following JDBC configuration:

      Schema Owner: DEV_SOAINFRA (or another unique name)

      Schema Password: enter a password

      DBMS/Service: devdomain2 (or another unique name)

      Host Name: localhost (or a machine name or IP address for a remote domain running the Derby instance)

      Port: 1527

    2. In the next window, select Administration Server, click Next, and make the port numbers unique.

  4. After creating the domain, in DOMAIN_HOME/bin/setDomainEnv.cmd(.sh):

    Change ALSB_DEBUG_PORT to 8883 (or another unique value).

    Change DEBUG_PORT to 8853 (or another unique value).

    Change DERBY_FLAG to false. (Optional. This prevents a server shutdown from stopping the running Derby instance.)

  5. Start the first domain normally.

  6. Start the next domain with the following command:

    DOMAIN_HOME/startWebLogic.cmd(.sh) noderby noexit
    
  7. If you want to create additional domains that share the same Derby instance, create the domains with unique a DBMS/Service (database name). For concurrently running domains, also make sure the Administration Server ports and debug ports are unique, as described in the previous steps.

    If you are running a single development domain when connecting to a remote Derby instance, you do not need to modify Admin Server or debug ports in your domain. Only the DBMS/Service must be unique.

23.1.3 Running Each Domain with a Unique Derby Instance

If you want each development server to use its own unique instance of Derby instead of sharing a single Derby instance, follow these steps to configure your domain and modify the port on the unique Derby instance. This configuration allows you to run multiple domains and multiple Derby instances concurrently.

  1. Create the domain with the following JDBC configuration in the Oracle Fusion Middleware Configuration Wizard:

    Schema Owner: DEV_SOAINFRA (or another unique name)

    Schema Password: enter a password

    DBMS/Service: devdomain (or another unique name)

    Host Name: localhost

    Port: 1627 (or another unique port)

  2. After clicking Next, connection testing will fail (if Derby is not running). This is expected. Skip connection testing. At server startup, Oracle Service Bus automatically creates the reporting tables in Derby.

  3. For running domains concurrently: Make sure the domain's Admin Server port numbers are unique if you want to run multiple servers concurrently.

  4. Finish creating the server.

  5. For running domains concurrently: In the domain's DOMAIN_HOME/bin/setDomainEnv.cmd(.sh):

    Change ALSB_DEBUG_PORT to 8883 (or another unique value).

    Change DEBUG_PORT to 8853 (or another unique value).

  6. In DOMAIN_HOME/bin/startWebLogic.cmd(.sh), find the following:

    "%WL_HOME%\common\derby\bin\startNetworkServer.cmd >"

    and add the following port argument to it:

    "%WL_HOME%\common\derby\bin\startNetworkServer.cmd -p 1627 >" (the Derby port number you used in your domain configuration)

Starting the server starts a unique Derby instance on the port you specified.

Note:

If you already created a server and want to change the Derby start-up port, change it in the Oracle WebLogic Server Administration Console under domain > Services > Data Sources > wlsbjmsrpDataSource > Configuration > Connection Pool.

23.2 Disabling the JMS Reporting Provider

By default, the Oracle Service Bus JMS reporting provider is deployed in an Oracle Service Bus domain. The reporting provider uses a database to persist reporting data. If you do not want to use the JMS reporting provider in your development domain, you can disable or untarget it during the domain creation process.

For details, see "How to Untarget a JMS Reporting Provider" in the Oracle Fusion Middleware Administrator's Guide for Oracle Service Bus at http://www.oracle.com/pls/as1111/lookup?id=OSBAG573.

Disabling the reporting provider prevents benign JMS reporting provider errors at server startup.

The reporting provider is the only Oracle Service Bus feature that persists data in a database. If you disable the reporting provider, you can prevent Derby from running by starting your server with the following command:

startWebLogic.cmd(.sh) noderby