Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

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 (21)
Login
Forgot your account info?

YesBy Anonymous on November 6, 2009, 2:03 pmSnow snowboards snowboarding

Reply | Read entire comment

Design is that area of humanBy ptp123 on November 6, 2009, 6:50 amDesign is that area of human experience, skill and knowledge which is concerned with man’s ability to mould his environment to suit his material and spiritual needs. Logo...

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

As a woman, tiffanyBy Anonymous on November 3, 2009, 9:46 pmAs a woman, tiffany necklacesin front of health and fashion, I have been one-sided pursuit, there have been deliberately shaped, there have been a loss confusion,...

Reply | Read entire comment

By Anonymous on November 3, 2009, 2:07 pmcheap prada shoes Gucci shoes Christian Loubout in Shoes replice shoes nice jewelry goldtiffanyjewelry cheap tiffany cheap tiffany jewelry replica jewelry jew silver...

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