2012-01-31 62 views
1

我正在用JAXB和Spring框架創建一個基於soap的Web服務來將它們放在一起。我動態生成WSDL文件中使用Spring的Web服務,但是當我試圖訪問它,我收到以下錯誤:在結束JAXB Soap服務運行時錯誤(找不到XPath方法)

java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V 
at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:115) 
at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:99) 
at org.apache.xpath.jaxp.XPathExpressionImpl.evaluate(XPathExpressionImpl.java:184) 
at org.springframework.xml.xpath.Jaxp13XPathExpressionFactory$Jaxp13XPathExpression.evaluate(Jaxp13XPathExpressionFactory.java:114) 
at org.springframework.xml.xpath.Jaxp13XPathExpressionFactory$Jaxp13XPathExpression.evaluateAsNodeList(Jaxp13XPathExpressionFactory.java:106) 
at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.transformLocations(WsdlDefinitionHandlerAdapter.java:200) 
at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.handle(WsdlDefinitionHandlerAdapter.java:128) 
at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:213) 
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) 
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) 

現在,首先,我從來沒有見過(Z)V一個NoSuchMethodError之前,所以我不確定這是什麼意思,但我也得到了一個非常有限的堆棧跟蹤。我也不明白同一個項目中的一個類如何調用一個不存在的方法。如果有人對我應該從哪裏開始尋求解決這個問題有一些想法,那就太好了。當然可以根據要求提供更多信息。

編輯:

因此,使用MVN depedency:樹命令來查看是否有多發性罐子不同版本的XPath我得到以下輸出:

--- maven-dependency-plugin:2.1:tree (default-cli) @ LicensingSOAPService --- 
[INFO] com.cepstral.licensing:LicensingSOAPService:war:0.1 
[INFO] +- junit:junit:jar:3.8.1:test 
[INFO] +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3:runtime 
[INFO] | \- javax.xml.soap:saaj-api:jar:1.3:runtime 
[INFO] +- org.springframework.ws:spring-ws-core:jar:2.0.3.RELEASE:compile 
[INFO] | +- org.springframework.ws:spring-xml:jar:2.0.3.RELEASE:compile 
[INFO] | +- wsdl4j:wsdl4j:jar:1.6.1:compile 
[INFO] | +- javax.xml.stream:stax-api:jar:1.0-2:compile 
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile 
[INFO] +- org.springframework.ws:spring-ws-security:jar:2.0.3.RELEASE:runtime 
[INFO] | +- com.sun.xml.wsit:xws-security:jar:1.3.1:runtime 
[INFO] | +- com.sun.xml.wsit:wsit-rt:jar:1.1:runtime 
[INFO] | \- org.apache.ws.security:wss4j:jar:1.5.8:runtime 
[INFO] |  \- org.apache.santuario:xmlsec:jar:1.4.3:runtime 
[INFO] +- javax.xml.bind:jaxb-api:jar:2.0:compile 
[INFO] | +- javax.xml.bind:jsr173_api:jar:1.0:compile 
[INFO] | \- javax.activation:activation:jar:1.1:compile 
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.0.3:compile 
[INFO] +- org.springframework:spring-context:jar:3.1.0.RELEASE:compile 
[INFO] | +- org.springframework:spring-core:jar:3.1.0.RELEASE:compile 
[INFO] | +- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile 
[INFO] | \- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile 
[INFO] +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile 
[INFO] +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile 
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile 
[INFO] +- org.springframework:spring-web:jar:3.1.0.RELEASE:compile 
[INFO] +- org.jdom:jdom:jar:1.1.2:compile 
[INFO] | \- jaxen:jaxen:jar:1.1.3:compile 
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile 
[INFO] |  +- jdom:jdom:jar:1.0:compile 
[INFO] |  +- xml-apis:xml-apis:jar:1.3.02:compile 
[INFO] |  +- xerces:xercesImpl:jar:2.6.2:compile 
[INFO] |  \- xom:xom:jar:1.0:compile 
[INFO] |  +- xerces:xmlParserAPIs:jar:2.6.2:compile 
[INFO] |  +- xalan:xalan:jar:2.7.1:compile 
[INFO] |  \- com.ibm.icu:icu4j:jar:2.6.1:compile 
[INFO] +- org.springframework:spring-webmvc:jar:3.1.0.RELEASE:compile 
[INFO] | \- org.springframework:spring-context-support:jar:3.1.0.RELEASE:compile 
[INFO] +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile 
[INFO] | \- org.springframework:spring-tx:jar:3.0.6.RELEASE:compile 
[INFO] +- org.springframework:spring-oxm:jar:3.1.0.RELEASE:compile 
[INFO] | \- commons-lang:commons-lang:jar:2.5:compile 
[INFO] +- org.springframework.security:spring-security-core:jar:3.1.0.RELEASE:compile 
[INFO] | \- org.springframework.security:spring-security-crypto:jar:3.1.0.RELEASE:compile 
[INFO] \- commons-dbcp:commons-dbcp:jar:1.4:compile 
[INFO] \- commons-pool:commons-pool:jar:1.5.4:compile 

我沒有看到什麼可疑的東西,所以我不確定還有什麼可去的地方。我正在繼續嘗試使用glassfish的-verbose選項來追蹤錯誤。感謝大家。

編輯2:所以在GlassFish記錄它顯示以下內容:

[Loaded org.springframework.web.context.request.AbstractRequestAttributes from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar] 
[Loaded org.springframework.web.context.request.ServletRequestAttributes from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/spring-web-3.1.0.RELEASE.jar] 
[Loaded org.apache.xml.dtm.DTMManager from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xpath.XPathContext from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.dtm.ObjectFactory$ConfigurationError from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.dtm.DTMException from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.dtm.DTMConfigurationException from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.dtm.DTM from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xalan.extensions.ExpressionContext from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.utils.ObjectStack from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.utils.IntVector from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 
[Loaded org.apache.xml.utils.IntStack from file:/C:/glassfish/glassfish/domains/domain1/applications/licensingSoap/WEB-INF/lib/xalan-2.6.0.jar] 

這說明肯定在某個地方正在加載的Xalan-2.6.0罐子,但是當我看在目標\ licensingSoap我的maven項目的文件夾中,只有我假設的xalan-2.7.1 jar是我想要的。我不知道這個jar是如何在運行時在glassfish上出現的。有任何想法嗎?

回答

1

您可能會從某處獲取錯誤版本的類文件。 使用-verbose:class重新運行以查看所有這些類從哪裏加載。 如果您在解讀結果時需要幫助,請在此處發佈結果(如果可以的話 - 不知道您允許的尺寸!)。

HTH,

大衛

+0

你的意思是使用-verbose:在JVM變量類在我的GlassFish的容器? – thatidiotguy 2012-01-31 15:10:20

+1

是的,如果是你使用的Glassfish,你會得到相當多的輸出,但是你應該能夠搜索到你遇到的問題的類名 – davidfrancis 2012-01-31 15:13:04

+1

你必須在Google上搜索那個,但實質上是使用那--verbose:類你可以檢查你的堆棧跟蹤中的類是從哪裏加載的。然後你可以找出事情出錯的地方。 – davidfrancis 2012-01-31 16:48:19

相關問題