Deploying JHeadstart 10.1.3 applications to OC4J 10.1.3.2

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:

  1. Run the ADF Runtime Installer for the Stand-Alone OC4J.
  2. In the ViewController project,
    create a new WAR Deployment Profile (File | New | General | Deployment
    Profiles | WAR File).
  3. In the deployment profile
    properties, go to WEB-INF/lib Filters, and uncheck the log4j jar file.
  4. In the deployment profile properties, go
    to WAR Options, and select Compress Archive.
  5. If you
    use Subversion,
    go to all Filters categories, then to Patterns, and exclude **/.svn/
So far for setting up the deployment profile. The next steps must be performed each time you want to deploy:
  1. Empty your
    classes folder (the output directory for the compiler). You can do that
    in JDeveloper via the menu option Run - Clean
    ViewController.jpr.
  2. Right-click the
    deployment profile and choose Deploy to EAR. The log tells you where it
    creates the EAR file.
  3. 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.)
We have not tested yet if log4j keeps on working in the deployed application, that is something for later!

Update: the root cause and a better solution are described in this JHeadstart blog post.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Java EE Consultants - JHeadstart, ADF, JSF

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today