Skip to Content
0
Former Member
Sep 12, 2016 at 01:32 PM

com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog

2437 Views

Hi Experts,

My requirement is PI has to pick one CSV file from third party and place it into another third party( SFTP to SFTP). After placing the file into the server PI has to send an email notification to business user.

I have used mail package to achieve this. Mapped Subject, From, To fields with required constants and Content field mapped with the below UDF and Date function.

UDF code:

public String MailBody(String date, Container container) throws StreamTransformationException{

try

{

String MyFileName= "";

String output = "";

DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");

MyFileName = conf1.get(key1);

MyFileName = MyFileName.substring(0, MyFileName.lastIndexOf("."));

output = MyFileName + " has been sent to ADP on " + date;

conf1.put(key1, MyFileName);

return output;

}

catch(Exception e) {

String exception = e.toString();

return exception;

}

I am encountering the below error after the file transmission in PI.

Error:

Mapping "http://www.varian.com/inbound/TRION/OM_MAIL_TRIONIB" failed to execute: MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_TRIONIB_ECC_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog., ApplicationRuntimeException: Runtime Exception when executing application mapping program com/sap/xi/tf/_MM_TRIONIB_ECC_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog., BaseRuntimeException: Content is not allowed in prolog., BaseRuntimeException: Content is not allowed in prolog., org.xml.sax.SAXParseException: Content is not allowed in prolog.



Appreciate your quick help!


Followed the below blog but no luck!


The Mystery of 'Content is not allowed in prolog'


Thanks

Gayathri.