-
1. Re: FTP Client and Static Route Example
kconner May 25, 2010 7:39 AM (in response to machiume)I assume you are talking about the CreateTestFile class, which simply seeds some files for the example.
Within the ESB we use the apache FTP client to support ftp and ftps, with sftp being supported by JSch from jcraft.
Kev
-
2. Re: FTP Client and Static Route Example
machiume May 26, 2010 1:42 AM (in response to kconner)Thanks for the response Kevin. So, all I really want to do is have files that I generate ported over to an FTP server somewhere. The samples all show the reverse situation, and the one that comes close is the Static Route example. Where/how would I use the ESB to achieve this. Your guidance would be greatly appreciated.
Thanks.
-
3. Re: FTP Client and Static Route Example
tomeicher Jun 10, 2010 10:42 AM (in response to machiume)Well, you should be able to use FTPEpr to define an ftp endpoint from the config, but I have never tries this.
Since we had to go to different endpoints programmatically anyway, we did implement our own FTPRouter which does something like
// clone and modify the AbstractActionPipelineProcessor's ConfigTree
ConfigTree configTreeConfiguredForThisMessage = myConfigTree.cloneObj();
configTreeConfiguredForThisMessage.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER, sftpFtpServer);configTreeConfiguredForThisMessage.setAttribute(RemoteFileSystem.PARMS_PASSIVE, ftpPassive);
...
// instantiate and use FTPImpl
ftpImpl = new FtpImpl(configTreeConfiguredForThisMessage, true);
ftpImpl.uploadFile(localFile, remoteFileName);
Be sure to check the JIRA for some problems with FTPImpl, concerning ignored timeouts etc...
Cheers, Tom.
-
4. Re: FTP Client and Static Route Example
izgur Dec 9, 2010 5:09 AM (in response to tomeicher)Did u manage to do the trnsfer to another FTP ?
-
5. Re: FTP Client and Static Route Example
tomeicher Dec 9, 2010 5:24 AM (in response to izgur)??? We did it implement like/with the code I pasted above... Works fine...
-
6. Re: FTP Client and Static Route Example
izgur Dec 9, 2010 5:55 AM (in response to tomeicher)Damn... i can't even run the sample...
Deployment "vfszip:/D:/KKISSWORK/jboss-5.1.0.GA-jdk6/server/default/deploy/Quickstart_static_router.esb/" is in error due to the following reason(s): com.ctc.wstx.exc.WstxUnexpectedCharException: Illegal character ((CTRL-CHAR, code 12))
at [row,col {unknown-source}]: [11,27]How to solve this "illegal charachter" ?
Trying...
-
7. Re: FTP Client and Static Route Example
kconner Dec 9, 2010 6:05 AM (in response to izgur)Sounds like the jboss-esb-template.xml or the filtered version has been corrupted, can you check them?
-
8. Re: FTP Client and Static Route Example
izgur Dec 9, 2010 7:44 AM (in response to kconner)I dont find the jboss-esb-template.xml.
I found jboss-esb.xml in the static_router directory, and it could be this character in line directory="D: tptest" which makes the error(it is line 11).
In my pspad i have this file opened, and it looks like a square behind D: and before tptest.
But if I change this, it gets generated again when deployed. So, what rewrites the jboss-esb.xml ? Isn't this the main ESB file? Why is it changed?
What is more... I don't understand the database binding when doing FTP. Why would I need it? I have only a mysql database for Riftsaw...
<providers>
<ftp-provider name="FTPprovider" hostname="localhost" >
<ftp-bus busid="StaticRouterFtpGW" >
<ftp-message-filter
username="esb"
password="esb"
passive="false"
directory="D: tptest"
input-suffix=".dat"
/>
</ftp-bus>
</ftp-provider><fs-provider name="LocalFsProvider">
<fs-bus busid="staticRouter" >
<fs-message-filter
directory="D:\KKISSWORK\jbossesb-4.8\samples\quickstarts\static_router\build\dirs\staticrouter"
input-suffix=".esbMessage"
/>
</fs-bus>
<fs-bus busid="fileMessageDestination_01" >
<fs-message-filter
directory="D:\KKISSWORK\jbossesb-4.8\samples\quickstarts\static_router\build\dirs\service01\input"
input-suffix=".toRoute01"
post-delete="false"
post-directory="D:\KKISSWORK\jbossesb-4.8\samples\quickstarts\static_router\build\dirs\service01\post"
/>...
-
9. Re: FTP Client and Static Route Example
kconner Dec 9, 2010 7:53 AM (in response to izgur)Sorry, file is called jboss-esb-unfiltered.xml.
Looks like the path is not being set correctly on windows, please change it to /D:/KKISSWORK/jbossesb-4.8/ ...., replacing \ with /