Deploying JHeadstart applications to OC4J 10.1.3.2 or higher

While deploying your JHeadstart application to OC4J 10.1.3.2 or higher, are you experiencing error messages like the following?

  • Operation failed with error: org/apache/log4j/Category
  • No appenders could be found for logger (com.sun.faces.config.ConfigureListener)
  • oracle.oc4j.admin.internal.DeployerException: java.lang.ExceptionInInitializerError
  • org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@900079 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category)
This occurs because OC4J 10.1.3.2 and higher has defined a common shared library for apache.commons.logging, but this library has a dependency on log4j classes, which are not available in that shared library. Having log4j.jar in your EAR file does not help, because when called from a shared library, the classloader expects them to be available in the shared classpath instead of in the application-specific classpath. See OC4J bug 5871305 and Note 460448.1 in MetaLink for more information.

The workaround is to exclude apache.commons.logging from the shared library for your application: update orion-application.xml with the lines
<imported-shared-libraries> 
<remove-inherited name="apache.commons.logging"/>
</imported-shared-libraries>
Then create a JDeveloper deployment profile as follows:
  1. Run the ADF Runtime Installer
  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 WAR Options, and select Compress Archive.
  4. If you
    use Subversion,
    go to all Filters categories, then to Patterns, and exclude **/.svn/
Farbod posted his solution to deploying a JHeadstart application from JDeveloper 10.1.3.3 to OC4J 10.1.3.3 on the JDeveloper OTN Forum. Check out his steps to successfully deploy a JHeadstart application.

Comments:

Hi, Sandra Muller How can I remove the shared library from the embeded oc4j

Posted by wangfeng on December 23, 2007 at 07:44 PM PST #

Please ask such questions in the appropriate forum, for example the OC4J/J2EE forum at http://forums.oracle.com/forums/forum.jsp?forum=46

Posted by Sandra Muller on January 21, 2008 at 08:17 PM PST #

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