0 Replies Latest reply on Jul 17, 2015 12:02 AM by ramchand_gururajan

    Reg: Custom Webservice in Jive 7.0.1 & 7.0.2

    ramchand_gururajan

      Hi Fellow Developers ,

                We require one help with one webservice . We have created one custom webservice & found it working correctly & serving the expected functionality but unfortunately its breaking one important feature of jive . Mobility for android .

        

          Webservice we created :

             <jaxrs:server id="globalLicenseService" address="/GlobalLicenseWebservice" bus="rpcCxfBus">
                   <jaxrs:serviceBeans>
                       <ref bean="globalLicenseServiceImpl"/>
                   </jaxrs:serviceBeans>
                   <jaxrs:providers>
                       <ref bean="apiSecureJacksonJsonProvider"/>
                   </jaxrs:providers>
        </jaxrs:server>
      

       

      This is working fine & service deployed in below path {protocol}://{servername}/rpc/GlobalLicenseWebservice/getGlobalLicenses .

       

      But we are getting below issue when we try to access the instance in android app.

       

      Access logs:
      10.181.96.143 - - [15/Jul/2015:13:16:51 -0500] "GET /api/version HTTP/1.1" 200 305 0 0 "-" "jive-android-core" "application/json" -
      10.181.96.143 - - [15/Jul/2015:13:16:51 -0500] "GET /api/core/v3/metadata/properties/public HTTP/1.1" 200 189 0 1 "-" "jive-android-core" "application/json" -
      10.181.96.143 - - [15/Jul/2015:13:16:51 -0500] "GET /api/addons/ede79b6c-50d1-4c57-adf1-4ee2c94234ce/session-grant-allowed HTTP/1.1" 500 161 0 1 "-" "jive-android-core" "application/json" –
      
      
      App Logs: 
      2015-07-15 13:16:51,761 [http-nio-10.181.19.187-9011-exec-15] [523d473cprfONI72u3nvHlpdY367p92Y:ANONYMOUS:REGULAR] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://impl.addons.community.jivesoftware.com/}AddonApiServiceImpl has thrown exception, unwinding now
      javax.ws.rs.InternalServerErrorException: java.lang.NullPointerException
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:385)
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:305)
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:154)
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:85)
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
              at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:77)
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
              at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:203)
              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
              at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at com.jivesoftware.community.web.filter.NoCacheDevModeFilter.doFilterInternal(NoCacheDevModeFilter.java:39)
             at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)
              at com.jivesoftware.community.web.struts.JiveFilterDispatcher.doFilter(JiveFilterDispatcher.java:108)
              at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
              at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
              at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
              at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
              at com.jivesoftware.community.web.filter.ActivityRequestFilter.doFilter(ActivityRequestFilter.java:100)
      
      
      Caused by: java.lang.NullPointerException
              at org.apache.cxf.jaxrs.impl.tl.ThreadLocalRequest.getMethod(ThreadLocalRequest.java:50)
              at com.jivesoftware.community.webservices.rest.SecureJiveJacksonJSONProvider.writeTo(SecureJiveJacksonJSONProvider.java:33)
              at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1326)
              at org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:282)
              ... 152 more
      

       

      After debugging we found that addonservice is breaking . The addon service was following the below definition.

       

          <jaxrs:server id="addonsApiService"  address="/addons">
              <jaxrs:serviceBeans>
                  <bean class="com.jivesoftware.community.addons.impl.AddonApiServiceImpl">
                      <property name="authenticationProvider" ref="authenticationProvider"/>
                      <property name="checkForExtensionUpdatesRunnable" ref="checkForExtensionUpdatesRunnable"/>
                      <property name="extensionManager" ref="extensionManager"/>
                      <property name="extensionAlertManager" ref="extensionAlertManager"/>
                      <property name="taskEngine" ref="taskEngine"/>
                  </bean>
              </jaxrs:serviceBeans>
              <jaxrs:providers>
                  <ref bean="secureJacksonJsonProvider"/>
              </jaxrs:providers>
          </jaxrs:server>
      

       

      So resolve this issue we replaced apiSecureJacksonJsonProvider in our definition to secureJacksonJsonProvider , the android issue got resolved but this opened upon other issues in application not loading of create menus in desktop.

       

      It would be great if some one can assign with any of the below

       

      1) Which would be best Json provider to be use in Jive so that all the contents work without issue?

      2) When should be secureJacksonJsonProvider , apiSecureJacksonJsonProvider be used . Should there be changes in webservie definitions accordingly.

      3) Any sample for all the webservice definition / providers of Jive.

       

       

      regards,

      Ramchand

       

      Ravi shakar Durga krishna Murthy , Pradeep Kumar