2 Developing a WebLogic Thin T3 Client

Learn how to develop and use WebLogic Thin T3 clients.

Understanding the WebLogic Thin T3 Client

The WebLogic Thin T3 client (wlthint3client.jar) is a light-weight alternative to the full install client (weblogic.jar). The thin T3 client has a minimal footprint while providing access to a rich set of APIs that are appropriate for client use. As its name implies, the thin T3 client requires using the WebLogic T3 protocol.

The thin T3 client is the recommended option for most remote client use cases. There are some limitations in the thin T3 client as outlined below.

You can use the thin T3 client in standalone applications. It is also designed for applications running on foreign (non-WebLogic) servers. One common use case is integration with WebLogic JMS destinations.

WebLogic Thin T3 Features

This release supports:

  • Oracle WebLogic Server T3/T3S protocol for Remote Method Invocation (RMI), including RMI over HTTP (HTTP tunneling) and RMI over HTTPS (HTTP tunneling over SSL). For more information on WebLogic T3 communication, see Using WebLogic RMI with T3 Protocol in Developing RMI Applications for Oracle WebLogic Server.

  • Access to JMS, JMX, JNDI, and EJB resources available in WebLogic Server.

  • The WebLogic Store-and-Forward (SAF) Service when used in combination with the wlsaft3client.jar. See Reliably Sending Messages Using the JMS SAF Client.

  • Transaction initiation and termination (rollback or commit) using JTA.

  • WebLogic client JMS features, including Unit-of-Order, Unit-of-Work, message compression, XML messages, JMS automatic client reconnect, and Destination Availability Helper APIs.

  • Client-side clustering allowing a client application to participate in failover and load balancing of a WebLogic Server instance. See Clustered RMI Applications in Developing RMI Applications for Oracle WebLogic Server.

  • JAAS authentication and JSSE SSL. See Security.

  • Network class loading. By default, the network class loading for the thin T3 client is disabled. Use the following system property to enable network classloading:

    -Dweblogic.rmi.networkclassloadingenabled=true

Limitations and Considerations

This release does not support:

  • MBean-based utilities (such as JMS Helper, JMS Module Helper), and JMS multicast. You can use JMX calls as an alternative to "mbean-based helpers."

  • JDBC resources, including WebLogic JDBC extensions.

  • Running a WebLogic RMI server in the client.

The thin T3 client uses JDK classes to connect to the host, including when connecting to dual-stacked machines. If multiple addresses available on the host, the connection may attempt to go to the wrong address and fail if the host is not properly configured.

Interoperability

This release of the WebLogic Thin T3 client has the following interoperability support:

Prior WebLogic Server Releases

For information on WebLogic Thin T3 client support for communicating with previous WebLogic Server releases, see Protocol Compatibility in Understanding Oracle WebLogic Server.

Foreign Application Servers

The WebLogic Thin T3 client JAR is supported on the following application servers:

  • GlassFish

  • IBM WebSphere Application Server

  • Red Hat JBoss Application Server

Security

For general information on client security see:

Connection Considerations

The WebLogic Thin T3 client uses JDK classes to connect to the host. If your host has multiple addresses (Dual-Stack) available, your client may connect to the wrong IP address if the host is not configured properly.

Developing a Basic WebLogic Thin T3 Client

Learn how to create a basic WebLogic Thin T3 client using a WebLogic initial context.

Use the following steps to create a basic WebLogic Thin T3 client:

  1. Obtain a reference to the remote object.

    1. Get the initial context of the server that hosts the service using a T3 URL in the form of t3://ip address:port or t3s://ip address:port.

    2. Obtain an instance of the service object by performing a lookup using the initial context. This instance can then be used just like a local object reference.

  2. Call the remote objects methods.

  3. Place the wlthint3client.jar in your client classpath. It is located in the WL_HOME\server\lib directory of your WebLogic Server installation.

    Note:

    Oracle does not support combining clients to create extended feature sets. Never add the wlfullclient.jar, wlthint3client.jar, or wlclient.jar to a WebLogic Server classpath or a classpath that references the weblogic.jar file in a full WebLogic install. The behavior is undefined. WebLogic Server applications already have full access to WebLogic client functionality.

Sample code for a basic WebLogic Thin T3 client is provided in Example 2-1.

Example 2-1 Creating and Using a WebLogic Initial Context

Hashtable env = new Hashtable();
env.put("java.naming.factory.initial",
  "weblogic.jndi.WLInitialContextFactory");
env.put("java.naming.provider.url","t3://host:7001");
env.put("java.naming.security.principal","user");
env.put("java.naming.security.credentials","password");
Context ctx = new InitialContext(env);
try {
  Object homeObject =
    context.lookup("EmployeeBean");
//use the EmployeeBean
}
catch (NamingException e) {
// a failure occurred
}
finally {
  try {ctx.close();}
  catch (Exception e) {
// a failure occurred
}
}

Foreign Server Applications

A foreign server hosted application can use the wlthint3client.jar to act as a remote client to a WebLogic Server instance. To provide access to remote services such as JMS, servlets, EJBs, and startup classes, deploy any necessary application code along with the wlthint3client.jar to your application server.

The following steps provide a guideline to connect to and access WebLogic Server resources from a foreign application server using JNDI:

  1. Include the wlthint3client.jar on the class path of your client.
  2. In your client application, create a WebLogic initial context and use the context to look up and use a resource. See Example 2-1 for more details.
  3. It may be necessary to explicitly set the initial context factory as a system property in the client code, to the following value:

    env.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");

  4. Deploy any necessary application code along with the wlthint3client.jar file to your application server using standard Java EE methods, such as embedding the wlthint3client.jar file in a servlet or using a shared library. See Deployment Considerations.
  5. Start or deploy the client.

The following section outlines specific items to consider when interoperating with a foreign servers.

Deployment Considerations

Note:

Never deploy the thin T3 client as part of a WebLogic Server application or library. A WebLogic Server instance already has the necessary T3 client classes.

You can deploy the wlthint3client.jar using standard Java EE methods. However, when determining what deployment method to use, you must account for client footprint, class loading, performance, and tolerance of the risk for code incompatibility. For example:

  • If you embed the wlthint3client.jar in your application, such as a servlet, the application footprint is increased by the size of the wlthint3client.jar but the risk of code incompatibility is limited to the scope of your application.

  • If you deploy the wlthint3client.jar to your lib directory, the application footprint is not affected but the risk of code incompatibility can include the entire foreign server container.