我已经使用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的源”
如果我选择“Change Attached Source”,则弹出一个框,正确识别正确JDK版本中src.zip的位置。所以没有什么可以改变...
我手动进入了src.zip,确实没有com.sun.internal文件夹。
一个令人困惑的方面是,当我在开发环境中运行测试时,一切正常。当我在QA环境中运行我的测试时,我得到了上面列出的堆栈跟踪。
最令人困惑的是,尽管我可以在com.sun.org.apache.xerces.internal.impl.XMLEntityManager中加入一个断点,但是我可以在通过SEIStub对象后到达该断点,我无法查看该程序中的任何变量,当我查看Eclipse Variables选项卡时,它们甚至不会显示为有效变量。
我正在使用JDK 1.6.0_25
嗯......很困惑,头发用尽了!任何人都可以帮助我在这个课程上进行调试吗?
非常感谢, 标记
更新:我也尝试下载http://openjdk.java.net/projects/jdk6/,这套源也似乎缺少所有com.sun.internal对象。
更新:我正在使用Eclipse Helios,一位同事使用Juno重复了同样的问题。
答案 0 :(得分:1)
问题是由XmlEntityManager尝试解析正在解析的文档中的实体引起的。具体来说,它不喜欢它在文档上读取的SystemId URL(因为它格式不正确)。
com.sun.org.apache.xerces.internal.impl.XMLEntityManager
的来源,您需要查看第650行