cancel
Showing results for 
Search instead for 
Did you mean: 

Java to Java ByteOrder problem

Former Member
0 Kudos

Hello,

im having a strange byteorder problem during the communication via sockets on WebAS. Im using a servlet that is deployed as a .par and a .ear archive that runs on the WebAS. The servlet opens a socket to the application running directly on the WebAS. Im working on a NWSP15 installation with WebAS 6.40.

When those communicate via standard java sockets and DataOutputStreams sometimes the servlet begins to send little endian byteorder instead of big endian. It starts in the middle of the code and i have currently no idea how i could fix this. It isnt only one value thats not being send correctly, it just switches and sends everything after it in little endian. It also happens very randomly, sometimes it happens everytime then doesnt happen the next 50 or 100 communications tries.

Did anyone else encounter this problem and could give me some tips how to fix it.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

This is very strange indeed. Big" or "Little" endian depends on the sun.io.unicode.encoding, so maybe somebody is changing this JVM system property at runtime?

To check whether this is the case you can modify the java.lang.System class setProperty method with Thread.dumpStack() to see what is the calling stack and whether this is the case. After the modification and compilation simply pack the class into a separate jar file and prepend it to the boot classpath thus ensuring that for the test the modified class is taken first.

I hope this can be of some help.

Myriana