[
https://issues.apache.org/jira/browse/UNOMI-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16169528#comment-16169528
]
Damon Henry commented on UNOMI-123:
-----------------------------------
Thanks Serge. Setting the timeStamp worked.
I need to create profiles and events from banner ads displayed on 3rd party
websites as well as track ad clicks via redirects. Calling context.json from
banner ads on 3rd party websites creates a new profileId when the unomi cookie
exists. A custom 1x1 image pixel service is fired when an ad is displayed and a
custom service is called to perform ad click redirects.
I need to look for the unomi cookie and, if it exists, create a session (and ad
view event) using the existing profileId found in the cookie. I believe I can
call context.json to create the unomi cookie if the cookie doesn't exists.
I trying to essentially track a user across a network of websites.
> Creating Session with Rest API - NullPointerException
> ------------------------------------------------------
>
> Key: UNOMI-123
> URL: https://issues.apache.org/jira/browse/UNOMI-123
> Project: Apache Unomi
> Issue Type: Bug
> Affects Versions: 1.2.0-incubating
> Reporter: Damon Henry
>
> I get a NullPointerException when attempting to create a new session with the
> rest API (POST /profiles/sessions/{sessionId}/). The error appears to be
> caused by the lastEventDate attribute being deserialized into a
> java.util.Date object. Has anyone experienced this?
> {code:java}
> {
> "properties": {
> "operatingSystemFamily": "Linux"
> },
> "profile": {
> "segments": [],
> "properties": {
> "firstVisit": "2017-09-16T00:53:30Z",
> "lastVisit": "2017-09-16T00:53:30Z",
> "nbOfVisits": 1
> },
> "scores": {},
> "mergedWith": null,
> "itemType": "profile",
> "itemId": "5a38dc82-4c4b-4f05-82a7-f4cc957d7bc7",
> "systemProperties": {}
> },
> "scope": "bjc_display",
> "lastEventDate": "2017-09-16T12:05:14Z",
> "size": 0,
> "itemType": "session",
> "itemId": "cfba7cd0-507b-4664-9477-ce458d7b8168",
> "systemProperties": {}
> }
> {code}
> {noformat}
> 2017-09-16 16:14:49,913 | WARN | tp1037045670-534 |
> WebApplicationExceptionMapper | 140 - org.apache.cxf.cxf-rt-frontend-jaxrs
> - 3.0.2 | javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server
> Error
> at
> org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79)
> at
> org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:101)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.convertExceptionToResponseIfPossible(JAXRSInInterceptor.java:226)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:215)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
> at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:427)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
> at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:984)
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1045)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:236)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
> at java.lang.Thread.run(Thread.java:748)
> Caused by: com.fasterxml.jackson.databind.JsonMappingException: N/A (through
> reference chain: org.apache.unomi.api.Session["lastEventDate"])
> at
> com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:564)
> at
> com.fasterxml.jackson.databind.deser.SettableBeanProperty._throwAsIOE(SettableBeanProperty.java:548)
> at
> com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:99)
> at
> com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:258)
> at
> com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:125)
> at
> com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1470)
> at
> com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:912)
> at
> com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:811)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1322)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1273)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:812)
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:775)
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:212)
> ... 38 more
> Caused by: java.lang.NullPointerException
> at org.apache.unomi.api.Session.setLastEventDate(Session.java:189)
> at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:97)
> ... 48 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)