sqlite-sync / SQLite-sync.com

AMPLI-SYNC is a framework for synchronizing data between a Sqlite database and an MS SQL/MySQL/Oracle/PostgreSQL database. With this framework your application can work completely offline (Airplane Mode), then perform an automated Bidirectional Synchronization when an internet connection becomes available.
https://ampliapps.com/sqlite-sync/
BSD 3-Clause "New" or "Revised" License
331 stars 82 forks source link

Getting Internal Server Error from service, when updating from client to server #17

Open SonalJP opened 5 years ago

SonalJP commented 5 years ago

This is my request body, when I call send method, It gives me a internal server error

Request: { "subscriber": "1", "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?><SyncData xmlns=\"urn:sync-schema\"><tab n=\"MergeIdentity\"><tab n=\"reportsnew\"><![CDATA[56]]><![CDATA[11-10-2019 17:35:34]]><![CDATA[1234567890]]><![CDATA[Paid]]><![CDATA[vrgvr]]><![CDATA[20]]><![CDATA[20]]><![CDATA[40]]><![CDATA[50]]><![CDATA[60]]><![CDATA[Cash]]><![CDATA[7b399d9b-ec1f-11e9-9190-3863bba566eb]]>", "version": "3" }

Response: <!doctype html>

HTTP Status 500 – Internal Server Error

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:52)

Root Cause

java.lang.NullPointerException
    java.text.SimpleDateFormat.<init>(Unknown Source)
    java.text.SimpleDateFormat.<init>(Unknown Source)
    SQLiteSyncCore.SyncServer.Synchronization.SyncService.ParseStatmentParameter(SyncService.java:1307)
    SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushUpdateRecords(SyncService.java:1157)
    SQLiteSyncCore.SyncServer.Synchronization.SyncService.PushTableData(SyncService.java:1007)
    SQLiteSyncCore.SyncServer.Synchronization.SyncService.CommitChangesToDb(SyncService.java:978)
    SQLiteSyncCore.SyncServer.Synchronization.SyncService.ReceiveData(SyncService.java:840)
    com.sqlitesync.ws.SyncAPI3.RecieveChanges(SyncAPI3.java:91)
    sun.reflect.GeneratedMethodAccessor40.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:52)

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


Apache Tomcat/8.5.46

IchoTolot commented 5 years ago

Adding: TIMESTAMP_FORMAT = YYYY-MM-dd HH:mm:ss to sync.properties helped here