cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to recognize OLE stream

Former Member
0 Kudos

Guys,

I have developed a adapter EJB module to convert an excel file to xml. When I execute my module, I am getting an error "Unable to recognize OLE stream".

<b>jxl.read.biff.BiffExeption: Unable to recognize OLE stream.</b>

public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)

throws ModuleException {

//Object obj = null;

//Message msg = null;

try {

Audit.addAuditLogEntry(amkey, AuditLogStatus.SUCCESS, "Entered ModuleData method");

obj = inputModuleData.getPrincipalData();

msg = (Message) obj;

// Write Audit message

amkey = new AuditMessageKey(msg.getMessageId(), AuditDirection.OUTBOUND);

Audit.addAuditLogEntry(amkey, AuditLogStatus.SUCCESS,

"Custom adapter module MyProjectEJB called: Method ModuleData");

XMLPayload xp = msg.getDocument();

if (xp != null) {

byte by[] = convert(xp.getContent());

xp.setContent(by);

Audit.addAuditLogEntry(amkey, AuditLogStatus.SUCCESS,

"Custom adapter module MyProjectEJB called: Method convert executed");

}

inputModuleData.setPrincipalData(msg);

} catch (Exception e) {

Audit.addAuditLogEntry(amkey, AuditLogStatus.ERROR, "Error in method ModuleData");

}

return inputModuleData;

}

// Transform the excel data into xml so that the Adapter Engine can do the processing.

public byte[] convert(byte src[]) throws Exception {

String xmldata = "";

try {

Audit.addAuditLogEntry(amkey, AuditLogStatus.SUCCESS,

"src: " + src.length);

String err = "";

ByteArrayInputStream f5 = new ByteArrayInputStream(src);

Audit.addAuditLogEntry(amkey, AuditLogStatus.SUCCESS,

"ByteArrayInputStream f5 = new ByteArrayInputStream(src)- executed");

<b>Workbook wb = Workbook.getWorkbook(f5);</b> -


> After this step I am getting that error.

Any ideas are greatly appreciated. I connect to unix server to get the file using FILE adapter/custom module.

Thanks,

Shanth

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi,

Did you cross check your module with this howtoguide-

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac2...

Also this thread discussion-

May help you

Regards,

moorthy

Former Member
0 Kudos

thanks for the info. I did follow the how-to guide. But somehow I am getting this error. Any ideas? The thread discussion is more on the web dynpro dev.

thanks,

shanth

Answers (0)