java.lang.NullPointerException

Atlassian JIRA | Brendan Humphreys [Atlassian] | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Straightforward fix is to return {{null}} before attempting to create a {{UserLogin}} {code} java.lang.NullPointerException at com.cenqua.fisheye.user.UserLogin.<init>(UserLogin.java:18) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLoginImpl(DefaultUserManager.java:851) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:814) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:822) at sun.reflect.GeneratedMethodAccessor1193.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) at $Proxy30.createTrustedUserLogin(Unknown Source) at com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:17) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationFilterAuthenticator.authenticate(TrustedApplicationFilterAuthenticator.java:171) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:113) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:95) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502) {code}

    Atlassian JIRA | 3 years ago | Brendan Humphreys [Atlassian]
    java.lang.NullPointerException
  2. 0

    Straightforward fix is to return {{null}} before attempting to create a {{UserLogin}} {code} java.lang.NullPointerException at com.cenqua.fisheye.user.UserLogin.<init>(UserLogin.java:18) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLoginImpl(DefaultUserManager.java:851) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:814) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:822) at sun.reflect.GeneratedMethodAccessor1193.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) at $Proxy30.createTrustedUserLogin(Unknown Source) at com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:17) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationFilterAuthenticator.authenticate(TrustedApplicationFilterAuthenticator.java:171) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:113) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:95) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502) {code}

    Atlassian JIRA | 3 years ago | Brendan Humphreys [Atlassian]
    java.lang.NullPointerException
  3. 0

    [CRC-2681|https://support.atlassian.com/browse/CRC-2681] is an example of throwing a 500 when authentication fails for Trusted Apps (at least without auto-add enabled). We should actively handle the case and return an appropriate 4XX error. The problem is that DefaultUserManager.createTrustedUserLoginImpl potentially creates a UserLogin from a null user. Here is the stack trace seen: {code} 2011-06-01 16:25:11,529 ERROR [btpool0-3 ] org.mortbay.log org.mortbay.log.Slf4jLog-warn - /rest-service/projects-v1 java.lang.NullPointerException at com.cenqua.fisheye.user.UserLogin.<init>(UserLogin.java:15) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLoginImpl(DefaultUserManager.java:691) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:660) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:668) at com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:18) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationFilterAuthenticator.authenticate(TrustedApplicationFilterAuthenticator.java:108) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:113) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:95) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:78) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:154) at com.cenqua.fisheye.web.filters.CustomIncludableGzipFilter.doFilter(CustomIncludableGzipFilter.java:21) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.cenqua.fisheye.web.filters.ProductInfoFilter.doFilter(ProductInfoFilter.java:36) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.cenqua.fisheye.web.filters.UpfrontFilter.doFilter(UpfrontFilter.java:52) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.fecru.profiling.ProfilingServletFilter.doFilter(ProfilingServletFilter.java:73) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451) {code}

    Atlassian JIRA | 6 years ago | Adam Ahmed [Atlassian]
    java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [CRC-2681|https://support.atlassian.com/browse/CRC-2681] is an example of throwing a 500 when authentication fails for Trusted Apps (at least without auto-add enabled). We should actively handle the case and return an appropriate 4XX error. The problem is that DefaultUserManager.createTrustedUserLoginImpl potentially creates a UserLogin from a null user. Here is the stack trace seen: {code} 2011-06-01 16:25:11,529 ERROR [btpool0-3 ] org.mortbay.log org.mortbay.log.Slf4jLog-warn - /rest-service/projects-v1 java.lang.NullPointerException at com.cenqua.fisheye.user.UserLogin.<init>(UserLogin.java:15) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLoginImpl(DefaultUserManager.java:691) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:660) at com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:668) at com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:18) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationFilterAuthenticator.authenticate(TrustedApplicationFilterAuthenticator.java:108) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:113) at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:95) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:78) at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:154) at com.cenqua.fisheye.web.filters.CustomIncludableGzipFilter.doFilter(CustomIncludableGzipFilter.java:21) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.cenqua.fisheye.web.filters.ProductInfoFilter.doFilter(ProductInfoFilter.java:36) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.cenqua.fisheye.web.filters.UpfrontFilter.doFilter(UpfrontFilter.java:52) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at com.atlassian.fecru.profiling.ProfilingServletFilter.doFilter(ProfilingServletFilter.java:73) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.mortbay.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1264) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:451) {code}

    Atlassian JIRA | 6 years ago | Adam Ahmed [Atlassian]
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.cenqua.fisheye.user.UserLogin.<init>()
    2. com.cenqua.fisheye
      DefaultUserManager.createTrustedUserLogin
      1. com.cenqua.fisheye.user.UserLogin.<init>(UserLogin.java:18)
      2. com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLoginImpl(DefaultUserManager.java:851)
      3. com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:814)
      4. com.cenqua.fisheye.user.DefaultUserManager.createTrustedUserLogin(DefaultUserManager.java:822)
      4 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor1193.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      3. java.lang.reflect.Method.invoke(Unknown Source)
      3 frames
    4. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
      2 frames
    5. Unknown
      $Proxy30.createTrustedUserLogin
      1. $Proxy30.createTrustedUserLogin(Unknown Source)
      1 frame
    6. com.atlassian.fisheye
      FisheyeUserResolver.resolve
      1. com.atlassian.fisheye.trustedapplications.FisheyeUserResolver.resolve(FisheyeUserResolver.java:17)
      1 frame
    7. com.atlassian.security
      TrustedApplicationsFilter.doFilter
      1. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationFilterAuthenticator.authenticate(TrustedApplicationFilterAuthenticator.java:171)
      2. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.authenticate(TrustedApplicationsFilter.java:113)
      3. com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:95)
      3 frames
    8. Spring
      DelegatingFilterProxy.doFilter
      1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      2 frames
    9. Jetty
      ServletHandler$Chain.doFilter
      1. org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1502)
      1 frame