wso2 ESBを使用してローカルディレクトリからファイルを選択し、そのファイルのレコードをデータベースに挿入して電子メールを送信しようとしています。ファイル処理にwso2-esbを使用する
はhttps://docs.wso2.com/display/ESB490/Sample+271%3A+File+Processing
以下に与えられた手順に従っSmooksの-configファイルである
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.0.xsd">
<!--Configure the CSVParser to parse the message into a stream of SAX events. -->
<resource-config selector="org.xml.sax.driver">
<resource>org.milyn.csv.CSVParser</resource>
<param name="fields" type="string-list">name,surname,phone</param>
</resource-config>
</smooks-resource-list>
これは、ESBサーバーに
org.milyn.SmooksException: Failed to filter source.
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:97)
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:64)
at org.milyn.Smooks._filter(Smooks.java:526)
at org.milyn.Smooks.filterSource(Smooks.java:482)
at org.wso2.carbon.mediator.transform.SmooksMediator.mediate(SmooksMediator.java:140)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org/milyn/csv/CSVParser
at org.xml.sax.helpers.XMLReaderFactory.loadClass(Unknown Source)
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at org.milyn.delivery.AbstractParser.createXMLReader(AbstractParser.java:291)
at org.milyn.delivery.sax.SAXParser.parse(SAXParser.java:62)
at org.milyn.delivery.sax.SmooksSAXFilter.doFilter(SmooksSAXFilter.java:86)
... 11 more
[2016-10-30 15:01:50,111] ERROR - SequenceMediator Failed to filter source. Caused by Failed to filter source.
org.wso2.carbon.mediator.service.MediatorException: Failed to filter source. Caused by Failed to filter source.
at org.wso2.carbon.mediator.transform.SmooksMediator.handleException(SmooksMediator.java:265)
at org.wso2.carbon.mediator.transform.SmooksMediator.mediate(SmooksMediator.java:160)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:97)
at org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:59)
at org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:158)
at org.apache.synapse.mediators.MediatorWorker.run(MediatorWorker.java:80)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[2016-10-30 15:01:50,153] INFO - LogMediator To: , WSAction: urn:mediate, SOAPAction: urn:mediate, MessageID: urn:uuid:f8385dfd-f7c7-42fa-a567-b234028d1c59, Direction: request, MESSAGE = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = Failed to filter source. Caused by Failed to filter source., Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><text xmlns="http://ws.apache.org/commons/ns/payload">vidya,mj,123456789</text></soapenv:Body></soapenv:Envelope>
を示すエラーです。この
を解決するために私を助けてください
はいこれはESB_HOME/repository/components/libにあります。 – mjvid
OSGIコンソールを介してクラスを見つけることができる場合は、次にチェックしてください。したがって、あなたはコマンド "wso2server.sh -DosgiConsole"でサーバを起動する必要があります –
新しいバージョンmilyn-smooks-all-1.5.1 jarにはCSVParserがないので、smooks-configファイルのCSVParserをCSVReaderに変更することで問題は解決しました。ありがとうございました ! – mjvid