tomasbilek / gwteventservice

Automatically exported from code.google.com/p/gwteventservice
Other
0 stars 0 forks source link

addEvent fails, in catched SAXException after upload a malformed xml-file #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. extend a new ServletClass from RemoteEventServiceServlet 
2. upload (or hardcode) a malformed xml-file in ServletClass
3. validate the xml-file with DocumentBuilder.parse
4. catch the SAXException
5. do addEvent() in the catch

What version of the product are you using? On what operating system?
gwt 1.6.4
gwteventservice 1.0.1

Workaround:
keep the Exception in a var
do addEvent() outside of catched SAXException

Original issue reported on code.google.com by devx...@googlemail.com on 10 Jul 2009 at 7:23

GoogleCodeExporter commented 8 years ago
Update:
4. catch the SAXException
5. store the SAXException as Throwable field in a EventClass the implements 
Event
6. do addEvent(DOMAIN, new Eventlass(SAXException)) in the catch

Workaround;
do addEvent(DOMAIN, new Eventlass(new Exception(SAXException)))

Original comment by devx...@googlemail.com on 10 Jul 2009 at 9:57

GoogleCodeExporter commented 8 years ago
The error can not be reproduced.

For testing purposes I have modified the method
ConversationServiceImpl#sendMessage(...) of the DemoConversationApp. The entered
message text will be parsed by the DocumentBuilder. A message like
"<test>test</test>" can be processed successfully and is displayed in the 
message
log. The message text "<test>test</te>" (invalid XML) causes a SAXException. The
modified sendMessage(...) method adds a new NewMessageEvent with the 
SAXException as
message and that event is also successfully added to the message log.

I have attached the patch file for the modified sendMessage method, which should
reproduce the error, and two screenshots that show the right effect.

There must be another problem. Maybe some code in the try block isn't executed, 
so
the event can not be added. Maybe the listener isn't added at the time? It 
would be
helpful if you could build a small example to reproduce the error, when it 
still occurs.

Original comment by sven.strohschein@googlemail.com on 11 Sep 2009 at 8:58

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by sven.strohschein@googlemail.com on 14 Feb 2010 at 2:00

GoogleCodeExporter commented 8 years ago
The error is reproduceable when the SAXException is a (global) member variable 
of the transferred event. The reason why the event can't be transferred is, 
that the SAXException class isn't supported by GWT, so it can't be compiled by 
GWT and can't be transferred to the GWT client side. Therefore it isn't an 
issue of GWTEventService.

Original comment by sven.strohschein@googlemail.com on 19 Oct 2010 at 8:20