on 08-18-2015 2:21 AM
Hello Experts,
I am trying to create a dynamic filepath through java mapping .
I am using a FTP receiver adapter .
I have written the follwoing java code
private static final DynamicConfigurationKey KEY_FILEPATH =
DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File",
"Directory");
private static final DynamicConfigurationKey KEY_FILENAME =
DynamicConfigurationKey.create(
"http://sap.com/xi/XI/System/File",
"FileName");
String FileName = conf.get(KEY_FILENAME);
String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";
conf.put(KEY_FILEPATH, dir);
FTP receiver adapter will have the connection details.
I am getting the below error :
"FTPEx: 550 Unexpected reply codeCreate directory operation failed.. For details, contact your FTP server vendor".
However, I find there is no issue connecting to FTP server, when I tried connecting without dynamic configuration, it works good.
thanks for your inputs and help
Rama,
Seems FTP user does not have access to create folder (try to give 666 access to folder where you are creating dynamic folder). Please use FileZilla to test FTP user access.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
Please check if:
1. In the audit / moni log, if you are able to see the Directory path that is returned by ur UDF
2. Try to pass some constant (instead of doing Substring) value for the Directory path or pass the Directory path that is already present in the Target System for testing if you are able to access it.
3. As suggested abv, ckh the FTP user permissions (as you trying to access Filezilla using same FTP User as in your CC?)
4. Pls provide screenshot of error logs.
Regards,
Azhar
Hello Azhar,
Thanks a lot
I tried step by step , like first I passed
String dir = "XXXX"+"/";
conf.put(KEY_FILEPATH, dir);
executed the interface, it worked.
in the next step I added the substring .
like
String dir = "XXXX"+"/"+FileName.substring(2,5)+"/";
then it worked.
However, When I added more to this ,
like
String dir = "/"+"XXX"+"/"+oldFileName.substring(7,9)+"/"+"XXX"+"/"
I get the attached error :
To be more precise, This happens when a new substring has to get created,
like if folder path XXXX/AB/ is already there, then there will be no issues in creating
XXXX/AB/XXX/
However, when the program tries to create a new folder path with a new substring
like XXXX/CD , then it throws the error
Hi Rama,
Can you pls check on the following:
1. If there FTP User has Permissions to create New Dir in the Server (chk with your Unix team what permissions they have given to the FTP User, try with full permissions 777)
2. As suggested abv check in the Moni Log the Directory path that is generated by your code & verify if its a valid Dir path
3. Check whether your Substring function is returning correct value.
Hope it helps
Regards,
Azhar
Hello Azar,
I have rights to modify the FTP user permissions in the FTP , and I was able to make it from XXX to 777, for its directories and subdirectories . Which means all the directories under the FTP server will have full permissions. However, I am not sure if the FTP server by it self is set to 777.
Well, the Directory path is generated correctly. The only time we are getting error is when we try to create a directories in hierarchy , else if we are creating just one new folder under certain path it is good.
like : XXX/AB/CD ( if directory path AB exists then there will be no issue in creating a folder CD under AB, but if Directory path XXXAB Doesnt exists already then FTP receiver adapter is throwing an error ).
Yes, substring is returning the correct value.
Thanks for inputs
Rama,
Using FTP receiver channel we can not create hierarchy of folders at run-time. We can create only one level deep hierarchy dynamically. This is FTP limitation. Solution: - Use one level deep dynamic hierarchy.
FYI. When you restart failed message multiple times, it will be successfully. It will create one level deep hierarchy for each restart. We can create dynamic deep hierarchy folders on NFS (not on FTP).
Hi,
Aside from Hareesh's suggestion, have you checked in the receiver cc if the Create Target Directory is ticked?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rama,
Your directory path format looks wrong.
String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";
It should be
String dir = "XXXX"+"/"+FileName.substring(2,5)+"/"+"XXX"+"/";
No escape sequence is required for "/".
Try giving the complete path that you use in the FTP receiver adapter.
Also make sure that
String FileName = conf.get(KEY_FILENAME);
is returning value.
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you add "/" at the beginning and see if that helps
String dir = "/"+"XXXX"+"/"+FileName.substring(2,5)+"/"+"/XXX/"+"/";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.