cancel
Showing results for 
Search instead for 
Did you mean: 

Encoding problem when deserializing the SalesDocument header

Former Member
0 Kudos
126

Hello all,

We have a problem when deserializing the SalesDocument header.

In the class ExtDataDB:

public Object readExtValue(Object extVal){
    try {
        String extStr = (String)  extVal;
        byte[] buf = extStr.getBytes(Constants.DEFAULT_ENCODING_UTF_8);
        ByteArrayInputStream bis = new ByteArrayInputStream(buf);
        ObjectInputStream is = new ObjectInputStream(bis);

I get the exception:

java.io.StreamCorruptedException: invalid stream header

The stack trace:

ExtDataHeaderDB(ExtDataDB).readExtValue(Object) line: 85

ExtDataHeaderDB.getExtValue() line: 122

SalesDocumentHeaderDB.fillExtensionDataIntoObject(Set, HashMap, HeaderData) line: 1158

SalesDocumentHeaderDB.fillIntoObject(Object) line: 1503

BasketDB(SalesDocumentDB).updateHeaderInBackend(SalesDocumentData, ShopData) line: 4648

BasketDB(SalesDocumentDB).updateInBackend(SalesDocumentData, ShopData) line: 4802

Basket(SalesDocument).update(BusinessPartnerManager, ShopData) line: 1496

ExtMaintainBasketRefreshAction(MaintainBasketBaseAction).updateSalesDocument(RequestParser, UserSessionData, SalesDocument, Shop, BusinessPartnerManager, IsaLocation) line: 682

This is related to an upgrade in progress, from ISA 4.0 to ISA 7.0, and the same messages were correctly displayed before.

I believe that it can be related to encoding configuration, as my JSP's are displaying erroneous characters too.

I compared this method with the one in ISA 4.0, and they are different, it does not assume any encoding:

ISA 4.0

byte[] buf = extStr.getBytes(Constants.DEFAULT_ENCODING_UTF_8);

ISA 7.0

byte buf[] = extStr.getBytes();

The error is related to a custom boolean field, added to the ExtensionData of the header (that was working correctly before too).

Maybe the value is being stored with another encoding? is there a global setting for this?

Thanks in advance for any help given,

--Ricardo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If anyone has this problem, please see Note 1823975 - "Persisted Objects in Extension Data cannot retrieved anymore".

Answers (2)

Answers (2)

Former Member
0 Kudos

After analysis from SAP support, they found that this was a problem from the product, they are correcting it, and will release a patch soon.

Former Member
0 Kudos

Just a quick note:

Even in NWDS, a custom Java file has encoding problems (in the comments), here is an example:

In ISA 4.0, using Eclipse:

Extensão à acção standard do ISA responsável pela inicialização da aplicação

In ISA 7.0 using NWDS:

Extens�o � ac��o standard do ISA respons�vel pela inicializa��o da aplica��o

Maybe all these problems are related?