[mule-user] FtpConnector and filenameParser property

0 views
Skip to first unread message

Bambitroll_

unread,
Oct 15, 2007, 7:58:01 AM10/15/07
to us...@mule.codehaus.org
Hello, First of all, here is my setup: Mule 1.4.3 running on Ubuntu 7.04 on JRE 1.6.0_03. I am experiencing a problem with the FtpConnector and more specifically the property called filenameParser. I am trying to get Mule to use a home made class to handle the filename generation (since the default options are not good enough for me). But when I try to set the filenameParser property, I get an error. So I tried with the default class, and I also get an error (like if Mule did not have a setter for filenameParser, which according to the API it has!). Here is how it looks in my config file: And here is the error I get when I start Mule: ERROR 2007-10-15 13:53:53,014 [WrapperSimpleAppMain] org.apache.commons.beanutils.PropertyUtils: Method invocation failed. java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773) at org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759) at org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648) at org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677) at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:313) at org.mule.util.BeanUtils.populateWithoutFail(BeanUtils.java:65) at org.mule.config.builders.MulePropertiesRuleSet$1.end(MulePropertiesRuleSet.java:98) at org.apache.commons.digester.Digester.endElement(Digester.java:1130) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(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.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1685) at org.mule.config.builders.AbstractDigesterConfiguration.process(AbstractDigesterConfiguration.java:101) at org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:264) at org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:218) at org.mule.MuleServer.initialize(MuleServer.java:294) at org.mule.MuleServer.run(MuleServer.java:207) at org.mule.MuleServer.start(MuleServer.java:195) at org.mule.MuleServer.main(MuleServer.java:166) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:619) WARN 2007-10-15 13:53:53,016 [WrapperSimpleAppMain] org.mule.util.BeanUtils: Property: filenameParser=org.mule.providers.file.SimpleFilenameParser not found on object: org.mule.providers.ftp.FtpConnector So I am a bit puzzled that it does not even work with the default class! Moreover, I search in the mailing list and in Jira and I saw several people using it exactly as I do above and none reported any problems. Does anyone have an idea why I get this error message at Mule startup? Thanks!
BT.


View this message in context: FtpConnector and filenameParser property
Sent from the Mule - User mailing list archive at Nabble.com.

Bambitroll_

unread,
Oct 15, 2007, 7:59:01 AM10/15/07
to us...@mule.codehaus.org

Kynan Fraser

unread,
Oct 15, 2007, 8:18:09 PM10/15/07
to us...@mule.codehaus.org

Hi,

Have you tried moving the parser declaration to the endpoint? eg.

<endpoint address="..." connector="FTPConnector">
<properties>
<property name="filenameParser"

value="org.mule.providers.file.SimpleFilenameParser" />
<property name="outputPattern"
value="n_${COUNT}.txt" />
</properties>
</endpoint>

Regards,
Kynan


Bambitroll_ wrote:
>
> Hello,
>
> First of all, here is my setup: Mule 1.4.3 running on Ubuntu 7.04 on JRE
> 1.6.0_03.
>
> I am experiencing a problem with the FtpConnector and more specifically
> the property called filenameParser. I am trying to get Mule to use a home
> made class to handle the filename generation (since the default options
> are not good enough for me). But when I try to set the filenameParser
> property, I get an error. So I tried with the default class, and I also
> get an error (like if Mule did not have a setter for filenameParser, which
> according to the API it has!).
> Here is how it looks in my config file:

> <connector name="tsp-ftpConnector"
> className="org.mule.providers.ftp.FtpConnector">
> <properties>
> <property name="pollingFrequency" value="5000" />
> <property name="filenameParser"
> value="org.mule.providers.file.SimpleFilenameParser" />
> <property name="outputPattern" value="n_${COUNT}.txt" />
> <property name="validateConnections" value="true" />
> </properties>
> </connector>

--
View this message in context: http://www.nabble.com/FtpConnector-and-filenameParser-property-tf4626800.html#a13224665


Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Bambitroll_

unread,
Oct 16, 2007, 4:39:27 AM10/16/07
to us...@mule.codehaus.org

Thanks Kynan for your input!
It works better this way indeed, even if I don't quite understand why my way
of doing it does not.
Do you have any explanation why I cant' set the filenameParser property
directly when I define the connector?

So I moved on from there and tried to replace SimpleFileNameParser with my
own class.
So now my config file looks like this:
<endpoint name="MyFtp"
address="ftp://user:pwd@ftpserver/appl/test/"
connector="tsp-ftpConnector" transformers="TSPObjectToFTPFile" >
<properties>
<property name="filenameParser"
value="org.XXX.YYY.providers.ftp.MyFilenameParser" />
<property name="outputPattern" value="n_${UUID}.ctl" />
</properties>
</endpoint>

But I see that MyFilenameParser (which implements FilenameParser interface)
is never called! SimpleFilenameParser is still the one used!
Any idea why that is?


Thanks a bunch!


Kynan Fraser wrote:
>
> Hi,
>
> Have you tried moving the parser declaration to the endpoint? eg.
>
> <endpoint address="..." connector="FTPConnector">
> <properties>
> <property name="filenameParser"
>
> value="org.mule.providers.file.SimpleFilenameParser" />
> <property name="outputPattern"
> value="n_${COUNT}.txt" />
> </properties>
> </endpoint>
>
> Regards,
> Kynan
>
>


-----
BT.
--
View this message in context: http://www.nabble.com/FtpConnector-and-filenameParser-property-tf4626800.html#a13229035

Bambitroll_

unread,
Oct 16, 2007, 4:58:12 AM10/16/07
to us...@mule.codehaus.org

I think I found out why the filenameParser property does not work...
Indeed, if you have a look here
(http://mule.mulesource.org/display/MULE/Ftp+Provider) and go the the
Property Overrides section, you will see the list of what can be overridden,
and filenameParser is not one of them.
And I guess that mule does not complain about it (like it does if I define
filenameParser in the connector tag) because somehow it simply ignores it.

And the conclusion of all this is that we still don't know why setting the
filenameParser property in the connector tag causes an error.
Could this be a bug?


BT.


-----
Rgrds,
BT.
--
View this message in context: http://www.nabble.com/FtpConnector-and-filenameParser-property-tf4626800.html#a13229301

Andrew Perepelytsya

unread,
Oct 16, 2007, 9:17:17 AM10/16/07
to us...@mule.codehaus.org
Yes, please file a JIRA and link back to the thread.

Andrew
Reply all
Reply to author
Forward
0 new messages