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

<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个回答

mysql数据库么?

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

wsgopk
wsgopk 神奇了,同学习
大约 7 年之前 回复
kareter
kareter 应该不是,部署后运行没有出问题,到了第二天第一次运行才出现问题
大约 7 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐