2014-09-22 112 views
2

我正在努力嘗試使用Spring引導(1.1.6.RELEASE),gradle(2.1)和Java 1.8來運行多種技術。所以我們正在考慮支持一些舊式SOAP Web服務調用以及Spring Integration。因此,爲了開始工作,我正在研究如何使用該示例生成Web服務(http://spring.io/guides/gs/producing-web-service/)並將彈簧集成添加到混合中。Spring Boot Starter Integration和Starter WS不能很好地一起玩?

當我這樣做,但並嘗試打WSDL位置,我現在看到的這個堆棧跟蹤:

2014-09-22 09:53:17.823 ERROR 15188 --- [nio-8080-exec-1] a.c.c.C.[.[.[.[messageDispatcherServlet] : Servlet.service() for servlet[messageDispatcherServlet] in 
context with path [] threw exception [Request processing failed; nested exception is java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.getXmlStandalone()Z] with root cause 

java.lang.AbstractMethodError: org.apache.xerces.dom.DeferredDocumentImpl.getXmlStandalone()Z 
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:377) 
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:131) 
     at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:98) 
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:699) 
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:743) 
     at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:357) 
     at org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter.handle(WsdlDefinitionHandlerAdapter.java:144)... 

環顧這看起來可能與被拉在集成Xerces實現。您可以通過採取例如產生SOAP Web服務,改變依賴部分重現這個看起來像這樣:

dependencies { 
    compile("org.springframework.boot:spring-boot-starter-ws") 
    compile("wsdl4j:wsdl4j:1.6.1") 
    jaxb("com.sun.xml.bind:jaxb-xjc:2.2.4-1") 
    compile(files(genJaxb.classesDir).builtBy(genJaxb)) 
    compile("org.springframework.boot:spring-boot-starter-integration") 
} 

基本上將編譯(「org.springframework.boot:彈簧引導啓動一體化」 ),然後嘗試點擊位於的WSDL:http://:/ws/countries.wsdl。 (運行gradle boot運行

現在可以說這可能不是最好的方式來做到這一點,也許我應該看看春季整合揭露端點,但有其他人看到和處理這個?

在此先感謝

特里斯坦

注意我沒加編譯 「org.apache.ws.xmlschema:XMLSchema的核心:2.1.0」 DEP 下面是從我的罐子名單lib目錄

aopalliance-1.0.jar 
aspectjrt-1.8.2.jar 
aspectjweaver-1.8.2.jar 
classmate-1.0.0.jar 
commons-codec-1.2.jar 
commons-httpclient-3.0.1.jar 
commons-io-2.4.jar 
hibernate-validator-5.0.3.Final.jar 
jackson-annotations-2.3.0.jar 
jackson-core-2.3.4.jar 
jackson-databind-2.3.4.jar 
jboss-logging-3.1.1.GA.jar 
jcl-over-slf4j-1.7.7.jar 
jdom-1.0.jar 
jul-to-slf4j-1.7.7.jar 
log4j-over-slf4j-1.7.7.jar 
logback-classic-1.1.2.jar 
logback-core-1.1.2.jar 
rome-1.0.0.jar 
rome-fetcher-1.0.0.jar 
slf4j-api-1.7.7.jar 
snakeyaml-1.13.jar 
spring-aop-4.0.7.RELEASE.jar 
spring-beans-4.0.7.RELEASE.jar 
spring-boot-1.1.6.RELEASE.jar 
spring-boot-autoconfigure-1.1.6.RELEASE.jar 
spring-boot-starter-1.1.6.RELEASE.jar 
spring-boot-starter-aop-1.1.6.RELEASE.jar 
spring-boot-starter-integration-1.1.6.RELEASE.jar 
spring-boot-starter-logging-1.1.6.RELEASE.jar 
spring-boot-starter-tomcat-1.1.6.RELEASE.jar 
spring-boot-starter-web-1.1.6.RELEASE.jar 
spring-boot-starter-ws-1.1.6.RELEASE.jar 
spring-context-4.0.7.RELEASE.jar 
spring-core-4.0.7.RELEASE.jar 
spring-expression-4.0.7.RELEASE.jar 
spring-integration-core-4.0.3.RELEASE.jar 
spring-integration-file-4.0.3.RELEASE.jar 
spring-integration-http-4.0.3.RELEASE.jar 
spring-integration-ip-4.0.3.RELEASE.jar 
spring-integration-stream-4.0.3.RELEASE.jar 
spring-jms-4.0.7.RELEASE.jar 
spring-messaging-4.0.7.RELEASE.jar 
spring-oxm-4.0.7.RELEASE.jar 
spring-retry-1.1.0.RELEASE.jar 
spring-tx-4.0.7.RELEASE.jar 
spring-web-4.0.7.RELEASE.jar 
spring-webmvc-4.0.7.RELEASE.jar 
spring-ws-core-2.2.0.RELEASE.jar 
spring-ws-support-2.2.0.RELEASE.jar 
spring-xml-2.2.0.RELEASE.jar 
tomcat-embed-core-7.0.55.jar 
tomcat-embed-el-7.0.55.jar 
tomcat-embed-logging-juli-7.0.55.jar 
validation-api-1.1.0.Final.jar 
wsdl4j-1.6.1.jar 
xercesImpl-2.4.0.jar 
xmlschema-core-2.1.0.jar 

回答

0

貌似爲WSDL生成你應該提供這種依賴性:

compile "org.apache.ws.xmlschema:xmlschema-core:2.1.0" 

這是從Spring WS中可選的,看起來好像在你的環境中沒有適當的實現。

UPDATE

嘗試添加xalan太:

compile "xalan:xalan:2.7.1" 

https://groups.google.com/forum/#!topic/google-web-toolkit/07rVeEkCtyU

或者做一些技巧與Xerses:java.lang.AbstractMethodError: org.apache.xerces.dom.ElementImpl.getTextContent()Ljava/lang/String

+0

感謝您的答覆(和編輯)!我試了一下,但它讓我坐在同一條船上。爲了論證的緣故,我添加了從lib目錄中添加的依賴關係的jar列表。 – Tristan 2014-09-22 16:06:44

+0

在互聯網調查後添加了一些修改。 – 2014-09-22 16:16:35

+0

呃......明白了。再次感謝! – Tristan 2014-09-22 17:14:37

相關問題