关于Junit调用Axis2报错问题,大神们来看看吧
如题,调用时报出如下错误,请大家帮帮忙看看
2011-5-17 18:33:38 org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
信息: Retrying request
2011-5-17 18:33:38 org.apache.axis2.transport.http.HTTPSender sendViaPost
信息: Unable to sendViaPost to url[http://localhost:8080/BTV_WS/services/SyncUserService]
org.apache.axis2.AxisFault: operation cannot be null!!
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:550)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:389)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:222)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:435)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub.SyncUser(SyncUserServiceStub.java:183)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceTest.testSyncUser(SyncUserServiceTest.java:49)
at sun.reflect.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:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
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.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.axis2.databinding.ADBException: operation cannot be null!!
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserType.serialize(SyncUserServiceStub.java:922)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserType.serialize(SyncUserServiceStub.java:846)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserListType.serialize(SyncUserServiceStub.java:3396)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserListType.serialize(SyncUserServiceStub.java:3340)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserSyncRequestType.serialize(SyncUserServiceStub.java:4322)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserSyncRequestType.serialize(SyncUserServiceStub.java:4266)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserSyncRequest.serialize(SyncUserServiceStub.java:5437)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserSyncRequest.serialize(SyncUserServiceStub.java:5422)
at cn.com.btv.aap.service.usersyncservice.SyncUserServiceStub$UserSyncRequest$1.serialize(SyncUserServiceStub.java:5410)
at org.apache.axis2.databinding.ADBDataSource.serialize(ADBDataSource.java:93)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerializeAndConsume(OMSourcedElementImpl.java:738)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:966)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:254)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:242)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:995)
at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:486)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
... 37 more
这年头居然在google上找不到同类问题的解决方案。。。怪了,咱也做了回吃螃蟹的人?
[解决办法]
参数的强制非空约束