Face Detection and Facial Features

FREEMIUM
Verified
Por Imagevision | Atualizado a year ago | Machine Learning
Popularidade

8.8 / 10

Latência

2,723ms

Nível de serviço

98%

Voltar para todas as discussões

Your PHP Version of the API is Broken

D
dan.bezdek
7 years ago

Hi,

I can easily use the curl and Java version of the API, but the PHP version is broken. When I try to use the PHP version, I keep getting the following in the browser:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 42 path .nullcom.google.gson.Gson.fromJson(Gson.java:820)com.google.gson.Gson.fromJson(Gson.java:770)com.google.gson.Gson.fromJson(Gson.java:719)com.google.gson.Gson.fromJson(Gson.java:691)com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501)com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60)sun.reflect.GeneratedMethodAccessor177.invoke(UnknownSource)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)java.lang.reflect.Method.invoke(Method.java:622)com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider.null com.google.gson.Gson.fromJson(Gson.java:820) com.google.gson.Gson.fromJson(Gson.java:770) com.google.gson.Gson.fromJson(Gson.java:719) com.google.gson.Gson.fromJson(Gson.java:691) com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501) com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60) sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:622) com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProviderTypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:168)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 42 path .nullcom.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572)com.google.gson.stream.JsonReader.doPeek(JsonReader.java:493)com.google.gson.stream.JsonReader.hasNext(JsonReader.java:416)com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.null com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572) com.google.gson.stream.JsonReader.doPeek(JsonReader.java:493) com.google.gson.stream.JsonReader.hasNext(JsonReader.java:416) com.google.gson.internal.bind.ReflectiveTypeAdapterFactoryAdapter.read(ReflectiveTypeAdapterFactory.java:177)
com.google.gson.Gson.fromJson(Gson.java:805)
com.google.gson.Gson.fromJson(Gson.java:770)
com.google.gson.Gson.fromJson(Gson.java:719)
com.google.gson.Gson.fromJson(Gson.java:691)
com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501)
com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60)
sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:622)
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:168)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
Apache Tomcat/6.0.24
" [“body”]=> string(5812) "
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 42 path .nullcom.google.gson.Gson.fromJson(Gson.java:820)com.google.gson.Gson.fromJson(Gson.java:770)com.google.gson.Gson.fromJson(Gson.java:719)com.google.gson.Gson.fromJson(Gson.java:691)com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501)com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60)sun.reflect.GeneratedMethodAccessor177.invoke(UnknownSource)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)java.lang.reflect.Method.invoke(Method.java:622)com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider.null com.google.gson.Gson.fromJson(Gson.java:820) com.google.gson.Gson.fromJson(Gson.java:770) com.google.gson.Gson.fromJson(Gson.java:719) com.google.gson.Gson.fromJson(Gson.java:691) com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501) com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60) sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:622) com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProviderTypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:168)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

com.google.gson.stream.MalformedJsonException: Unterminated object at line 2 column 42 path .nullcom.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572)com.google.gson.stream.JsonReader.doPeek(JsonReader.java:493)com.google.gson.stream.JsonReader.hasNext(JsonReader.java:416)com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.null com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1572) com.google.gson.stream.JsonReader.doPeek(JsonReader.java:493) com.google.gson.stream.JsonReader.hasNext(JsonReader.java:416) com.google.gson.internal.bind.ReflectiveTypeAdapterFactoryAdapter.read(ReflectiveTypeAdapterFactory.java:177)
com.google.gson.Gson.fromJson(Gson.java:805)
com.google.gson.Gson.fromJson(Gson.java:770)
com.google.gson.Gson.fromJson(Gson.java:719)
com.google.gson.Gson.fromJson(Gson.java:691)
com.imagevisionlabs.ivl.ws.ScanUtils.getIvlFromFormParameterMap(ScanUtils.java:501)
com.imagevisionlabs.ivl.fs.FaceSearchResource.detectFaces(FaceSearchResource.java:60)
sun.reflect.GeneratedMethodAccessor177.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:622)
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:168)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1357)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1289)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1239)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:420)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:497)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:684)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
Apache Tomcat/6.0.24

avatar
eyerecognize commented 7 years ago

Please send the PHP code you are using so we can help you debug.

Junte-se à discussão - adicione o comentário abaixo:

Efetue login / inscreva-se para postar novos comentários
Avaliação: 1 - Votos: 1