7 Creating and Configuring System Resources

This chapter describes how to add and configure system resources, such as JNDI providers, SMTP servers, and proxy servers. System resources can be reused by Service Bus services in all projects in the session.

This chapter includes the following sections:

UDDI registries are also system resources in Service Bus. You can learn more about them in Working with UDDI Registries.

In the Oracle Service Bus Console, you create system resources in the System project, which by default includes a folder for each type of system resource. In JDeveloper, you create the resources in the Service Bus System Resources folder in the Application Resources panel. In the file system, these resources are located in the System subfolder under the JDeveloper application folder.

7.1 Working with JNDI Provider Resources

JNDI provider resources perform the JNDI lookups for Service Bus projects, providing the protocols and security credentials required for accessing remote servers.

You can use any protocol for the JNDI provider, including HTTP, HTTPS, t3, t3s, IIOP, and IIOPS. Service Bus supports several initial context factory classes for the JNDI lookup, depending on the application server you are using. When connecting to JBoss Application Server using IIOP or IIOPS, use the com.sun.jndi.cosnaming.CNCtxFactory class (IIOP/S is not supported in JBoss 7.0.0 or later).

7.1.1 Classpath Requirements for JBoss Application Server

When using JBoss initial context factory classes, make sure to include the class and any dependent classes in the Service Bus server classpath. The following JAR files are required in the server post-classpath or domain_name/lib directory. These files are located in your JBoss installation in the /client directory.

  • jbossall-client.jar for JBoss 4.x through 6.x

  • jboss-client.jar for JBoss 7.x

  • log4j.jar

Note:

If you do not want to add the client JAR file to the classpath, you can add the following files individually: jboss-client.jar, jboss-common-core.jar, jboss-integration.jar, jboss-logging-spi.jar, jboss-remoting.jar, jboss-security-spi.jar, jboss-serialization.jar, jbosssx-client.jar, and jnp-client.jar.

In addition, add jboss-ejb-client.properties to the server classpath or library with the following properties defined:

  • For unsecure connections:

    • remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

    • remote.connections=<name_of_connection>

    • remote.connection.conn1.host=<hostname>

    • remote.connection.conn1.port=<port>

  • For secure connections:

    • remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

    • remote.connections=<name_of_connection>

    • remote.connection.conn2.host=<hostname>

    • remote.connection.conn2.port=<port>

    • remote.connection.conn2.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS=JBOSS-LOCAL-USER

    • remote.connection.conn2.username=<username>

    • remote.connection.conn2.password=<password>

When using the IIOP protocol, include the following JAR files in the Oracle WebLogic Server classpath. These files are located in your JBoss installation in /server/all/lib, except logkit.jar, which is located in the /client directory.

  • jacorb.jar

  • avalon-framework.jar

  • logkit.jar

7.1.2 About JBoss Initial Context Factory Environment Properties

You can invoke EJBs deployed in JBoss Application Server using the EJB and JEJB transports. Service Bus supports the following initial context factory implementations for JBoss. You can specify environment properties for each of the classes for JBoss versions 4.x through 6.x.

  • org.jnp.interfaces.NamingContextFactory

  • org.jboss.naming.HttpNamingContextFactory

  • org.jboss.security.jndi.LoginInitialContextFactory

For JBoss 7.x, you can specify environment properties for org.jboss.naming.remote.client.InitialContextFactory.

The following table lists the environment properties and indicates whether they are supported for each factory class. For more information about these classes and the properties you can set, see "The Naming InitialContext Factories" at http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch3.chapter.html

Table 7-1 JBoss Initial Context Factory Environment Parameters

Parameter NamingContext Factory (4.x-6.x) HttpNaming ContextFactory (4.x-6.x) LoginInitial ContextFactory (4.x-6.x) InitialContext Factory (7.x only)

java.naming.factory.initial

Yes

Yes

Yes

Yes

java.naming.provider.url

Yes

Yes

Yes

Yes

java.naming.factory.url.pkgs

Yes

Yes

Yes

Yes

jnp.socketFactory

Yes

No

No

Yes

jnp.timeout

Yes

No

No

Yes

jnp.sotimeout

Yes

No

No

Yes

java.naming.security.principal

No

No

Yes

Yes

java.naming.security.credentials

No

No

Yes

Yes

java.naming.security.protocol

No

No

Yes

Yes

In addition, the following initial context properties may be required when looking up EJBs deployed on a JBoss cluster.

  • jnp.partitionName

  • jnp.discoveryGroup

  • jnp.discoveryPort

  • jnp.discoveryTimeout

  • jnp.disableDiscovery

7.1.3 How to View JNDI Provider Resources in the Oracle Service Bus Console

The Folders Definition Editor for JNDI providers lists all the JNDI provider resources you have created in the current session. Use this page to quickly find and access the JNDI provider resources you have defined.

To view JNDI providers in the console:

  1. Expand the System project, right-click JNDI Providers, and then select Open.

    The Folder Definition Editor appears with a list of existing JNDI provider resources.

  2. To locate specific JNDI providers, do the following:

    1. If the query fields are not visible above the JNDI Providers table, click Query by Example in the table toolbar.

    2. Enter the name of the JNDI provider resource you want to find above the Name column, and press Enter.

      You can enter wildcard characters (? for a single character; * for multiple characters) to perform a more general search.

    3. To view all JNDI providers again, clear the query fields and press Enter.

  3. To view the configuration for a JNDI provider, click the resource name in the JNDI Providers table.

  4. To delete a JNDI provider resource, select the name of the resource in the table and click Delete. See How to Delete JNDI Provider Resources.

7.1.4 How to Create a JNDI Provider Resource

When you create a JNDI provider resource, you specify connection information for the remote server, including the URL, the initial context factory, security credentials, and, optionally, environment properties for JBoss context factories.

To create a JNDI provider resource:

  1. Do one of the following:

    • If you are using JDeveloper, expand the Application Resources panel, right-click Service Bus System Resources, point to New, and then select JNDI Provider.

      Tip:

      To create JNDI provider resources directly in a project, making it a project-level resource, right-click the project, point to New, and then select JNDI Provider.

    • If you are using Oracle Service Bus Console, expand the System project, right-click JNDI Providers, point to Create, and then select Create JNDI Provider.

    The Create JNDI Service dialog appears.

  2. Enter a name and optional description for the resource, and then click Finish or Create.

    The JNDI Provider Definition Editor appears.

  3. Enter the URL for the JNDI provider in the format protocol://hostname:port.

    For clusters, use a comma-separated list of Managed Servers, in the format: protocol://hostname:ms1port, hostname:ms2port

  4. In the Initial Context Factory field, select the initial context factory class name for the JNDI provider you are creating.

  5. In the JNDI Request Timeout field, enter the JNDI request timeout in milliseconds.

  6. Select JNDI Cache to enable local caching of JNDI objects.

  7. To add environment properties for JBoss initial context factories, click the Add icon above the Environment Parameters table, and enter the parameter name and value in the new line that appears.

    For information about the parameters, see About JBoss Initial Context Factory Environment Properties.

  8. If access to the target JNDI provider requires a user name and password, enter a user name in the User Name field, and the associated password in the Password and Confirm Password fields.

  9. Click Save.

  10. If you are using the Oracle Service Bus Console, do any of the following in the toolbar in the upper right:

    • To reset the JNDI context to discard the JNDI connection and locally cached objects, click the Reset icon.

    • To test whether the JNDI provider can successfully establish a connection and obtain a JNDI context, click the Test icon.

  11. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.1.5 How to Edit JNDI Provider Resources

Once you create a JNDI provider resource, you can modify its description and most of the JNDI properties.

To edit a JNDI provider resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:

    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the JNDI provider resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the JNDI Providers folder in the System project.

  2. Right-click the JNDI provider name, and select Open.

    The JNDI Provider Definition Editor appears.

  3. Modify any of the fields described in How to Create a JNDI Provider Resource. The online help describes these fields in greater detail.

    Note:

    The New Password field is only editable if the JNDI provider was not configured with a user name and password.

  4. When you are done making changes, click Save.

  5. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.1.6 How to Delete JNDI Provider Resources

When you delete a JNDI provider resource, any references to the resource from other Service Bus resources are broken. To find out whether any resources reference a JNDI provider, open the JNDI provider resource in the JNDI Provider Definition Editor and click the Tools icon in the upper right, and then select References. In JDeveloper, right-click the JNDI provider and select Explore Dependencies.

To delete a JNDI provider resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:

    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the JNDI provider resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the JNDI Providers folder in the System project.

  2. Right-click the JNDI provider resource, and select Delete.

  3. If you are using JDeveloper, a confirmation dialog displays the number of references for the resource. Click Show Usages to view information about the references, and then click Yes to confirm that you want to delete the resource.

  4. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.2 Working with SMTP Server Resources

SMTP server resources define connection properties for SMTP servers and are used while configuring alert destination resources and business services based on the email transport.

The SMTP server global resource captures the address of the SMTP server, port number, and if necessary, the authentication credentials. The authentication credentials are stored inline and are not stored as a service account. For information about alert destinations, see Working with Alert Destinations.

7.2.1 How to View SMTP Server Resources in the Oracle Service Bus Console

The Folders Definition Editor for SMTP servers lists all the SMTP server resources you have created in the current session. Use this page to quickly find and access the SMTP server resources you have defined.

To view SMTP servers in the console:

  1. Expand the System project, right-click SMTP Servers, and then select Open.

    The Folder Definition Editor appears with a list of existing SMTP server resources.

  2. To locate specific SMTP server resources, do the following:

    1. If the query fields are not visible above the SMTP Servers table, click Query by Example in the table toolbar.

    2. Enter the name of the SMTP server resource you want to find above the Name column, and press Enter.

      You can enter wildcard characters (? for a single character; * for multiple characters) to perform a more general search.

    3. To view all SMTP servers again, clear the query fields and press Enter.

  3. To view the configuration for an SMTP server, click the resource name in the SMTP Servers table.

  4. To delete an SMTP server resource, select the name of the resource in the table and click Delete. See How to Delete SMTP Server Resources .

7.2.2 How to Create SMTP Server Resources

When you create an SMTP server resource, you specify connection information for the server, including the URL and port number. Security information is only required if the server requires authentication.

To create an SMTP server resource:

  1. Do one of the following:
    • If you are using JDeveloper, expand the Application Resources panel, right-click Service Bus System Resources, point to New, and then select SMTP Server.

      Note:

      To create SMTP server resources directly in a project, making it a project-level resource, right-click the project, point to New, and then select SMTP Server.

    • If you are using Oracle Service Bus Console, expand the System project, right-click SMTP Servers, point to Create, and then select Create SMTP Server.

    The Create SMTP Server dialog appears.

  2. Enter a name and optional description for the resource.
  3. If you are using the console, enter the SMTP server URL and port number.
  4. Click Finish or Create.

    The SMTP Server Definition Editor appears.

  5. If you are using JDeveloper, enter the URL and port number to access the SMTP server.
  6. If access to the SMTP server requires authentication, enter a user name in the User Name field, and the associated password in the Password and Confirm Password fields.
  7. Click Save.
  8. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.2.3 How to Configure a Default SMTP Server

In the Oracle Service Bus Console, you can designate one of the configured SMTP servers as the default server for the domain.

To configure a default SMTP server:

  1. If you have not already done so, click Create to create a new session or click Edit to enter an existing session.
  2. In the Project Navigator, expand System > SMTP Servers.
  3. Right-click the name of the SMTP server you want to be the default server, and then select Set as Default.
  4. To end the session and deploy the configuration to the runtime, click Activate.

7.2.4 How to Edit SMTP Server Resources

Once you create an SMTP server resource, you can modify its description and most of the server properties.

To edit an SMTP server resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:
    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the SMTP server resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the SMTP Servers folder in the System project.

  2. Right-click the SMTP server name, and select Open.

    The SMTP Server Definition Editor appears.

  3. Modify any of the fields described in How to Create SMTP Server Resources. The online help describes these fields in greater detail.
  4. When you are done making changes, click Save.
  5. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.2.5 How to Delete SMTP Server Resources

When you delete an SMTP server resource, any references to the resource from other Service Bus resources are broken. To find out whether any resources reference an SMTP server, open the SMTP server resource in the SMTP Server Definition Editor and click the Tools icon in the upper right, and then select References. In JDeveloper, right-click the SMTP server and select Explore Dependencies.

To delete an SMTP server resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:
    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the SMTP server resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the SMTP Servers folder in the System project.

  2. Right-click the SMTP server resource, and select Delete.
  3. If you are using JDeveloper, a confirmation dialog displays the number of references for the resource. Click Show Usages to view information about the references, and then click Yes to confirm that you want to delete the resource.
  4. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.3 Working with Proxy Server Resources

Proxy server resources are used while configuring the HTTP transport for business services.

For more information, see Using HTTP and Poller Transports.

7.3.1 Using Proxy Servers with SSL

When configuring a proxy server, you can specify the clear text or SSL port number for the server, in addition to the host name or IP address. Note that the port specified in the proxy server resource configuration corresponds to the actual physical port of the web proxy server and not the port of the back end service. The endpoint configuration on the business service, however, corresponds to the actual endpoint of the back end service. This is true even in the case of SSL/TLS Tunneling using the HTTP CONNECT command.

While some web proxy servers support HTTP CONNECT using both clear text and SSL sockets, other servers support it using only clear text sockets. For example, Oracle iPlanet Web Proxy Server 4.0 supports HTTP CONNECT using clear text and SSL sockets while Apache Web Server 2.2 in proxy server mode supports it using only clear sockets.

Typically, for SSL/TLS Tunneling support, you do not need to install server or Certificate Authority (CA) certificates on the physical proxy server. Instead, the web proxy server uses the certificate received from the caller (Service Bus, in this case) to open a secure socket. Similarly, when the server hosting the business application requires a client certificate, the certificate of the server hosting the proxy service (Service Bus) is used for authentication.

7.3.2 How to View Proxy Server Resources in Oracle Service Bus Console

The Folders Definition Editor for proxy servers lists all the proxy server resources you have created in the current session. Use this page to quickly find and access the proxy server resources you have defined.

To view proxy servers in the console:

  1. Expand the System project, right-click Proxy Servers, and then select Open.

    The Folder Definition Editor appears with a list of existing proxy server resources.

  2. To locate specific proxy server resources, do the following:

    1. If the query fields are not visible above the Proxy Servers table, click Query by Example in the table toolbar.

    2. Enter the name of the proxy server resource you want to find above the Name column, and press Enter.

      You can enter wildcard characters (? for a single character; * for multiple characters) to perform a more general search.

    3. To view all proxy servers again, clear the query fields and press Enter.

  3. To view the configuration for a proxy server, click the resource name in the Proxy Servers table.

  4. To delete a proxy server resource, select the name of the resource in the table and click Delete. See How to Delete Proxy Server Resources.

7.3.3 How to Create Proxy Server Resources

When you create a proxy server resource, you specify connection information for the server, including the server name and port number. Security information is only required if the server requires authentication.

You can configure multiple proxy servers for each proxy server resource. In this case, Service Bus can perform load balancing and offer fault tolerance features for the resource.

To create a proxy server resource:

  1. Do one of the following:

    • If you are using JDeveloper, expand the Application Resources panel, right-click Service Bus System Resources, point to New, and then select Proxy Server.

    • If you are using Oracle Service Bus Console, expand the System project, right-click Proxy Servers, point to Create, and then select Create Proxy Server.

    The Create Proxy Server dialog appears.

  2. Enter a name and optional description for the resource.

  3. Click Finish or Create.

    The Proxy Server Definition Editor appears.

  4. To define proxy servers, do the following in the Host-Port Parameters table:

    1. Click the Add icon above the table.

      A new row appears in the table.

    2. In the Host field, enter the host name or IP address of the proxy server.

    3. In the Port field, enter the proxy server's port number.

    4. To remove a host name and port number from the list, select the row in the table containing the server to delete and click the Delete icon.

  5. If access to the proxy server requires authentication, enter a user name in the User Name field, and the associated password in the Password and Confirm Password fields.

  6. Click Save.

  7. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.3.4 How to Edit Proxy Server Resources

Once you create a proxy server resource, you can modify its description and security options, and you can modify, add, and delete proxy servers from the host list.

To edit a proxy server resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:
    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the proxy server resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the Proxy Servers folder in the System project.

  2. Right-click the proxy server name, and select Open.

    The Proxy Server Definition Editor appears.

  3. Modify any of the fields described in How to Create Proxy Server Resources. The online help describes these fields in greater detail.
  4. When you are done making changes, click Save.
  5. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.

7.3.5 How to Delete Proxy Server Resources

When you delete a proxy server resource, any references to the resource from other Service Bus resources are broken. To find out whether any resources reference a proxy server, open the proxy server resource in the Proxy Server Definition Editor and click the Tools icon in the upper right, and then select References. In JDeveloper, right-click the proxy server and select Explore Dependencies.

To delete a proxy server resource:

  1. Expand the project and folders containing the resource to edit. This can be any of the following locations:
    • In JDeveloper, the Service Bus System Resources folder in the Application Resources panel.

    • In JDeveloper, the Service Bus project or folder in which the proxy server resource is located in the Application Navigator.

    • In Oracle Service Bus Console, the Proxy Servers folder in the System project.

  2. Select the proxy server resource, and click Delete.
  3. If you are using JDeveloper, a confirmation dialog displays the number of references for the resource. Click Show Usages to view information about the references, and then click Yes to confirm that you want to delete the resource.
  4. If you are using the Oracle Service Bus Console, click Activate to end the session and deploy the configuration to the runtime.