0

我正在尝试使用 smooks 1.5 将 csv 文件转换为 xml。我已经导入了所有的 smooks jar,但是出现了这个错误

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置>问题:无法找到命名空间的 NamespaceHandler >>[http://www.muleforge.org/smooks/schema/mule-module-smooks] 违规资源:URL > >[文件:/D:/Documents/MuleStudio/workspace/.mule/apps/smooksapp/SmooksApp.xml]

这是我的骡子配置文件

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:smooks="http://www.muleforge.org/smooks/schema/mule-module-smooks" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.muleforge.org/smooks/schema/mule-module-smooks http://dist.muleforge.org/smooks/schema/mule-module-smooks/1.3/mule-module-smooks.xsd">
    <flow name="SmooksAppFlow1" doc:name="SmooksAppFlow1">
        <file:inbound-endpoint path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources" responseTimeout="10000" doc:name="File"/>
        <smooks:transformer name="csvToXmlSmooksTransformer" configFile="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources\smooks-config.xml" resultType="STRING" reportPath="target/smooks-report/report.html" />
        <file:outbound-endpoint responseTimeout="10000" doc:name="File" path="D:\Documents\MuleStudio\workspace\smooksapp\src\main\resources"/>
    </flow>
</mule>
4

1 回答 1

1

将此添加到您的项目 pom.xml 文件中:

<dependencies>
   ...
   <!-- The Mule Smooks Module -->
   <dependency>
       <groupId>org.mule.modules.mule-module-smooks</groupId>
       <artifactId>smooks-4-mule-3</artifactId>
       <version>1.3-RC1</version>
   </dependency>
   ...
</dependencies>

与 Mule 版本 3.4.1 一起工作正常。

于 2014-02-14T17:50:08.707 回答