Deploying ADF Application to Standalone OC4J

For the deployment of an ADF Application to my standalone OC4J I’ve faced some problems which aren’t clearly explained/solved on OTN.
You will find many people facing the same problems when deploying applications to OC4J from jboException until Log4j-exceptions, etc.

I will try to address some of these problems in this blog using my own project deployed to a standalone OC4J.

Following errors/problems cam uping during deployment:

  • java.lang.NoClassDefFoundError: oracle/jbo/JboException
  • java.lang.NoClassDefFoundError: org/apache/log4j/Category
  • Problems with shared libraries and user-libraries when deploying from JDeveloper-IDE
  • Memory problems during deployment

How were this problems addressed and how did I package the application?

In my J2EE application the following technologies are being used: Toplink, EJB 3.0, OCS and finally ADF Faces as the frontend. Additional libraries we’re using: log4j-libraries.

This J2EE application uses the MVC-paradigm which means i’m working with 3 important layers: Model, View and Controller. In my case the Model is written in Toplink, the DataControl which is the glue between the Model and View is based on the EJB 3.0 (sessionbeans) and in the end we which faces for our Controller.

How did I package this application, by the creation of deployment profiles for each application that’s used in the application:

  • A jar-file for the Toplink-model and bizzlogic-model
  • An ejb-jar file for the EJB-project(s)
  • A war-file containing all logic of the view-layer (jspx, images, pageDefinitions, backing beans, web.xml file, jazn-data file, orion-application.xml file, etc.
  • An ear-file packaging all the different deployment profiles together using the Application Assembly tool

As I mentioned before i’m using log4j in the application and I experienced a lot of problems during deployment because a newer version of log4j is used in our application, than the one which is used by default by OC4J. How can you solve this problem:

  • Add the version you’re using in your project (log4j-1.2.13.jar) and the commons-logging jars from JDeveloper to the EAR file and point towards these 2 jar-files in the MANIFEST.MF file from the project that uses log4j

Secondly I mentioned Toplink is used for the Model-layer for which we needed to perform a manual configuration as well:

  • Copy xdb.jar from the toplink workbench folder to the directory of the standalone OC4J installation \toplink\jlib\xdb.jar

To address the jboException you need to install the ADF Runtime Installer to your standalone container. You can do this using the JDeveloper IDE, first create an Application Server Connection to your standalone OC4J. Go to the menu ‘Tools’, choose the ‘ADF Runtime Installer’ and choose to deploy to ‘standalone OC4J’.

Make sure your OC4J isn’t running when you perform this task because otherwise all libraries can’t be upgraded because they’re being used by the container.

Last but not least the ‘OutOfMemoryException’/PermGen Space can be adressed by adding memory to your standalone OC4J or IAS. For OC4J you could add the following attribute to the oc4J.cmd-file which can be found in the bin-folder of your oc4J_home => add the following:

OC4J_JVM_ARGS=-XX:PermSize=128m -XX:MaxPermSize=256m

If you need an indepth explanation about memory-management you can view the Memory Management topic on this blog.

Have fun!

About these ads

8 thoughts on “Deploying ADF Application to Standalone OC4J

  1. Sorry for the late reply …Manifest-Version: 1.0Class-Path: commons-logging-api.jar commons-logging.jar l og4j-1.2.13.jarCreated-By: Oracle JDeveloper

  2. Hi I followed your instructions and i passed the errors but now i am facing the following error in run time: :AdfFacesFilter has not been installed Adf need this filter to run u know how can I sole this error?I am using ADFBC Jdeveloper and headstart

  3. Hi Alireza,You need to check the faces-config.xml file, normally this file is pre-configured for you in Jdeveloper and the ADFFacesFilter is configured as well.Try to create a new project using the proper tamplate, choosing adf faces as one of the technologies. Then check out the faces-config file and look-up the differences between your config file that produces the error and the newly created one.

  4. Hi,I developed a application using JDeveloper, EJB3.0, Toplink and ADF. Its working fine when i run through embedded oc4j instance in JDeveloper.The same application i deployed in standalone oc4j instance in server. I am facing a issues over there.Two Issues:1. onPageLoad is not calling when the page loads.2. WARNING The AdfFacesFilter has not been installed. ADF Faces requires this filter for proper execution.Please help me to resolve the issue and this is first project in ADF.Thanks & RegardsVimalan Balan

  5. Hi Vimalan, Did you install the adf runtime libraries on your standalone OC4J? These libraries need to be installed to be able to run ADF applications outside the embedded container.Kind regards,Nathalie

  6. I’m facing the following error..Could not create the Java virtual machine.Error occurred during initialization of VMCould not reserve enough space for object heap.part of full stack is:Could not create the Java virtual machine.Error occurred during initialization of VMCould not reserve enough space for object heap2008-09-09 18:49:00.734 ERROR J2EE HTTP-00004 Internal error raised tyring to instantiate web-application: richtextportlet defined in web site OC4J 10g (10.1.3) Default Web Site. Error compiling :C:\Users\aigawish\JDeveloper\jdev\extensions\oracle.adfp.seededoc4j.\j2ee\home\applications\richtextportlet\richtextportlet: Syntax error in source or compilation failed in: C:\Users\aigawish\JDeveloper\jdev\extensions\oracle.adfp.seededoc4j.\j2ee\home\application-deployments\richtextportlet\richtextportlet\oracle\portlet\wsrp\v1\soap\runtime\WSRP_v1_PortletManagement_PortType_setPortletProperties_Fault_SOAPSerializer.javaCould not create the Java virtual machine.

  7. I see you’re using webcenter functionality, namely richTextPortlet. To be able to deploy a webcenter application you need to make sure you’ve started up the pre-configured OC4J, the one that has all the webcenter libraries available.When you have started this you can run your application in this ‘Webcenter’ container.If this is the first time you start this container a page will be opened in your JDev, and you will see some links too some preinstalled portlets(webclipping,omniportlet and richtext)Could you check if the preseededContainer has been started and the portlets (richtext) has been deployed succesfully in your preseededOC4J?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s