2

我已经使用Eclipse 一年左右了,通常我调试软件没有问题。然而,我遇到了一个让我难过的情况。

我正在运行的测试用例因以下堆栈跟踪而失败:

com.sun.xml.internal.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
    at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:283)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:180)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
    at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
    at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
    at $Proxy34.getCommission(Unknown Source)
    at uk.co.bglgroup.servicehub.external.lifehub.v1_0.fitnesse.ws.LifeHubWebServiceLifeHubWebServicePortClient.doCallGetCommission(LifeHubWebServiceLifeHubWebServicePortClient.java:51)
    at uk.co.bglgroup.servicehub.external.lifehub.v1_0.fitnesse.service.GetCommissionService.getCommissionService(GetCommissionService.java:40)
    at uk.co.bglgroup.servicehub.external.lifehub.v1_0.fitnesse.endToEnd.SkeletalEndToEndTest.run(SkeletalEndToEndTest.java:82)
    at uk.co.bglgroup.servicehub.external.lifehub.v1_0.fitnesse.endToEnd.SkeletalEndToEndTest.skeletalTestQA(SkeletalEndToEndTest.java:66)
    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:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
    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: com.sun.xml.internal.ws.streaming.XMLReaderException: Unable to create StAX reader or writer
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory$Default.doCreate(XMLStreamReaderFactory.java:358)
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:139)
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:143)
    at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:290)
    at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:118)
    at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:278)
    ... 39 more
Caused by: javax.xml.stream.XMLStreamException: java.net.MalformedURLException
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:219)
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.<init>(XMLStreamReaderImpl.java:191)
    at com.sun.xml.internal.stream.XMLInputFactoryImpl.getXMLStreamReaderImpl(XMLInputFactoryImpl.java:279)
    at com.sun.xml.internal.stream.XMLInputFactoryImpl.createXMLStreamReader(XMLInputFactoryImpl.java:151)
    at com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory$Default.doCreate(XMLStreamReaderFactory.java:356)
    ... 44 more
Caused by: java.net.MalformedURLException
    at java.net.URL.<init>(URL.java:601)
    at java.net.URL.<init>(URL.java:464)
    at java.net.URL.<init>(URL.java:413)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:1267)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:281)
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.setInputSource(XMLStreamReaderImpl.java:206)
    ... 48 more 

好的,所以现在我想调试这个问题,我可以逐步执行我编写的代码,直到我到达一个名为 SEIStub.class 的对象。对于这个对象,Eclipse 报告“源附件不包括文件的源SEIStub.class"

如果我选择“更改附加源”,则会弹出一个框,该框正确识别 src.zip 在正确 JDK 版本中的位置。所以没有什么可以改变的......

我手动进入了 src.zip,确实没有 com.sun.internal 文件夹。

一个令人困惑的方面是,当我在开发环境中运行测试时,一切正常。当我在 QA 环境中运行测试时,我会得到上面列出的堆栈跟踪。

最令人困惑的是,虽然我可以在 com.sun.org.apache.xerces.internal.impl.XMLEntityManager 中设置一个断点,并且在通过 SEIStub 对象后可以到达该断点,但我无法查看该程序中的任何变量,当我查看 Eclipse 变量选项卡时,它们甚至不会显示为有效变量。

我正在使用 JDK 1.6.0_25

嗯……很迷茫,头发快要拔了!

任何人都可以帮助我在这个类上进行调试吗?

非常感谢,马克

更新:我也尝试下载http://openjdk.java.net/projects/jdk6/并且这组源似乎也缺少所有 com.sun.internal 对象。

更新:我正在使用 Eclipse Helios,一位同事使用 Juno 重复了同样的问题。

4

1 回答 1

1

该问题是由 XmlEntityManager 尝试解析正在解析的文档中的实体引起的。具体来说,它不喜欢它在文档上读取的 SystemId URL(因为它格式错误)。

的来源com.sun.org.apache.xerces.internal.impl.XMLEntityManager,您需要查看第 650 行

于 2012-09-03T15:47:46.257 回答