Open onlyindreams opened 8 years ago
Hi Naoya,
we have found a problem in the ngsi.api Json specification regarding the notifyConditions. The latest commit in the GitHub addresses this problem allowing subscription to the Orion CB.
Please try again with the new commit Best Regards
Flavio
I have confirmed that the problem about notifyConditions was fixed but my subscriber application never receive the notify message from IoT Broker.
Please confirm following IoT Broker log.
2016-08-30 20:34:24 DEBUG ThrottlingTask:101 - SubscriptionId from TrottlingTask ---------------->67bEc-79cC9-c8c95-4F813-47897-29bE5521649836561fe
2016-08-30 20:34:24 DEBUG ThrottlingTask:107 - Trotthling task ID ---------------->67bEc-79cC9-c8c95-4F813-47897-29bE5521649836561fe
2016-08-30 20:34:24 DEBUG ThrottlingTask:111 - Terminating notification task as there are no notifications to send.
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 1 of 12 in additional filter chain; firing Filter: 'ChannelProcessingFilter'
2016-08-30 20:34:28 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/ngsi10/notify'; against '/admin*'2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2016-08-30 20:34:28 DEBUG HttpSessionSecurityContextRepository:127 - No HttpSession currently exists
2016-08-30 20:34:28 DEBUG HttpSessionSecurityContextRepository:85 - No SecurityContext was available from the HttpSession: null. A new one will be created.
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 3 of 12 in additional filter chain; firing Filter: 'ConcurrentSessionFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 4 of 12 in additional filter chain; firing Filter: 'LogoutFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 5 of 12 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 6 of 12 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2016-08-30 20:34:28 DEBUG AnonymousAuthenticationFilter:102 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6faad796: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffffa64e: RemoteIpAddress: 100.98.202.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2016-08-30 20:34:28 DEBUG FilterChainProxy:337 - /ngsi10/notify at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2016-08-30 20:34:28 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/ngsi10/notify'; against '/admin*'2016-08-30 20:34:28 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/ngsi10/notify'; against '/monitoring/**'
2016-08-30 20:34:28 DEBUG FilterSecurityInterceptor:185 - Public object - authentication not attempted
2016-08-30 20:34:28 DEBUG FilterChainProxy:323 - /ngsi10/notify reached end of additional filter chain; proceeding with original chain
2016-08-30 20:34:28 DEBUG DispatcherServlet:823 - DispatcherServlet with name 'spring' processing POST request for [/ngsi10/notify]
2016-08-30 20:34:28 DEBUG RequestMappingHandlerMapping:220 - Looking up handler method for path /ngsi10/notify
2016-08-30 20:34:28 DEBUG RequestMappingHandlerMapping:227 - Returning handler method [public org.springframework.http.ResponseEntity<eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextResponse> eu.neclab.iotplatform.iotbroker.restcontroller.RestProviderController.notifyContext(javax.servlet.http.HttpServletRequest,eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest)]
2016-08-30 20:34:28 DEBUG DefaultListableBeanFactory:246 - Returning cached instance of singleton bean 'RestProviderController'
2016-08-30 20:34:28 DEBUG RequestResponseBodyMethodProcessor:132 - Reading [class eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest] as "application/json;charset=utf-8" using [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter@3f71b8c]
2016-08-30 20:34:28 DEBUG ExceptionHandlerExceptionResolver:132 - Resolving exception from handler [public org.springframework.http.ResponseEntity<eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextResponse> eu.neclab.iotplatform.iotbroker.restcontroller.RestProviderController.notifyContext(javax.servlet.http.HttpServletRequest,eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"]); nested exception is org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"])
2016-08-30 20:34:28 DEBUG ResponseStatusExceptionResolver:132 - Resolving exception from handler [public org.springframework.http.ResponseEntity<eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextResponse> eu.neclab.iotplatform.iotbroker.restcontroller.RestProviderController.notifyContext(javax.servlet.http.HttpServletRequest,eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"]); nested exception is org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"])
2016-08-30 20:34:28 DEBUG DefaultHandlerExceptionResolver:132 - Resolving exception from handler [public org.springframework.http.ResponseEntity<eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextResponse> eu.neclab.iotplatform.iotbroker.restcontroller.RestProviderController.notifyContext(javax.servlet.http.HttpServletRequest,eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest)]: org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"]); nested exception is org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "type" (Class eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2b00fdab; line: 7, column: 19] (through reference chain: eu.neclab.iotplatform.ngsi.api.datamodel.NotifyContextRequest["contextResponses"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElementResponse["contextElement"]->eu.neclab.iotplatform.ngsi.api.datamodel.ContextElement["type"])
2016-08-30 20:34:28 DEBUG HttpSessionSecurityContextRepository:269 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
2016-08-30 20:34:28 DEBUG DispatcherServlet:999 - Null ModelAndView returned to DispatcherServlet with name 'spring': assuming HandlerAdapter completed request handling
2016-08-30 20:34:28 DEBUG DispatcherServlet:966 - Successfully completed request
2016-08-30 20:34:28 DEBUG ExceptionTranslationFilter:115 - Chain processed normally
2016-08-30 20:34:28 DEBUG SecurityContextPersistenceFilter:97 - SecurityContextHolder now cleared, as request processing completed
2016-08-30 20:34:28 DEBUG [localhost]:852 - Processing ErrorPage[errorCode=400, location=/WEB-INF/errors/400.html]
2016-08-30 20:34:28 DEBUG DispatcherServlet:823 - DispatcherServlet with name 'spring' processing POST request for [//WEB-INF/errors/400.html]
2016-08-30 20:34:28 DEBUG RequestMappingHandlerMapping:220 - Looking up handler method for path //WEB-INF/errors/400.html
2016-08-30 20:34:28 DEBUG RequestMappingHandlerMapping:230 - Did not find handler method for [//WEB-INF/errors/400.html]
2016-08-30 20:34:28 DEBUG SimpleUrlHandlerMapping:169 - Matching patterns for request [//WEB-INF/errors/400.html] are [/**]
2016-08-30 20:34:28 DEBUG SimpleUrlHandlerMapping:194 - URI Template variables for request [//WEB-INF/errors/400.html] are {}
2016-08-30 20:34:28 DEBUG SimpleUrlHandlerMapping:124 - Mapping [//WEB-INF/errors/400.html] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@596d9b69] and 1 interceptor
2016-08-30 20:34:28 DEBUG [default]:852 - Disabling the response for futher output
2016-08-30 20:34:28 DEBUG DispatcherServlet:999 - Null ModelAndView returned to DispatcherServlet with name 'spring': assuming HandlerAdapter completed request handling
2016-08-30 20:34:28 DEBUG DispatcherServlet:966 - Successfully completed request
2016-08-30 20:34:28 DEBUG [spring]:852 - Disabling the response for futher output
Does IoT Broker have any other problems?
Best Regards, Naoya
Hi, I'd like to issue a subscribeContext message to an Orion Context Broker via an IoT Broker but it has failed.
According to IoT Broker's output log, IoT Broker post a invalid json request :"notifyCondition" to Orion Context Broker. Orion can receive not "notifyCondition" but "notifyConditions".
I hope that IoT Broker will support to post subscribeContext to Orion Context Broker.
Best Regards, Naoya