function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dave CampbellDave Campbell 

Strange problem with Axis

I'm working on an integration with SForce.  Part of this is unit testing with JUnit.

Before I go any further, I'm running the j2sdk 1.4.2_02.  I recently downloaded and built the enterprise and partner objects for my test installation.  I ran the quickstart application and all went very well.

I'm able to build apps that talk to my SForce installation just fine.  However, when I try to run my JUnit tests, I get:

java.lang.ExceptionInInitializerError
        at org.apache.axis.client.Service.getAxisClient(Service.java:143)
        at org.apache.axis.client.Service.(Service.java:152)
        at com.sforce.soap.enterprise.SforceServiceLocator.(SforceServiceLocator.java:10)
        at com.adc.sar.crm.alertNotificationManager.SimpleLogin.sforceLogin(SimpleLogin.java:50)
        at com.adc.sar.crm.alertNotificationManager.SimpleLogin.(SimpleLogin.java:40)
        at com.adc.sar.crm.alertNotificationManager.SimpleLoginTest.(SimpleLoginTest.java:33)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at junit.framework.TestSuite.createTest(TestSuite.java:135)
        at junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
        at junit.framework.TestSuite.(TestSuite.java:75)
        at com.adc.sar.crm.alertNotificationManager.SimpleLoginTest.suite(SimpleLoginTest.java:45)
        at sun.reflectnull
.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111)
        at junit.swingui.TestRunner.runSuite(TestRunner.java:591)
        at junit.swingui.TestRunner$9.actionPerformed(TestRunner.java:283)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
        at java.awt.Component.processMouseEvent(Component.java:5100)
        at java.awt.Component.processEvent(Component.java:4897)
        at java.awt.Container.processEvent(Container.java:1569)
        at java.awt.Component.dispatchEventImpl(Component.java:3615)
        at java.awt.Container.dispatchEventImpl(Container.java:1627)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
        at java.awt.Container.dispatchEventImpl(Container.java:1613)
        at java.awt.Window.dispatchEventImpl(Window.java:1606)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:532)
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:272)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
        at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:76)
        at org.apache.axis.handlers.BasicHandler.(BasicHandler.java:81)
        ... 44 more
Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:416)
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:525)
        ... 48 more
Caused by: org.apache.commons.logging.LogConfigurationException: Class org.apache.commons.logging.impl.Log4JLogger does not implement Log
        at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:412)
        ... 49 more

I'm using Axis 1.1, which is just re-downloaded.  I'm using JUnit 3.8.1.

I've done quite a few other JUnit tests (not involving SForce) and they work fine.

I'm new to Axis, so I'm wondering if someone can point me to a relatively painless way to get Axis to work correctly in this situation.  It looks like the log factory in Axis completely blew up, based on the source tracing I did.

 

 

 

DevAngelDevAngel

Yikes,

I'll have to defer to some of the Java geniuses on this board. 

Anybody have experience with JUnit and Axis, specifically with sforce?

Dave CampbellDave Campbell

Have you certified/tested with other SOAP toolkits?  I'm only using Axis because it came "recommended"  (bundled) in the various download kits, etc.

Has anyone tested/certified with kits from SUN (JWSDP?), etc.  I'm more than happy to ditch Axis at this point, but I don't want to (don't have time to) venture into uncharted/untested waters right now.

I'd really appreciate a list of tested toolkits if it's available.

Thanks!

zakzak
it looks like you've got a version mismatch on log4j, make sure your test config is not loading an old log4j version (or commons-logging). I've done axis 1.1 / JUnit / Sforce code without any problems.

Cheers
Simon
Dave CampbellDave Campbell

This turns out to be a problem between JUnit 3.8.1 and Commons Logging.

There is a solution in the Axis developer's guide.  If you look at the downloadable version (different from the on-line version), it's mentioned in the table of contents.