我試圖部署一個基本的Web服務,我的wsdl位于以下beans.xml中所示:
我試圖部署一個基本的Web服務。
<?xml version="1.0" encoding="UTF-8"?>/span>
<beans xmlns="http://www.springframework.org/schema/beans"/span>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"。
xmlns:jaxws="http://cxf.apache.org/jaxws"。
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/span> />
<jaxws:endpoint。
id="helloWorld"/span>
implementor="com.tsdevelopment.HelloWorldImpl"
wsdlLocation="src/main/resources/wsdl/HelloWorld.wsdl"
address="/HelloWorld" <>
</beans>
當我使用mvn wildfly:deploy進行部署時,我得到了以下錯誤:
Caused by: java.io.FileNotFoundException: C:Userscodereadystudiojboss-eap-7.3insrcmain
esourceswsdlHelloWorld.wsdl(系統無法找到指定路徑)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:211)
at java.base/java.io.FileInputStream.<init> (FileInputStream.java:153)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:108)
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:189)
在org.apache.xerces@2.12.0. SP02-redhat-00001//org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:1009)
在org.apache.xerces@2.12.0。 SP02-redhat-00001//org.apache.xerces.impl.XMLVersionDetector. determineDocVersion(XMLVersionDetector.java:144)。
在org.apache.xerces@2.12.0. SP02-redhat-00001//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:832)
在org.apache.xerces@2.12.0。 SP02-redhat-00001//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
在org.apache.xerces@2.12.0。 SP02-redhat-00001//org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
在org.apache.xerces@2.12.0。 SP02-redhat-00001//org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
在org.apache.xerces@2.12.0。 SP02-redhat-00001//org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
at deployment.soap-cxf-wsdlfirst-jbosseap73-1.0-SNAPSHOT.war/com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)
... 56 more
為什么是在jboss安裝檔案夾中搜索WSDL,而不是在代碼中搜索?
uj5u.com熱心網友回復:
看來它無法找到WSDL的原因是在pom.xml中的wsdl路徑如下:
<wsdlOptions>
<wsdlOption>/span>
<wsdl>/span>
src/main/resources/wsdl/HelloWorld.wsdl
</wsdl>/span>
<wsdlLocation>wsdl/HelloWorld.wsdl</wsdlLocation>
</wsdlOption>/span>
</wsdlOptions>/span>
cxf cxf-codegen-plugin生成的java類沒有在@WebService注解中包含wsdlocation引數。另外請注意,引數路徑必須只包含你構建路徑下的檔案夾。也就是說,雖然我的pom.xml位置是/src/main/resources/wsdl/HelloWorld.wsdl,但我的引數是wsdl/HelloWorld.wsdl,因為我已經將/src/main/resources檔案夾包含在構建路徑中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/312415.html
標籤:
上一篇:標注X軸的內容重復
