JBoss EAP 7.3尝试定位WSL时出错

roejwanj  于 2022-11-08  发布在  其他
关注(0)|答案(1)|浏览(135)

我正在尝试部署一个基本的Web服务,我的wsdl位于如下beans.xml中:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
        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" />

        <jaxws:endpoint 
          id="helloWorld" 
          implementor="com.tsdevelopment.HelloWorldImpl" 
      wsdlLocation="src/main/resources/wsdl/HelloWorld.wsdl"
          address="/HelloWorld" />

</beans>

当我使用mvn wildfly:deploy进行部署时,收到以下错误:

Caused by: java.io.FileNotFoundException: C:\Users\codereadystudio\jboss-eap-7.3\bin\src\main\resources\wsdl\HelloWorld.wsdl (The system cannot find the path specified)
    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)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:1009)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:144)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:832)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:798)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108)
    at org.apache.xerces@2.12.0.SP02-redhat-00001//org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:230)
    at 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,而不是在代码中搜索?

crcmnpdw

crcmnpdw1#

无法找到WSDL的原因似乎是在pom.xml中,wsdl路径如下所示:

<wsdlOptions>
  <wsdlOption>
    <wsdl>
      src/main/resources/wsdl/HelloWorld.wsdl
    </wsdl>                                      
    <wsdlLocation>wsdl/HelloWorld.wsdl</wsdlLocation>
  </wsdlOption>
</wsdlOptions>

cxf cxf-codegen-plugin生成的java类没有在@WebService注解中包含wsdlLocation参数。另外请注意,参数路径必须只包含构建路径下的文件夹。也就是说,当我的pom.xml位置是/src/main/resources/wsdl/HelloWorld.wsdl时,我的参数是wsdl/HelloWorld.wsdl,因为我已经在构建路径中包含了/src/main/resources文件夹。

相关问题