Author |
Message
|
CuriCAT |
Posted: Wed Oct 04, 2006 7:46 am Post subject: FTP client from Message Broker Version 6 |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
I want to do FTP directly from Message broker to upload files to FTP server. My requirement is to use one of the nodes in the message flow as an FTP client.
How can I achieve this ?
I am trying to do it this way :
I am using java compute node with Apache Jakarta Commons Net package to do FTP to the Server. Is it possible to do this ? (because I am not able to add the apache JAR file to the bar file )
Is there any best way of doing FTP from a message flow ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 04, 2006 7:57 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can (and should) put the Apache JAR file in the shared-classes directory of the broker working directory.
You could also look at Support Pack MA0P for a slightly different approach.
The broker IAOX support pack doesn't do what you want, so ignore it. It would allow someone to submit data to Broker over FTP, rather than allow Broker to send data over FTP.
Long term, you should consider enabling the receiving application to use MQ or some other protocol than FTP. MQ is a lot more reliable than FTP. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CuriCAT |
Posted: Tue Oct 10, 2006 2:44 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
I have copied the JAR file into WorkPath/shared-classes. still I am getting this error "No class definition found error"
Could you tell me is there anything else I need to do after copying the JAR file into the directory.
Thanks and Regards |
|
Back to top |
|
 |
PieterV |
Posted: Tue Oct 10, 2006 3:14 am Post subject: Re: FTP client from Message Broker Version 6 |
|
|
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
|
[quote="ganeshgurukkal"]
I am using java compute node with Apache Jakarta Commons Net package to do FTP to the Server. Is it possible to do this ? (because I am not able to add the apache JAR file to the bar file )
[quote]
if you import the jar file into your project, you will be able to add the JAR to the BAR file. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 10, 2006 3:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ganeshgurukkal wrote: |
Could you tell me is there anything else I need to do after copying the JAR file into the directory. |
Restart the broker...
Or at least the execution group that holds the flow. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
CuriCAT |
Posted: Tue Oct 10, 2006 5:30 am Post subject: |
|
|
 Voyager
Joined: 26 Sep 2006 Posts: 82
|
Thank you very much to Mr/Ms. jefflowrey and Mr/Ms PieterV.
It works !!.
Is that the solution do I need to restart the Broker. I can do it in Development server thats not a problem, but in Production Server ???
Please, Is there any solution ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 10, 2006 6:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, as PieterV said, you can add the JAR file to your BAR file, either by configuring your project to do so or doing so manually.
Then the classes will be on the classpath when you deploy.
The problem with this is that it will load the JAR file once for every time you deploy your flow, and if you need to use these classes from multiple flows that are in different BAR files then you may get into some trouble. You can get a better idea of classloading by looking at http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/as04520_.htm
I'm not 100% sure, but it seems fairly clear that JCNs get loaded by the Grouped classloader.
If your flow is the only flow that will ever use this library, then it's okay to put it in the BAR file, but my tendancy is to always put this kind of third-party library jar into shared-classes. If you've done work with J2EE environments, think of the BAR file like an EAR file and shared-classes like a server level class-path entry. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|