You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 23:50:00