5 Replies Latest reply on Aug 6, 2010 3:28 PM by Mehta

    No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.common

    Mehta
      I am running Oracle Application Server 10g Release 10.1.3.1 on my windows PC.

      I am getting exception when I deploy the ear file. I have created shared-lib for all the jars the ear file is using. If I deploy the same ear file with all those lib (jars) keeping under /WEB-INF/lib folder of my ear file, then application gets deployed without any error. But with the shared-lib concept, I am getting below error.

      Please help me, I have been trying for quite a few days.

      10/07/26 12:08:27 oracle.oc4j.admin.internal.DeployerException: org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category) (Caused by org.apache.commons.logging.LogConfigurationException: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.commons.logging.impl.Log4JLogger (Caused by java.lang.NoClassDefFoundError: org/apache/log4j/Category))
      10/07/26 12:08:27      at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
      10/07/26 12:08:27      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
      10/07/26 12:08:27      at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
      10/07/26 12:08:27      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
      10/07/26 12:08:27      at org.springframework.web.context.ContextLoader.<init>(ContextLoader.java:144)
      10/07/26 12:08:27      at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
      10/07/26 12:08:27      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
      10/07/26 12:08:27      at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1130)
      10/07/26 12:08:27      at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:738)
      10/07/26 12:08:27      at com.evermind.server.ApplicationStateRunning.getHttpApplication(ApplicationStateRunning.java:414)
      10/07/26 12:08:27      at com.evermind.server.Application.getHttpApplication(Application.java:545)
      10/07/26 12:08:27      at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.createHttpApplicationFromReference(HttpSite.java:1990)
      10/07/26 12:08:27      at com.evermind.server.http.HttpSite$HttpApplicationRunTimeReference.<init>(HttpSite.java:1909)
      10/07/26 12:08:27      at com.evermind.server.http.HttpSite.addHttpApplication(HttpSite.java:1606)
      10/07/26 12:08:27      at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:238)
      10/07/26 12:08:27      at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:99)
      10/07/26 12:08:27      at oracle.oc4j.admin.internal.ApplicationDeployer.bindWebApp(ApplicationDeployer.java:547)
      10/07/26 12:08:27      at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:202)
      10/07/26 12:08:27      at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
      10/07/26 12:08:27      at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
      10/07/26 12:08:27      at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
      10/07/26 12:08:27      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)
      10/07/26 12:08:27      at java.lang.Thread.run(Thread.java:595)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
        • 1. Re: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.common
          57061
          Hi,
          Are you using any deployment plan? You need to import the shared library when deploying your application.

          Regards,
          Ricky
          • 2. Re: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.common
            Mehta
            Yes, in my deployment plan I have imported the shared library. Below is some of my server.xml tags of shared-lib.


                 <shared-library name="oracle.jdbc" version="11.1.0.7.0">
                      <code-source path="ojdbc5.jar"/>
                 </shared-library>
                 <shared-library name="nex.Log4j" version="1.2.13">
                      <code-source path="log4j-1.2.13.jar"/>
                 </shared-library>
                 <shared-library name="nex.jakarta.commons" version="2.0">
                      <code-source path="commons-dbcp.jar"/>
                      <code-source path="commons-pool.jar"/>
                      <code-source path="commons-collections.jar"/>
                      <code-source path="commons-lang-2.4.jar"/>
                      <code-source path="commons-beanutils-1.7.0.jar"/>
                      <import-shared-library name="oracle.jdbc" max-version="11.1.0.7.0"/>
                 </shared-library>
                 <shared-library name="nex.Displaytag" version="1.1.1">
                      <code-source path="displaytag-1.1.1.jar"/>
                      <code-source path="displaytag-export-poi-1.1.1.jar"/>
                      <code-source path="itext_1.5.4.jar"/>
                      <code-source path="poi-3.0-FINAL.jar"/>
                      <import-shared-library name="nex.jakarta.commons" max-version="2.0"/>
                      <import-shared-library name="nex.Log4j" max-version="1.2.13"/>
                      <import-shared-library name="apache.commons.logging" max-version="1.0.4"/>
                 </shared-library>
                 <shared-library name="nex.Spring" version="2.5.0">
                      <code-source path="spring.jar"/>
                      <code-source path="backport-util-concurrent-2.2.jar"/>
                      <import-shared-library name="nex.jakarta.commons" max-version="2.0"/>
                      <import-shared-library name="nex.Log4j" max-version="1.2.13"/>
                      <import-shared-library name="apache.commons.logging" max-version="1.0.4"/>
                 </shared-library>
                 <shared-library name="nex.Struts" version="1.3.9">
                      <code-source path="antlr-2.7.2.jar"/>
                      <code-source path="bsf-2.3.0.jar"/>
                      <code-source path="commons-chain-1.1.jar"/>
                      <code-source path="commons-digester-1.8.jar"/>
                      <code-source path="commons-fileupload-1.1.1.jar"/>
                      <code-source path="commons-io-1.1.jar"/>
                      <code-source path="commons-validator-1.3.1.jar"/>
                      <code-source path="oro-2.0.8.jar"/>
                      <code-source path="struts-core-1.3.9.jar"/>
                      <code-source path="struts-el-1.3.9.jar"/>
                      <code-source path="struts-extras-1.3.9.jar"/>
                      <code-source path="struts-faces-1.3.9.jar"/>
                      <code-source path="struts-mailreader-dao-1.3.9.jar"/>
                      <code-source path="struts-scripting-1.3.9.jar"/>
                      <code-source path="struts-taglib-1.3.9.jar"/>
                      <code-source path="struts-tiles-1.3.9.jar"/>
                      <code-source path="commons-beanutils-1.7.0.jar"/>
                      <import-shared-library name="apache.commons.logging" max-version="1.0.4"/>
                      <import-shared-library name="nex.Log4j" max-version="1.2.13"/>
                 </shared-library>
                 <shared-library name="nex.iBatis" version="2.3.0">
                      <code-source path="ibatis-2.3.0.677.jar"/>
                      <import-shared-library name="apache.commons.logging" max-version="1.0.4"/>
                      <import-shared-library name="nex.Log4j" max-version="1.2.13"/>
                 </shared-library>
            • 4. Re: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.common
              Mehta
              Here is my deployment plan:

              moduleType=ear
              applicationID=VGCC
              bindWebApp=default-web-site
              webSiteBindings=
              parent=default
              moduleID=.
              doctype=orion-application
              <?xml version="1.0" encoding="UTF-8"?>
              <orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd">
                   <jazn provider="XML" location="jazn-data.xml">
                   </jazn>
                   <data-sources path="./data-sources.xml">
                   </data-sources>
                   <imported-shared-libraries>
                        <import-shared-library name="apache.commons.logging" max-version="1.0.4">
                        </import-shared-library>
                        <import-shared-library name="nex.Displaytag" max-version="1.1.1">
                        </import-shared-library>
                        <import-shared-library name="nex.iBatis" max-version="2.3.0">
                        </import-shared-library>
                        <import-shared-library name="nex.jakarta.commons" max-version="2.0">
                        </import-shared-library>
                        <import-shared-library name="nex.Log4j" max-version="1.2.13">
                        </import-shared-library>
                        <import-shared-library name="nex.Spring" max-version="2.5.0">
                        </import-shared-library>
                        <import-shared-library name="nex.Struts" max-version="1.3.9">
                        </import-shared-library>
                        <import-shared-library name="oracle.jdbc" max-version="11.1.0.7.0">
                        </import-shared-library>
                   </imported-shared-libraries>
                   <jazn-loginconfig>
                        <application Key="name">
                             <name>VGCC</name>
                             <login-modules>
                                  <login-module Key="class control-flag">
                                       <class>oracle.sample.dbloginmodule.DBProcLM.NexDBProcOraDataSourceLoginModule</class>
                                       <control-flag>required</control-flag>
                                       <options>
                                            <option Key="name value">
                                                 <name>plsql_procedure</name>
                                                 <value>NEX_DBPROCLM.GET_USER_AUTHENTICATION</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>data_source_name</name>
                                                 <value>jdbc/qol_authschemaDS</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>debug</name>
                                                 <value>true</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>log_level</name>
                                                 <value>false</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>password_column</name>
                                                 <value>PASSWORD</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>pw_encoding_class</name>
                                                 <value>oracle.sample.dbloginmodule.util.NexDBLoginModuleSHA1Encoder</value>
                                            </option>
                                            <option Key="name value">
                                                 <name>application_realm</name>
                                                 <value>Vehicle Gas Coupon Control</value>
                                            </option>
                                       </options>
                                  </login-module>
                             </login-modules>
                        </application>
                   </jazn-loginconfig>
              </orion-application>
              moduleID=VGCC.war
              doctype=orion-web-app
              <?xml version="1.0" encoding="UTF-8"?>
              <orion-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd" context-root="VGCC">
                   <security-role-mapping name="MVRO.Clerk">
                   </security-role-mapping>
                   <security-role-mapping name="MVRO.Supv">
                   </security-role-mapping>
                   <security-role-mapping name="TAX">
                   </security-role-mapping>
                   <security-role-mapping name="NEX.Clerk">
                   </security-role-mapping>
                   <security-role-mapping name="NEX.Serv">
                   </security-role-mapping>
                   <security-role-mapping name="NEX.Isge">
                   </security-role-mapping>
                   <security-role-mapping name="NEX.Dp_Ops">
                   </security-role-mapping>
                   <web-app-class-loader>
                   </web-app-class-loader>
              </orion-web-app>


              On Oracle Metalink, this is shown as a known bug:

              *After Upgrading from 10.1.3.1.0 the Application Fails with "java.lang.NoClassDefFoundError: org/apache/log4j/Category" [ID 460448.1]*


              I followed the instruction for the solution and installed Oracle Application Server 10g Release 3 (10.1.3.5.0) Patch Set 5. But still I am getting the same exception. Also I changed orion-application.xml as suggested.
              • 5. Re: No suitable Log constructor [Ljava.lang.Class;@9bbed7 for org.apache.common
                Mehta
                I got it resolved by importing log4j-1.2.13 into my custom shared-lib of apache.commons.logging.

                The server.xml has below entry:

                <shared-library name="nex.apache.commons.logging" version="1.1.1">
                          <code-source path="commons-logging-1.1.1.jar"/>
                          <import-shared-library name="nex.Log4j" max-version="1.2.13"/>
                </shared-library>


                My deployment plan looks like this:

                <imported-shared-libraries>
                          <import-shared-library name="nex.apache.commons.logging" max-version="1.1.1">
                          </import-shared-library>
                          <import-shared-library name="nex.Displaytag" max-version="1.1.1">
                          </import-shared-library>
                          <import-shared-library name="nex.iBatis" max-version="2.3.0">
                          </import-shared-library>
                          <import-shared-library name="nex.jakarta.commons" max-version="2.0">
                          </import-shared-library>
                          <import-shared-library name="nex.Spring" max-version="2.5.0">
                          </import-shared-library>
                          <import-shared-library name="nex.Struts" max-version="1.3.9">
                          </import-shared-library>
                          <import-shared-library name="oracle.jdbc" max-version="11.1.0.7.0">
                          </import-shared-library>
                     </imported-shared-libraries>