kareter
2013-05-24 10:18 阅读 300
已采纳

每天第一次登陆出现空指针异常

<div class="iteye-blog-content-contain" style="font-size: 14px"></div>

 用到SPRING SECURITY3项目部署到tomcat下运行,登陆没有出问题,到第二天第一次登陆,出现空指针异常,返回后重新登陆,没问题;第三天第一次登陆问题又出现;发现只有没天第一次登陆会出现问题;错误如下

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
    org.pmp.dao.admin.BaseDAO.getInstance(BaseDAO.java:215)
    org.pmp.dao.impl.admin.UserDAO.getUserByUsername(UserDAO.java:83)
    org.pmp.security.MyUserDetailsService.loadUserByUsername(MyUserDetailsService.java:35)
    org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser

(DaoAuthenticationProvider.java:83)
    org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate

(AbstractUserDetailsAuthenticationProvider.java:125)
    org.springframework.security.authentication.ProviderManager.doAuthentication(ProviderManager.java:121)
    org.springframework.security.authentication.AbstractAuthenticationManager.authenticate

(AbstractAuthenticationManager.java:49)
    org.springframework.security.authentication.ProviderManager.doAuthentication(ProviderManager.java:139)
    org.springframework.security.authentication.AbstractAuthenticationManager.authenticate

(AbstractAuthenticationManager.java:49)
    org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication

(UsernamePasswordAuthenticationFilter.java:98)
    org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter

(AbstractAuthenticationProcessingFilter.java:200)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
    org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter

(SecurityContextPersistenceFilter.java:80)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:150)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.27 logs.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    zyn010101 zyn010101 2013-05-24 10:31

    mysql数据库么?

    点赞 评论 复制链接分享
  • wsgopk wsgopk 2013-05-24 11:49

    是不是监听器在,提交之前获取值了,如果是这样,就拿到的是空值,第二次以后就不会了,我以前只遇到这样的问题。

    点赞 评论 复制链接分享

相关推荐