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
aquaswAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StillUnAwareCommented:
As the exception stack suggests:
"You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed."

You must check Your classpath and make sure that only one httpunit library is available. In other words: remove all other apache libraries except the ones You need and prefferable leave the newest ones.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aquaswAuthor Commented:
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
Mick BarryJava DeveloperCommented:
> I tryed to remove the first one, and then to remove both of them, But I have still get the same exception.

u should be removing the 2nd one
Mayank SAssociate Director - Product EngineeringCommented:
Yes, you should have the updated one in the class-path (or at least earlier in the class-path).
aquaswAuthor Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.