Link to home
Start Free TrialLog in
Avatar of aquasw
aquasw

asked on

java.lang.ExceptionInInitializerError exception

hi experts

I am using the package httpunit (jakarta).
when I run them from the eclipse it works fine.
but I need to run them from external program (that loads automaticaly java classes and run them) it gives me this exception


java.lang.ExceptionInInitializerError
        at com.aqua.adaptor.audiocodes.AudioCodesImpl.init(AudioCodesImpl.java:32)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:90)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:44)
        at jsystem.framework.system.SystemObjectImpl.initFields(SystemObjectImpl.java:140)
        at jsystem.framework.system.SystemObjectImpl.init(SystemObjectImpl.java:261)
        at com.aqua.phone.PhoneDefaultImpl.init(PhoneDefaultImpl.java:31)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:90)
        at jsystem.framework.system.SystemObjectImpl.initFields(SystemObjectImpl.java:158)
        at jsystem.framework.system.SystemObjectImpl.init(SystemObjectImpl.java:261)
        at com.aqua.phone.PhoneManager.init(PhoneManager.java:29)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:90)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:44)
        at jsystem.framework.system.SystemManagerImpl.getSystemObject(SystemManagerImpl.java:37)
        at com.juniper.automation.JuniperBasicFixture.setUp(JuniperBasicFixture.java:51)
        at jsystem.framework.fixture.Fixture.run(Fixture.java:70)
        at jsystem.framework.fixture.FixtureManager.goTo(FixtureManager.java:200)
        at junit.framework.SystemTestCase.runBare(SystemTestCase.java:110)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.SystemTestCase.run(SystemTestCase.java:100)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at jsystem.treeui.TestRunner$1.run(TestRunner.java:195)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.))
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
        ... 24 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
        ... 28 more
Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy.  You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385)
        ... 29 more

how can I solve it ?

thanks
ASKER CERTIFIED SOLUTION
Avatar of StillUnAware
StillUnAware
Flag of Lithuania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aquasw
aquasw

ASKER

Hi

I looked on my class path.
there is about 100 jars.
I looked in every jar.
there is only 2 jars that has the "org.apache.commons.logging." package.
commons-logging.jar and commons-logging.api.jar.
I tryed to remove the first one, and then to remove both of them, But I have still get the same exception.
when I remove both of the jars, it cann't load the relevant class, and I get the exception :
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

do you have any suggestions ?

thanks
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aquasw

ASKER

Hi , thanks for your help

I have solve this problem, the problem was in the program that loads the classes and runs them and not in this specific application.

thanks