Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-3941

Null pointer exception when user tries to create clientID without selecting scopes.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Apollo
    • Fix Version/s: Apollo
    • Component/s: API
    • Labels:
      None
    • Environment:

      aml-oauth-provider-1.0.0-20160107.162818-97.war
      qos-service-1.0.0-20160107.162847-36.war

    • Sprint:
      Sprint 9

      Description

      Null pointer exception when user tries to create clientID without selecting scopes.

      Steps:

      1.Login to Oauth UI
      2.Enter clientid and click Save without selecting scope

      Actual result:

      UI shows message, "There was problem processing your request..." and client id gets added.

      (Attached screenshot)

      Snippet Tomcat log:

      Address: http://localhost:9933/aml-oauth-provider/rest/client-management/Nullpointer01
      Encoding: UTF-8
      Http-Method: PUT
      Content-Type: application/json; charset=UTF-8
      Headers:

      {Accept=[application/json, text/javascript, */*; q=0.01], accept-encoding=[gzip, deflate], accept-language=[en-US,en;q=0.5], connection=[Keep-Alive], Content-Length=[79], content-type=[application/json; charset=UTF-8], cookie=[JSESSIONID=BF8B53291631D306F39812246B5EC5C4], host=[localhost:9933], referer=[http://localhost:9933/aml-oauth-provider/], user-agent=[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0], x-csrf-token=[8be2b834-2d6a-4be3-b61c-edf73b71a5eb], x-forwarded-host=[localhost:9933], x-forwarded-server=[2001:4800:7811:513:dd9d:596:ff04:a1a7], x-requested-with=[XMLHttpRequest]}

      Payload:

      {"clientId":"Nullpointer01","clientSecret":"","scopes":null,"refreshTokens":[]}

      --------------------------------------
      2016-01-11 14:42:13 WARN org.apache.cxf.phase.PhaseInterceptorChain:452 - tsa.amlproduct.qa@gmail.com REALM_qa2, ROLE_USER - Application

      {http://cxf.services.provider.oauth2.admaxlocal.com/}

      UserService has thrown exception, unwinding now
      org.apache.cxf.interceptor.Fault
      at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:163)
      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:129)
      at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:200)
      at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:99)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
      at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
      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:251)
      at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
      at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
      .
      ..
      .
      .
      Caused by: java.lang.NullPointerException
      at com.admaxlocal.oauth2.provider.dao.ClientIdDao.toCsv(ClientIdDao.java:37)
      at com.admaxlocal.oauth2.provider.dao.ClientIdDao.createClientId(ClientIdDao.java:27)
      at com.admaxlocal.oauth2.provider.services.cxf.ClientIdService.createClientId(ClientIdService.java:99)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
      at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
      ... 72 more

      Expected Result:

      Client id without scope shouldn't add in UI.

        Attachments

          Activity

            People

            • Assignee:
              sanjaykumar.biswal Sanjay Kumar Biswal
              Reporter:
              atul.sanagar Atul Sanagar (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: