在IBM RAD中通过JUnit调用WebService时出现AssertionError
JUnit调用WebService出现无提示AssertionError排查求助
我们有一个运行正常的WebService,在EAR项目、RAD本地及服务器环境中调用均正常。但通过JUnit项目调用时,出现无提示信息的AssertionError,无法调试。
相关代码
public ReportServiceGeneratedClient(String url) throws MalformedURLException { SubmissionWSService service = new SubmissionWSService(new URL(url), new QName("http://wsdl.report.changed.for.privacy/", "SubmissionWSService")); reportService = service.getSubmissionWSPort(); // 报错位置 }
报错堆栈
java.lang.AssertionError at com.ibm.xml.xlxp2.runtime.VMContext.stopSchemaAssessment(VMContext.java:609) at com.ibm.xml.xlxp2.api.jaxb.JAXBXMLStreamReader.unmarshal(JAXBXMLStreamReader.java:127) at com.ibm.xml.xlxp2.jaxb.unmarshal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:256) at com.sun.xml.internal.ws.assembler.MetroConfigLoader.loadMetroConfig(MetroConfigLoader.java:256) at com.sun.xml.internal.ws.assembler.MetroConfigLoader.init(MetroConfigLoader.java:143) at com.sun.xml.internal.ws.assembler.MetroConfigLoader.<init>(MetroConfigLoader.java:116) at com.sun.xml.internal.ws.assembler.TubelineAssemblyController.getTubeCreators(TubelineAssemblyController.java:90) at com.sun.xml.internal.ws.assembler.MetroTubelineAssembler.createClient(MetroTubelineAssembler.java:115) at com.sun.xml.internal.ws.client.Stub.createPipeline(Stub.java:340) at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:307) at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:240) at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:255) at com.sun.xml.internal.ws.client.sei.SEIStub.<init>(SEIStub.java:96) at com.sun.xml.internal.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:827) at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:816) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:449) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:417) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:399) at javax.xml.ws.Service.getPort(Service.java:130)
已尝试的无效操作
曾尝试设置以下系统属性,但未解决问题:
System.setProperty("javax.xml.accessExternalSchema", "all"); System.setProperty("javax.xml.accessExternalDTD", "all");
确认代码和WebService本身无问题,推测是JUnit环境配置有误,求排查思路。
内容的提问来源于stack exchange,提问作者Entropy
相关产品推荐
相关产品推荐

