diff --git a/back/pom.xml b/back/pom.xml index b1c3a32..336ea5d 100644 --- a/back/pom.xml +++ b/back/pom.xml @@ -26,7 +26,7 @@ kangaroo-and-rabbit archidata - 0.1.3 + 0.3.1 diff --git a/back/src/org/kar/karideo/WebLauncher.java b/back/src/org/kar/karideo/WebLauncher.java index 7bd983b..385e611 100755 --- a/back/src/org/kar/karideo/WebLauncher.java +++ b/back/src/org/kar/karideo/WebLauncher.java @@ -14,6 +14,10 @@ import org.kar.archidata.GlobalConfiguration; import org.kar.archidata.SqlWrapper; import org.kar.archidata.UpdateJwtPublicKey; import org.kar.archidata.api.DataResource; +import org.kar.archidata.catcher.ExceptionCatcher; +import org.kar.archidata.catcher.FailExceptionCatcher; +import org.kar.archidata.catcher.InputExceptionCatcher; +import org.kar.archidata.catcher.SystemExceptionCatcher; import org.kar.archidata.db.DBConfig; import org.kar.archidata.filter.AuthenticationFilter; import org.kar.archidata.filter.CORSFilter; @@ -65,6 +69,11 @@ public class WebLauncher { rc.register(new CORSFilter()); // global authentication system rc.registerClasses(AuthenticationFilter.class); + // register exception catcher + rc.register(InputExceptionCatcher.class); + rc.register(SystemExceptionCatcher.class); + rc.register(FailExceptionCatcher.class); + rc.register(ExceptionCatcher.class); // add default resource: rc.registerClasses(UserResource.class); rc.registerClasses(SeriesResource.class); diff --git a/back/src/org/kar/karideo/model/Media.java b/back/src/org/kar/karideo/model/Media.java index 2f2e00a..31b0102 100644 --- a/back/src/org/kar/karideo/model/Media.java +++ b/back/src/org/kar/karideo/model/Media.java @@ -10,12 +10,12 @@ import org.kar.archidata.annotation.SQLTableLinkGeneric; import org.kar.archidata.annotation.SQLTableName; import org.kar.archidata.model.GenericTable; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonInclude; @SQLTableName ("media") @SQLIfNotExists -@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Media extends GenericTable { @SQLNotNull @SQLComment("Name of the media (this represent the title)") diff --git a/back/src/org/kar/karideo/model/Season.java b/back/src/org/kar/karideo/model/Season.java index e57b628..14225ab 100644 --- a/back/src/org/kar/karideo/model/Season.java +++ b/back/src/org/kar/karideo/model/Season.java @@ -10,12 +10,12 @@ import org.kar.archidata.annotation.SQLTableLinkGeneric; import org.kar.archidata.annotation.SQLTableName; import org.kar.archidata.model.GenericTable; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonInclude; @SQLTableName ("season") @SQLIfNotExists -@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Season extends GenericTable { @SQLNotNull @SQLComment("Name of the media (this represent the title)") diff --git a/back/src/org/kar/karideo/model/Series.java b/back/src/org/kar/karideo/model/Series.java index 5f19b25..05956ec 100644 --- a/back/src/org/kar/karideo/model/Series.java +++ b/back/src/org/kar/karideo/model/Series.java @@ -10,12 +10,12 @@ import org.kar.archidata.annotation.SQLTableLinkGeneric; import org.kar.archidata.annotation.SQLTableName; import org.kar.archidata.model.GenericTable; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonInclude; @SQLTableName ("series") @SQLIfNotExists -@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Series extends GenericTable { @SQLNotNull @SQLComment("Name of the media (this represent the title)") diff --git a/back/src/org/kar/karideo/model/Type.java b/back/src/org/kar/karideo/model/Type.java index 824331c..3d3c3e7 100644 --- a/back/src/org/kar/karideo/model/Type.java +++ b/back/src/org/kar/karideo/model/Type.java @@ -3,19 +3,18 @@ package org.kar.karideo.model; import java.util.List; import org.kar.archidata.annotation.SQLComment; -import org.kar.archidata.annotation.SQLForeignKey; import org.kar.archidata.annotation.SQLIfNotExists; import org.kar.archidata.annotation.SQLNotNull; import org.kar.archidata.annotation.SQLTableLinkGeneric; import org.kar.archidata.annotation.SQLTableName; import org.kar.archidata.model.GenericTable; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonInclude; @SQLTableName ("type") @SQLIfNotExists -@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class Type extends GenericTable { @SQLNotNull @SQLComment("Name of the media (this represent the title)") diff --git a/back/src/org/kar/karideo/model/UserKarideo.java b/back/src/org/kar/karideo/model/UserKarideo.java index 551834e..739e6a9 100644 --- a/back/src/org/kar/karideo/model/UserKarideo.java +++ b/back/src/org/kar/karideo/model/UserKarideo.java @@ -4,11 +4,11 @@ import org.kar.archidata.annotation.SQLIfNotExists; import org.kar.archidata.annotation.SQLTableName; import org.kar.archidata.model.User; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.annotation.JsonInclude; @SQLTableName ("user") @SQLIfNotExists -@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) +@JsonInclude(JsonInclude.Include.NON_NULL) public class UserKarideo extends User { }