Task 4: Redeploy the Application on Oracle WebLogic Server

6-2 Oracle Fusion Middleware Upgrade Guide for Java EE

6.2.1 Modifying Clients to Use the Oracle WebLogic Server JNDI Provider

If any clients of your upgraded applications use the OC4J Java Naming and Directory Interface JNDI provider to lookup application interfaces or resources, then you must modify those clients so they use the Oracle WebLogic Server JNDI provider instead. You can change the applications JNDI initial context creation code as follows: 1. Identify all instances of the OC4J JNDI URLs in the client code. Typically the OC4J URL is structured in the following format: prefix:host:RMI_or_OPMN_request_port:oc4j_instanceapplication-name An example URL for an Oracle Application Server 10g installation with an OC4J instance named oc4j1 and a deployed application called myapplication would be as follows: opmn:ormi:127.0.0.1:6003:oc4j1myapplication Note that the prefix can be opmn:ormi for a full Oracle Application Server installation that is using the Oracle Process Management and Notification infrastructure, or it can be just ormi: if you are using a standalone OC4J installation. 2. Change the URL of the provider so it points to the target WebLogic Server domains administration server using the t3 protocol. For example: t3:127.0.0.1:7001 3. Make sure the security credentials are valid within the target Oracle WebLogic Server domain. 4. Change the initial context factory to the Oracle WebLogic Server WLInitialContextFactory class. This class should also be made available to the client applications class loader through a Oracle WebLogic Server client jar file. You create the client jar file wlfullclient.jar using the WebLogic JarBuilder tool. For more information, see the following sections in Oracle Fusion Middleware Programming Stand-alone Clients for Oracle WebLogic Server: ■ WebLogic Full Client ■ Using the WebLogic JarBuilder Tool Note that if the client is itself running within an OC4J server instance, the environment-naming-url-factory-enabled attribute in the servers server.xml may have to be set to true to allow the use of multiple JNDI providers within the same OC4J instance.

6.2.2 Understanding the Scope of the Oracle WebLogic Server JNDI Namespace

Another important difference between the OC4J and Oracle WebLogic Server JNDI providers that might impact client applications is the scoping of JNDI namespaces. OC4J JNDI objects can have an explicit application scope. Therefore, when performing a lookup, OC4J JNDI clients can use a URL which identifies a specific OC4J server instance and includes the name of the target application.