synchronizer broken when mobilebean property have some special spanish character

37 views
Skip to the first unread message

Alcides Nolasco

unread,
14 Mar 2013, 19:01:2114/03/2013
to openmobs...@googlegroups.com
syncronizacion stops when mobilebean property have some special spanish character with error: failed Invalid byte 2 of 3-byte UTF-8 sequence.


1. my MobileBean TCliente :


public class TCliente implements MobileBean, Serializable {
private static final long serialVersionUID = -13825574505549274L;
@Id
@Column(name="cli_id")
private String cliId;
@Column(name="cta_id")
private String ctaId;
@Column(name="ciu_id")
private Integer ciuId;
@Column(name="pai_id")
private Integer paiId;
@Column(name="dep_id")
private Integer depId;
@Column(name="cli_nombre")
private String cliNombre;
@Column(name="cli_apellido")
private String cliApellido;
....


2 .when the property cliNombre have special Spanish character like " Ñ, ñ ", the sync proceses stop

3. the first 25 record sync fine in  bootup proces.


what is wrong ?



4. Error Log 

[Fatal Error] :49:12: Invalid byte 2 of 3-byte UTF-8 sequence.
ERROR - class org.openmobster.core.synchronizer.server.workflow.Utilities
java.lang.RuntimeException: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
at org.openmobster.core.common.XMLUtilities.parse(XMLUtilities.java:83)
at org.openmobster.core.synchronizer.server.engine.MobileObjectGateway.parseId(MobileObjectGateway.java:110)
at org.openmobster.core.synchronizer.server.engine.ServerSyncEngineImpl.clearChangeLogEntry(ServerSyncEngineImpl.java:685)
at org.openmobster.core.synchronizer.server.workflow.Utilities.cleanupChangeLog(Utilities.java:235)
at org.openmobster.core.synchronizer.server.workflow.EnterClose.execute(EnterClose.java:47)
at org.jbpm.graph.def.Action.execute(Action.java:129)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:284)
at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:241)
at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:213)
at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:196)
at org.jbpm.graph.def.Node.enter(Node.java:371)
at org.jbpm.graph.def.Transition.take(Transition.java:167)
at org.jbpm.graph.def.Node.leave(Node.java:479)
at org.jbpm.graph.exe.ExecutionContext.leaveNode(ExecutionContext.java:155)
at org.jbpm.graph.node.Decision.execute(Decision.java:194)
at org.jbpm.graph.def.Node.enter(Node.java:390)
at org.jbpm.graph.def.Transition.take(Transition.java:167)
at org.jbpm.graph.def.Node.leave(Node.java:479)
at org.jbpm.graph.exe.Token.signal(Token.java:223)
at org.jbpm.graph.exe.Token.signal(Token.java:150)
at org.openmobster.core.synchronizer.server.SyncJBPMServerAdapter.process(SyncJBPMServerAdapter.java:219)
at org.openmobster.core.synchronizer.server.SyncJBPMServerAdapter.service(SyncJBPMServerAdapter.java:154)
at org.openmobster.core.dataService.processor.SyncProcessor.process(SyncProcessor.java:84)
at org.openmobster.core.dataService.server.ProcessorController.processMessage(ProcessorController.java:89)
at org.openmobster.core.dataService.server.ProcessorController.execute(ProcessorController.java:47)
at org.openmobster.core.dataService.server.ServerHandler.messageReceived(ServerHandler.java:110)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.openmobster.core.dataService.server.AuthenticationFilter.messageReceived(AuthenticationFilter.java:81)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.openmobster.core.dataService.server.TransactionFilter.messageReceived(TransactionFilter.java:37)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.openmobster.core.dataService.server.RequestConstructionFilter.messageReceived(RequestConstructionFilter.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.openmobster.core.dataService.server.PayloadFilter.messageReceived(PayloadFilter.java:52)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
at java.lang.Thread.run(Thread.java:680)
Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at org.openmobster.core.common.XMLUtilities.parse(XMLUtilities.java:77)
... 51 more
Caused by: org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.
at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
... 55 more
DEBUG - Sending------------------------------------------------------------------------
DEBUG - <SyncML>

Sohil Shah

unread,
14 Mar 2013, 21:59:2114/03/2013
to openmobs...@googlegroups.com
Hi Alcides,

I am a bit stumped. I thought it was an encoding issue in the data service. But I checked and made sure the String that emerges from the incoming bytes is UTF-8 encoded. So the special character which is part of UTF-8 is supported just fine.

Now I am not really sure why this string when put through the XML engine, breaks down as if its not UTF-8 encoded.

There are a couple of things I can think of can be done.

* Make sure the device side is UTF-8 encoding by default
* Maybe send a  -Dfile.encoding=UTF-8 to the JVM on startup

* What OS are you running the server on?

Maybe try on another OS and see if you get the same issue.

Sorry I don't have a definite answer. We will have to do some trial and error to get to the bottom of this issue.

Thanks for reporting
Sohil 

--
You received this message because you are subscribed to the Google Groups "OpenMobster Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmobster-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sohil Shah

unread,
14 Mar 2013, 23:29:0814/03/2013
to openmobs...@googlegroups.com
ok looks like I this might work. I have tested this in my unit test and will need to see if this works for you.

You have to run the JVM with a default encoding of UTF-8. To do this whatever mechanism you are using to start your JVM, you must pass the following as an argument:

-Dfile.encoding=UTF-8

This will treat all Strings as UTF-8 encoded which includes the Spanish characters you are looking to process.

Let me know how things go.

Thanks

Sohil

Alcides Nolasco

unread,
14 Mar 2013, 23:34:4214/03/2013
to openmobs...@googlegroups.com
I using MAC OS 10.7.5  with english locale,  i am starting my server with command : #mvn -PrunCloud integration-test  how to add UTF-8 parameter ? 

Sohil Shah

unread,
14 Mar 2013, 23:49:4314/03/2013
to openmobs...@googlegroups.com
In your cloud/pom.xml do the following

Where the runCloud profile is replace this:

<configuration>

<mainClass>org.openmobster.dev.tools.server.RunCloudServer

</mainClass>

</configuration>


with

<configuration>

<mainClass>org.openmobster.dev.tools.server.RunCloudServer

</mainClass>

<arguments>

           <argument>-Dfile.encoding=UTF-8</argument>

</arguments>

</configuration>

Try this and see if this will work

Thanks
Sohil
--

Sohil Shah

unread,
15 Mar 2013, 00:13:3115/03/2013
to openmobs...@googlegroups.com
If that does not work, try adding -Dfile.encoding=UTF-8 to the MAVEN_OPTS environment variable. May be the JVM argument can be passed that way.

Thanks
Sohil
Reply all
Reply to author
Forward
0 new messages