Skip to main content

Why and when does a DATA_CONVERSION exception occurs?

  • February 16, 2013
  • 0 replies
  • 0 views

Dominique Sacre
Forum|alt.badge.img+2

Problem:

  • Product Name: VisiBroker for Java
  • Product Version: 6.5
  • Product Component: IDL, ORB
  • Platform/OS Version: All

Why and when does a DATA_CONVERSION exception occurs?

e.g. Exception in thread "main" org.omg.CORBA.DATA_CONVERSION: minor code: 4F4D0001 completed: No

Resolution:

DATA_CONVERSION exception is due to improper charset. A CORBA string is a sequence of chars. Chars are 8-bit wide, and can only accept characters from the ISO 8859-1 character set. Java uses Unicode for its source files, and thus for string literals. This means that when you use characters in a Java string that are not in ISO 8859-1, they cannot be converted to 8-bit chars in the CORBA string type. In other words the idl string type is mapped to java.lang.String. Characters within the String that are out of IDL char range can cause CORBA::DATA_CONVERSION

This is the expected behavior.

VBE release which complies with OMG 2.3.1 specifications, supports:

1) ISO-LATIN-1 for characters & strings.

2) UTF-16 for wide characters & wide strings (wide here goes with IDL's definition)

All codesets which are compatible with these 2 codesets are also supported by VisiBroker.

In order to see if all the characters sent are properly interpreted, enable following debug properties on both Client and Server side.

The Server side will tells if Server is getting junk data which is not interpreted.

vbroker.orb.warn=2

vbroker.orb.debug=true

vbroker.orblogLevel=debug

The character value should be less than 255. If not use wstring instead of String type. A wstring represents a sequence of wide characters (wchars). Wchars can hold a character from any character set.

 

Related Article

 
[[knowledge_base: DATA_CONVERSION exception in VBC and VBJ]]

#VisiBroker
#Security