Tuesday, July 24, 2007

More praises for EJB 3 In Action

EJB 3 In Action gets Five STARs rating from Cicero Zandoná of JavaLobby.
Here is some excerpt from his review:

If you want an EJB 3.0 book to read from cover-to-cover this is the one. You will learn how to create an EJB application, the concepts related to them and receive a lot of useful advice.
I really can't give this book less then five "stars".

Here is an interesting comment from the book:

One of the authors, Debu Panda is a Lead Product Manager of the Oracle Application Server development team, and I was afraid this could lead to a biased book. Fortunately this doesn't happen at all, he is completely impartial along the book and always warns the reader about vendor-dependent features.

I'm really happy that everyone seems to like the Sadhu story that I started the book with. Here is what Cicero puts in his review:

In an unusual beginning for a technical book, the authors start talking about ladybugs, elephants and cows (one of the authors name is Panda by the way). But I can't think in a more gentle and creative way to illustrate the specification evolution than the analogy they made (you can read the tale in Meera's review).

Read the detailed review at JavaLobby

Thursday, July 05, 2007

Automatically Executing a Client Application Archive


Many applications have a requirement that they want to automatically execute an application client archive(CAR) packaged as a part of enterprise application (EAR) when server starts up or an application is restarted. This is a Java EE 5 standard compliant alternative to Startup class about which I blogged about 2 and half years back!

In this article, I will outline steps to do this in OC4J.



  • Develop and compile your application client class. This class must contain a main method that will be called by your server during startup.


  • Create a META-INF/Manifest.mf file for the application-client, for example
    Manifest-Version: 1.0
    Main-Class: OracleASStartup


  • Create a deployment descriptor for the application client (application-client.xml) as follows:
    <application-client>
    <display-name>OracleASStartup</display-name>
    </application-client>


  • Create the application client archive (CAR) file for your startup class with the above Manifest and deployment descriptor.


  • Create an EAR file for the application client module with the an OC4J-specific deployment descriptor orion-application.xml as follows:
    <orion-application>
    <client-module path="startup-client.jar" start="true" user="anonymous" >
    </orion-application >


  • Build your EAR and deploy your application with auto start set to "true" as follows in the server.xml:<application name="startup"
    path="../applications\startup.ear" parent="default" start="true" >


Whenever your application is deployed or if you restart your server, the application client will be executed automatically!

Hope this helps!