Application Client Upgrades from OC4J to WLS

Summary

Upgrading an OC4J Java EE application in order to deploy to Weblogic server may require one of several upgrade paths, depending upon the component being upgraded.  Remote clients that rely on the Application Client Container will require deployment changes in order to access resources on Weblogic Server.  One use case for remote clients will require some extra steps in order to upgrade successfully.  That case is the subject of this blog posting. 

 

OC4J's JNDI implementation allows a standalone client to take advantage of some features of the application client in Java EE without running in a Java EE Application Client Container.  A client can use the

 

"oracle.j2ee.naming.ApplicationClientInitialContextFactory"

 

InitialContextFactory implementation in order to access this functionality.  As long as the client includes a "META-INF/application-client.xml" deployment descriptor in the client jar, this initial context factory will create a JNDI context that can support Java EE resources that are typically used in an application client (EJB references, Resource References, Environment entries, etc).  This context factory will use the application-client.xml and the proprietary orion-application-client.xml in order to map JNDI bindings to logical Java EE reference names.  This level of application client support does not include Java EE 1.5-style annotations/dependency injection. 

 

Please refer to the following for more information on OC4J's Application Client support:

 

Looking Up Objects from J2EE Application Clients

 

While not required by the Java EE specification, this type of remote client can be very useful when a customer wishes to use the Java EE standard resource mapping types in order to use logical names for resources such as EJBs, Datasources, and JMS destinations.  Using an application client deployment descriptor has the advantage of allowing resources to change without having to change the client code itself, and can be considered useful even if not running in the Application Client Container. 

 

Customers using this feature of the ApplicationClientInitialContextFactory in OC4J will need to port their application client to run in the Weblogic Server Application Client Container. 

 

Upgrade Steps

The steps required to upgrade an OC4J application client to run in the Weblogic Application Client Container are as follows:

 

  1. Add a "Main-Class" entry to the client jar's manifest.  This entry should specify the entry point class for the application client.  This class, according to the Java EE standard, must include a "public static void main(String[] args)" method, and also include a no-arguments constructor. 

 

An example of the proper manifest entry would look as follows:

            Manifest-Version: 1.0

     Ant-Version: Apache Ant 1.6.5

     Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)

     Main-Class: oracle.ejb30.HelloWorldClient

 

      

 

  1. Modify the jndi.properties file in this client (or the source code that sets the JNDI properties directly) to refer to the Oracle WebLogic Server JNDI Provider.

 

An example of the jndi.properties file would look as follows:

 

            java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory

java.naming.provider.url=t3://localhost:7001

 

    

The jndi.properties file may also require a username/password.  These JNDI properties should be modified to use the principal and credentials created on the Weblogic Server. 

           

 

  1. For every element in orion-application-client.xml, create a corresponding element in weblogic-application-client.xml to map any Java EE references to the resources bound in Oracle WebLogic Server.

 

  1. Modify the classpath of the client to include the Oracle WebLogic Server client jars.  The jars required for the classpath are determined by the protocol that the customer wishes to use for this client. 

 

Please refer to the following Weblogic Server documentation to determine the appropriate client jar to use:

 

Client Types and Features

 

 

  1. Modify any application client startup scripts to use the Oracle WebLogic Server application client launcher.

 

The following is an example of a typical command line for launching a Weblogic Application Client:

java weblogic.demo.DemoClient myclient.jar t3://localhost:7001

 

 

The following links will be helpful when attempting to upgrade an application client from OC4J to Weblogic Server:

 

"WLS - Programming Standalone Clients"

Programming Stand-alone Clients

 

"Oracle Fusion Middleware Upgrade"

Oracle Fusion Middleware Upgrade

 

Comments:

i fully true. i really love your blog ! thanks for the story

Posted by robbert-jan on December 09, 2009 at 11:30 PM PST #

Wow, this was very fun to read. Have you ever considered submitting articles to magazines?

Posted by Tales of Pirates Crusader Leveling Guide on December 15, 2010 at 09:51 AM PST #

If habit is judged by how long a dumb animal will sit pressing a lever to get a "repair" of one thing, to its own detriment, then I'd conclude that netnews is much more addictive than cocaine. ~Rob Stampfli

Posted by {casino.com review|casino.com|casino.com bonus} on January 21, 2011 at 06:29 PM PST #

Hi. Have you tried the actual zygor guide regarding world of warcraft yet? Simply curious in your thoughts. I have noticed Advantages of it individually.

Posted by wow guide on February 03, 2011 at 10:16 AM PST #

I couldn't have really asked for a much better blog. You happen to be always at hand to offer excellent suggestions, going on to the point for simple understanding of your subscribers. You're really a terrific expert in this subject matter. Thank you for currently being there for people like me.

Posted by zero friction marketing on March 03, 2011 at 07:18 PM PST #

Dear webmaster, I think this post will be a nice read for my blog readers too, could you please allow me to post it on my blog?

Posted by Car Care on March 04, 2011 at 06:42 AM PST #

This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like 'Mixview' that let you quickly see related albums, songs, or other users related to what you're listening to. Clicking on one of those will center on that item, and another set of "neighbors" will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune "Social" is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.

Posted by amazon.com on March 06, 2011 at 04:14 AM PST #

Help me to find the, guaranteed online personal loans [url=http://guaranteedonlinepersonalloans.freeforums.org/#1]guaranteed online personal loans[/url], 1305,

Posted by guaranteed online personal loans on April 14, 2011 at 05:21 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

The official blog for Oracle WebLogic Server fans and followers!

Stay Connected

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today