title: Error in generating access token
body: <p>I have been able to generate access tokens without any issue so far, but now suddenly, I am getting an error while generating access token. I was trying to change an api in the publisher which has been subscribed. 
  The stack trace says:</p>
  
  <pre><code>ERROR - RPCMessageReceiver Error in getting new access
  Token
  java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.jav
  a:212)
          at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic
  (RPCMessageReceiver.java:117)
          at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusines
  sLogic(AbstractInOutMessageReceiver.java:40)
          at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe
  ssageReceiver.java:110)
          at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
          at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
  uest(HTTPTransportUtils.java:172)
          at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
  46)
          at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.ja
  va:231)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service
  (ServletRegistration.java:61)
          at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(P
  roxyServlet.java:128)
          at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyS
  ervlet.java:68)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
          at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(Delegati
  onServlet.java:68)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  icationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  ilterChain.java:210)
          at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(Charact
  erSetFilter.java:61)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  icationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  ilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  alve.java:222)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  alve.java:123)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
  torBase.java:472)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
  ava:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
  ava:99)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(C
  ompositeValve.java:178)
          at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTo
  mcatValve.java:47)
          at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoa
  derValve.java:56)
          at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(T
  omcatValveContainer.java:47)
          at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValv
  e.java:141)
          at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.inv
  oke(CarbonStuckThreadDetectionValve.java:156)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
  936)
          at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(Ca
  rbonContextCreatorValve.java:52)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
  ve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
  a:407)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
  11Processor.java:1004)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
  AbstractProtocol.java:589)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoin
  t.java:1653)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
  java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
  .java:615)
          at java.lang.Thread.run(Thread.java:745)
  Caused by: org.wso2.carbon.apimgt.keymgt.APIKeyMgtException: Error in getting ne
  w accessToken
          at org.wso2.carbon.apimgt.keymgt.service.APIKeyMgtSubscriberService.rene
  wAccessToken(APIKeyMgtSubscriberService.java:281)
          ... 45 more
  Caused by: java.lang.RuntimeException: Failed : HTTP error code : 302
          at org.wso2.carbon.apimgt.keymgt.service.APIKeyMgtSubscriberService.rene
  wAccessToken(APIKeyMgtSubscriberService.java:252)
          ... 45 more
  </code></pre>