Re: Endless loop when iterating results in SDK - workaround

Follow

Originally posted by fi-ware on 2012-04-17 14:38:29

This workaround is not working any more.
When updated to Cumulocity 0.14, I get the following exception:

Apr 17, 2012 2:35:38 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
org.svenson.JSONParseException: Cannot set property SensorType on class com.cumulocity.model.environmental.sensor.TemperatureSensor
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:589)
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:617)
	at org.svenson.JSONParser.parseArrayInto(JSONParser.java:490)
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:640)
	at org.svenson.JSONParser.parse(JSONParser.java:396)
	at org.svenson.JSONParser.parse(JSONParser.java:341)
	at com.cumulocity.rest.providers.CumulocityJSONMessageBodyReader.readFrom(CumulocityJSONMessageBodyReader.java:33)
	at com.cumulocity.rest.providers.CumulocityJSONMessageBodyReader.readFrom(CumulocityJSONMessageBodyReader.java:19)
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:553)
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:506)
	at com.cumulocity.sdk.client.ResponseParser.parse(ResponseParser.java:13)
	at com.cumulocity.sdk.client.RestConnector.get(RestConnector.java:40)
	at com.cumulocity.sdk.client.PagedCollectionResourceImpl.get(PagedCollectionResourceImpl.java:79)
	at com.cumulocity.sdk.client.PagedCollectionResourceImpl.get(PagedCollectionResourceImpl.java:12)
	at com.nsn.fiware.ngsi.connector.CumulocityConnector.getManagedObjectRepresentationByName(CumulocityConnector.java:74)
	at com.nsn.fiware.ngsi.connector.CumulocityConnector.getContextElementById(CumulocityConnector.java:315)
	at com.nsn.fiware.ngsi10.resources.ContextElementResource.getContextElementResponse(ContextElementResource.java:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:481)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
	at org.eclipse.jetty.server.Server.handle(Server.java:349)
	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
	at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
	at java.lang.Thread.run(Unknown Source)

14:36:33.078 [qtp1761432742-26] WARN  o.e.jetty.servlet.ServletHandler - /ngsi/contextEntities/CG2
org.svenson.JSONParseException: Cannot set property SensorType on class com.cumulocity.model.environmental.sensor.TemperatureSensor
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:589) ~[na:na]
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:617) ~[na:na]
	at org.svenson.JSONParser.parseArrayInto(JSONParser.java:490) ~[na:na]
	at org.svenson.JSONParser.parseObjectInto(JSONParser.java:640) ~[na:na]
	at org.svenson.JSONParser.parse(JSONParser.java:396) ~[na:na]
	at org.svenson.JSONParser.parse(JSONParser.java:341) ~[na:na]
	at com.cumulocity.rest.providers.CumulocityJSONMessageBodyReader.readFrom(CumulocityJSONMessageBodyReader.java:33) ~[na:na]
	at com.cumulocity.rest.providers.CumulocityJSONMessageBodyReader.readFrom(CumulocityJSONMessageBodyReader.java:19) ~[na:na]
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:553) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:506) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.cumulocity.sdk.client.ResponseParser.parse(ResponseParser.java:13) ~[com.nsn.cumulocity.platform-services.sdk.java-client-lib_0.14.0.jar:na]
	at com.cumulocity.sdk.client.RestConnector.get(RestConnector.java:40) ~[com.nsn.cumulocity.platform-services.sdk.java-client-lib_0.14.0.jar:na]
	at com.cumulocity.sdk.client.PagedCollectionResourceImpl.get(PagedCollectionResourceImpl.java:79) ~[com.nsn.cumulocity.platform-services.sdk.java-client-lib_0.14.0.jar:na]
	at com.cumulocity.sdk.client.PagedCollectionResourceImpl.get(PagedCollectionResourceImpl.java:12) ~[com.nsn.cumulocity.platform-services.sdk.java-client-lib_0.14.0.jar:na]
	at com.nsn.fiware.ngsi.connector.CumulocityConnector.getManagedObjectRepresentationByName(CumulocityConnector.java:74) ~[ngsi.restfulbinding/:na]
	at com.nsn.fiware.ngsi.connector.CumulocityConnector.getContextElementById(CumulocityConnector.java:315) ~[ngsi.restfulbinding/:na]
	at com.nsn.fiware.ngsi10.resources.ContextElementResource.getContextElementResponse(ContextElementResource.java:45) ~[ngsi.interface/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0]
	at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:708) ~[jersey-bundle-1.9.1.jar:1.9.1]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ~[javax.servlet_2.5.0.v201103041518.jar:na]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:547) ~[na:na]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:481) [org.eclipse.jetty.servlet_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520) [org.eclipse.jetty.security_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409) [org.eclipse.jetty.servlet_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.Server.handle(Server.java:349) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565) [org.eclipse.jetty.http_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) [org.eclipse.jetty.http_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46) [org.eclipse.jetty.server_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545) [org.eclipse.jetty.io_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43) [org.eclipse.jetty.io_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) [org.eclipse.jetty.util_7.5.1.v20110908.jar:7.5.1.v20110908]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533) [org.eclipse.jetty.util_7.5.1.v20110908.jar:7.5.1.v20110908]
	at java.lang.Thread.run(Unknown Source) [na:1.7.0]
Have more questions? Submit a request

Comments