我正在尝试使用smooks 1.5将csv文件转换为xml。我已经导入了所有smooks jar,但是出现了这个错误
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:Configuration>问题:无法找到命名空间的NamespaceHandler>> [http://www.muleforge.org/smooks/schema/mule-module-smooks ] 违规资源:网址>> [file:/ D:/Documents/MuleStudio/workspace/.mule/apps/smooksapp/SmooksApp.xml]
这是我的mule-config文件
<?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>
答案 0 :(得分: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一起使用。