aspose file tools*
The moose likes Web Services and the fly likes SAXParseException on Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SAXParseException on "ИЙ" sequence, why?" Watch "SAXParseException on "ИЙ" sequence, why?" New topic
Author

SAXParseException on "ИЙ" sequence, why?

Nic Nilov
Greenhorn

Joined: Apr 02, 2009
Posts: 3
I load some values from database using hibernate and try to send them out in a webservice method result. Although some values go out nice, on others an exception is thrown:



My initial assumption was that the value is somehow incorrect, but the exception also happens after modifying the value in debug via watch. Such strings as "ТЕСТ тест" do not happen to lead to exception, but string "ПЕТЕРБУРГСКИЙ" always leads to it. Actually, even after updating database field, the value of "ИЙ" also leads to exception (the values are in russian).
The value in point contained in an @Entity class, which in turn contained in webservice response wrapper class. The field named 'name' of database type varchar(100) and Java type String. Database uses UTF8 encoding.

Could anyone give some insight on possible roots of the issue?

Software used is NetBeans 6.5, Glassfish v2ur2 and PostgreSQL 8.3.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Almost an identical error message at SAXException: Invalid byte 2 of 2-byte UTF-8 sequence. Please note that P Lavti said -

One more thing, If I change the encoding to iso-8859-1 it works fine.


BTW, which DB do you use? and let's keep in mind that even though the DB is configured to utf-8, it doesn't necessarily mean that the DB can verify that all the data which comes in, is indeed utf-8 encoded data.

Regards,
Dan



William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Nic Nilov
Greenhorn

Joined: Apr 02, 2009
Posts: 3
Thanks for you answer! As I said, my data comes from the database, in form of entities and gets passed out as web service method result. How can I specify character encoding for a web service method output in Glassfish?
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
Nic Nilov wrote: in form of entities


What do you mean by saying the above?
Nic Nilov
Greenhorn

Joined: Apr 02, 2009
Posts: 3
I mean that they are loaded into entity bean classes by means of hibernate.
André Pereira
Greenhorn

Joined: May 11, 2009
Posts: 1
Nic Nilov wrote:Thanks for you answer! As I said, my data comes from the database, in form of entities and gets passed out as web service method result. How can I specify character encoding for a web service method output in Glassfish?


I have the same error. I want to set enconding for a web service output method in GlassFish! Do you know how to fix it, Nic Nilov? Thank you!
 
wood burning stoves
 
subject: SAXParseException on "ИЙ" sequence, why?