So, I made a simple web service in Netbeans 7.2.1 that works fine with non-UTF-8 char (s), whereas even if there is one UTF-8 char in the database table via the web service, after calling it, I get this message:
SOAP response A service call threw an exception to the message: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: invalid byte 2 from a 2-byte UTF-8 sequence; See Server Log for more details.
If I replace UTF8 char (s) in the database table, the web service is working fine.
Just to mention, I am using netbeans, jtds 1.3 ms sql server driver and glassfish 3.1.2.2
UPDATE: I think I managed to somehow solve this problem:
Go to:% GF_Install_dir% \ glassfish_3_version \ glassfish \ domains \ domain1 \ config
Open the domain.xml file
Find the line starting with: <java-config ... / ">
< jvm-options> ... />
.. and add a new line as follows: <JVM options> -Dfile.encoding = UTF-8 </ JVM options>
Reboot the GF server.
source share