Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
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.
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: