Newsletter sign-up
View all newsletters

Sign up for our Enterprise Java Newsletter

Enterprise Java

Know your Oracle application server

Troubleshooting OC4J and WebLogic for Java EE application deployment

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone

Subtle incompatibilities between your application server and certain Java EE application components or third-party libraries can sink your ship at deployment time. In this article, René van Wijk presents tips for configuring Oracle WebLogic and OC4J for Java EE applications. Find out where the trouble spots are and how to fix them when deploying Enterprise JavaBeans, TopLink Essentials, Hibernate with ANTLR, and Apache MyFaces Trinidad components in your WebLogic or OC4J app server. Level: Beginner

A Java application server is the runtime environment for a Java enterprise application. It provides services to components such as servlets and Enterprise JavaBeans (EJBs) in the form of containers. A container is an interface between a component and the platform-specific functionality that supports it.

An enterprise bean must be deployed to an EJB container, which then manages the bean's execution; a servlet must be deployed to a Web container, which manages its execution. The deployment process requires you to provide settings for the components that can alter the application server's underlying services, such as security and transaction management. For example, you can configure a component's security so that only authorized users can access certain resources. Or you can specify relationships among methods so that they are treated as a unit in a single transaction.

Because application servers offer configurable services, components can behave differently depending on where you deploy them. Containers also manage nonconfigurable services, such as lifecycle management and data persistence. EJBs, as well as external frameworks and libraries that you use in your application, can give you the means to configure these services. But the process isn't always straightforward. Each application server has its idiosyncrasies, which can create challenges for the new user. The application server's own system classes, for example, might interfere with classes belonging to the framework you use. In this article I offer tips for resolving these kinds of issues when deploying Java EE applications to two popular application servers: Oracle Application Server Containers for J2EE (OC4J) and WebLogic Server.

I'll start by explaining what's required in order to successfully deploy an application that uses the TopLink Essentials Java persistence implementation on a WebLogic server. Next, I'll introduce some tweaks required for using EJBs on both WebLogic and OC4J. A JavaServer Faces (JSF) component library called Apache MyFaces Trinidad is the next stop. Trinidad uses a partial page rendering mechanism, which doesn't function properly on WebLogic servers without the solution I'll introduce. Finally, I'll explore class-loading mechanisms, focusing on the ANTLR library through an example that deploys an application that uses Hibernate.

Java persistence with TopLink Essentials

The Java Persistence API is a standard for managing relational data in Java applications. It uses object/relational mapping (ORM) to bridge the gap between an object-oriented model and a relational database. WebLogic server's built-in persistence framework, OpenJPA, works out of the box. But if you'd prefer to use the TopLink Essentials framework instead of OpenJPA, your application won't deploy on a WebLogic server without some changes. If you try to proceed without proper configuration, the following exception will occur:

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comments (6)
Login
Forgot your account info?

thanks a lotBy Choiyex on January 29, 2010, 2:15 amthis is helpful

Reply | Read entire comment

your application won't deploy on a WebLogic server without some By cantonax on December 18, 2009, 2:58 amyour application won't deploy on a WebLogic server without some changes

Reply | Read entire comment

If you'd prefer to use the TopLink Essentials framework instead By Anonymous on November 4, 2009, 10:42 amIf you'd prefer to use the TopLink Essentials framework instead of OpenJPA, your application won't deploy on a WebLogic server without some changes

Reply | Read entire comment

I find that the Java Persistence API to be extremely useful...By MMO on July 2, 2009, 3:44 amI find that the Java Persistence API to be extremely useful. Don't know where I'd be without it.

Reply | Read entire comment

Resource injection in WeblogicBy Anonymous on June 3, 2009, 7:21 pmHi, are You sure that Weblogic doesn't support resource injection? I'm sure I used resource injection on Weblogic. Or I missed something? :)

Reply | Read entire comment

View all comments

Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources

More from JavaWorld