Mule - 导出的项目 - 错误java.io.FileNotFoundException

时间:2015-06-02 19:06:21

标签: deployment path wsdl mule

我已导出我的mule项目,其中包含src.main.resources/wsdl-request中的WSDL文件。

导出类型AnyPoint Studio Project to AnyPoint Deployable Archive

问题是当我在服务器中执行可部署档案时,它会返回以下错误:

Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Users/usrAdmin/AnypointStudio/workspace/mule-project-test/src/main/resources/wsdl-test/Request.wsdl'. (The system cannot find the path specified)
    at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:249)
    at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:192)
    at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:98)
    ... 54 more
Caused by: java.io.FileNotFoundException: C:\Users\usrAdmin\AnypointStudio\workspace\mule-project-test\src\main\resources\wsdl-test\Request.wsdl (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at java.io.FileInputStream.<init>(FileInputStream.java:101)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    ... 60 more

错误所说的路径是我在导出之前的项目

如何将文件添加到项目中以避免该错误? 我认为我需要使用classpath或类似的东西,但我不知道它是否有效。

添加了:

这是我的实际wsdlLocation:

wsdlLocation = "file:/C:/Users/tstSrvr/AnypointStudio/workspace/test-project/src/main/resources/wsdl-test/Request.wsdl"

1 个答案:

答案 0 :(得分:2)

您的配置中似乎已对此路径C:\Users\usrAdmin\AnypointStudio\workspace\mule-project-test\src\main\resources\wsdl-test\Request.wsdl进行了硬编码。

使用wsdl-test/Request.wsdl代替,以便在Studio中和打包应用程序时找到文件,因为它将从类路径(作为资源)加载而不是作为文件加载(通过绝对路径)。