Deploying JHeadstart 10.1.3 applications to OC4J 10.1.3.2
By Sandra Muller on Jul 22, 2007
In a project, at first we did not succeed in deploying a JHeadstart application developed in JDeveloper 10.1.3.2 to Stand-Alone OC4J 10.1.3.2. In this blog I describe how we fixed it. In our first attempt we got an error when binding the web application to default-web-site. The underlying error (shown in the OC4J console) was a ClassNotFoundException for a log4j class.
I must first explain that we started out using the ADF Runtime Installer in JDeveloper 10.1.3.2 to install the correct versions of the ADF 10.1.3.2 libraries in Stand-Alone OC4J. The ADF Runtime Libraries include some Apache logging libraries, and apparently that caused a conflict with the log4j jar file we include in the JHeadstart Runtime library. We were able to successfully deploy when removing the log4j jar from the EAR file:
- Run the ADF Runtime Installer for the Stand-Alone OC4J.
- In the ViewController project,
create a new WAR Deployment Profile (File | New | General | Deployment
Profiles | WAR File).
- In the deployment profile
properties, go to WEB-INF/lib Filters, and uncheck the log4j jar file.
- In the deployment profile properties, go
to WAR Options, and select Compress Archive.
- If you
go to all Filters categories, then to Patterns, and exclude **/.svn/
- Empty your
classes folder (the output directory for the compiler). You can do that
in JDeveloper via the menu option Run - Clean
- Right-click the
deployment profile and choose Deploy to EAR. The log tells you where it
creates the EAR file.
- Deploy the EAR file
to the new OC4J instance using OC4J's Enterprise Manager. (Alternatively, if the Stand-Alone OC4J is on the same machine as JDeveloper, you can also create an Application Server Connection to it in JDeveloper, and then on the deployment profile directly deploy to this connection.)
Update: the root cause and a better solution are described in this JHeadstart blog post.