Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync issue from local to server database. #30

Open
dhruvvarde opened this issue Nov 27, 2019 · 7 comments
Open

Sync issue from local to server database. #30

dhruvvarde opened this issue Nov 27, 2019 · 7 comments

Comments

@dhruvvarde
Copy link

dhruvvarde commented Nov 27, 2019

I have successfully sync the data and get all the data in the local SQLite database but when I add a new record in local and try to sync on the server at that time, the new data is not reflating in the server database. Its creating one .dat file and the data is present in it in XML format.

I am using ionic 4 to send the data on the server database.

So can you please help to solve this issue?

@dhruvvarde dhruvvarde changed the title Sync issue Sync issue from local to server database. Nov 27, 2019
@sqlite-sync
Copy link
Owner

sqlite-sync commented Dec 2, 2019 via email

@dhruvvarde
Copy link
Author

dhruvvarde commented Dec 2, 2019

I have sent the sync request to the server like this :

This is my server URL : http://192.168.1.15:8086/amplisync-testnew/API3/Send

Request is :
{"content":"<SyncData xmlns="urn:sync-schema"><tab n="MergeIdentity"></ins></Id></TableId></SubscriberId></Rev></IdentityStart></IdentityEnd></IdentityCurrent></RowId></r></upd></tab><tab n="MergeSubscribers"></ins></upd></tab><tab n="Users"></ins></upd></tab><tab n="Documents"></docId></docName></RowId></r></ins></upd></tab><tab n="UserDocuments"></ins></upd></tab><tab n="Test"></ins></upd></tab></delete></SyncData>","subscriber":"ffffffff-9aaa-6f72-ffff-ffff99d603a9","version":"3"}

Error :

<!doctype html><title>HTTP Status 500 – Internal Server Error</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style>

HTTP Status 500 – Internal Server Error


Type Exception Report

Message java.lang.NullPointerException

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: java.lang.NullPointerException
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:352)
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:171)

Root Cause

java.lang.NullPointerException
java.text.SimpleDateFormat.<init>(Unknown Source)
java.text.SimpleDateFormat.<init>(Unknown Source)
SQLiteSyncCore.SyncServer.Synchronization.SyncService.ParseStatmentParameter(SyncService.java:1315)
SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushUpdateRecords(SyncService.java:1165)
SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushTableData(SyncService.java:1015)
SQLiteSyncCore.SyncServer.Synchronization.SyncService.CommitChangesToDb(SyncService.java:933)
SQLiteSyncCore.SyncServer.Synchronization.SyncService.ReceiveData(SyncService.java:848)
com.sqlitesync.ws.SyncAPI3.RecieveChanges(SyncAPI3.java:91)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143)
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
org.glassfish.jersey.internal.Errors.process(Errors.java:315)
org.glassfish.jersey.internal.Errors.process(Errors.java:297)
org.glassfish.jersey.internal.Errors.process(Errors.java:267)
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:352)
org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:171)

Note The full stack trace of the root cause is available in the server logs.


Apache Tomcat/9.0.27

@swaytz
Copy link

swaytz commented Dec 2, 2019

I face the same error when using the android client. Server to sqlite synchronization works fine but the sqlite to server synchronization throws a similar exception.

02-Dec-2019 14:28:33.412 SEVERE [http-nio-8080-exec-9] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [sqlite-sync-serlvet] in context with path [/SqliteSync] threw exception [java.lang.NullPointerException] with root cause java.lang.NullPointerException at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:598) at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:580) at SQLiteSyncCore.SyncServer.Synchronization.SyncService.ParseStatmentParameter(SyncService.java:1315) at SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushInsertRecords(SyncService.java:1070) at SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushTableData(SyncService.java:1009) at SQLiteSyncCore.SyncServer.Synchronization.SyncService.CommitChangesToDb(SyncService.java:933) at SQLiteSyncCore.SyncServer.Synchronization.SyncService.ReceiveData(SyncService.java:848) at com.sqlitesync.ws.SyncAPI3.RecieveChanges(SyncAPI3.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:651) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:501) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

@IchoTolot
Copy link

Do you set TIMESTAMP_FORMAT?

@swaytz
Copy link

swaytz commented Jan 13, 2020

I have followed the documentation and the properties files has the following contents. Is there any other place to set the TIMESTAMP_FORMAT?

DB_ENGINE = mysql
DBURL = jdbc:mysql://localhost:3306/amplisync?rewriteBatchedStatements=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
DBUSER = ****
DBPASS = ****
DBDRIVER = com.mysql.cj.jdbc.Driver
DATE_FORMAT = yyyy-MM-dd HH:mm:ss
HISTORY_DAYS = 7
LOG_LEVEL = 4

@sqlite-sync
Copy link
Owner

sqlite-sync commented Jan 13, 2020 via email

@swaytz
Copy link

swaytz commented Jan 13, 2020

Thank you very much.Adding the timestamp solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants