on 02-10-2010 6:22 AM
Dear All
I am using Java mapping to change the filename dynamically. I am getting follwoing error in my receiver file communication channel.
Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//", so it contains the character "remote:///PI/OUTPUT//" which is not allowed
I am passing follwoing values as file access arguments
Target Directory: /PI/OUTPUT/
File Name Scheme: *
Please let me know why this error is coming as I have no other argument to pass other than this.
Regards
Sourabh
Hi Sourabh,
I guess the star in the directory path is the problem, why do you require FileName Schema?
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen
this is my code in Java mapping program:
try
{
//The following is for the FileName in the File Adapter
DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String MyFileName = dynamicconfiguration.get(key);
MyFileName=MyFileName.substring(0,(MyFileName.length())-15);
// Date format
SimpleDateFormat Sdate = new SimpleDateFormat("yyyyMMddHHmmSS");
String currentdate=Sdate.format(new Date());
//end
MyFileName=MyFileName.concat(".").concat(currentdate);
MyFileName=MyFileName.concat(".BAD");
dynamicconfiguration.put(key, MyFileName);
}catch(Throwable t)
{ t.printStackTrace(); }
Dear Suraj
I have passed %FileName% as the File Name Schema, the following error is comming in the communication channel
Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//%FileName%", so it contains the character "remote:///PI/OUTPUT//%FileName%" which is not allowed
Sourabh
Hi Suraj
I have checked the adapter specific message attributes and checked
1. Use adapter specific Message attribute
2. File Name
Still the error is coming as
Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.exception.standard.SAPIllegalArgumentException: The parameter "argument" has the value "remote:///PI/OUTPUT//", so it contains the character "remote:///PI/OUTPUT//" which is not allowed
When I check option "Fail if Adapter Specific Message AttributeMissing" I get follwoing error
Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
Hi Sourabh,
This means your udf was not called and the possible reason are:
1. Target node may not be created or
2. The sender Adapter specific identifier->Filename was not selected
It is always advisable to use this udf during the creation of the root node of the target xml structure (because its occurrence is 1..1 and it will always be created).
Where have you used!!!
Regards
Suraj
Hi Suraj
I am using Java mapping and not a graphical one
My requirement is to create a flat file without any xml tags. Please see the follwoing code for Java mapping:
public class JMapWorkOrderNRealTime extends DefaultHandler implements StreamTransformation
{
private Map map;
private OutputStream out;
private Map param;
String lineEnd = System.getProperty("line.separator");
private String Data;
public JMapWorkOrderNRealTime()
{
}
public void setParameter(Map map)
{
param = map;
if(param == null)
param = new HashMap();
}
public void execute(InputStream in, OutputStream out)throws com.sap.aii.mapping.api.StreamTransformationException
{
try
{
//The following is for the FileName in the File Adapter
DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String MyFileName = dynamicconfiguration.get(key);
MyFileName=MyFileName.substring(0,(MyFileName.length())-15);
// Date format
SimpleDateFormat Sdate = new SimpleDateFormat("yyyyMMddHHmmSS");
String currentdate=Sdate.format(new Date());
//end
MyFileName=MyFileName.concat(".").concat(currentdate);
MyFileName=MyFileName.concat(".BAD");
dynamicconfiguration.put(key, MyFileName);
}catch(Throwable t)
{ t.printStackTrace(); }
try
{
String line = null;
String lineEnd = System.getProperty("line.separator");
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
while((line=bin.readLine())!=null)
{
out.write(line.getBytes());
out.write(lineEnd.getBytes());
}
}catch(Throwable t)
{
t.printStackTrace();
}
}
Open the message in MONI and check the DynamicConfiguartion header under SOAP header.
If it contains fileName exactly what you are expecting as per java program, It should reflect in the file system.
Enable ASMA(with FileName checked) in the Receiver File channel and activate the channel. Send a new message and check.
Hi Sourabh,
>>I have enabled ASMA with File Name checked...
Enable In both sender and receiver adapters
Check these:
1. In inbound message are you seeing the Filename in dynamic configuration? I think atleast this should be visible
2. After request message mapping is the Filename having the value as you expected? (I guess you are facing problem in this)
3. Try to add some trace infor to see what the parameters like Filename etc is having values during different operations like substring, by using the trace commands.
check this wiki pages for the usage of trace with java mapping
http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API
Regards
Suraj
is wild card entry which we use basically for a particular selection
You cannot use * as filename for receiver file channle. It shuld be specific name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.