NullPointerException on first login

bvobvo Posts: 6
OpenClinica starts and presents the initial login screen. After entering root user and password OpenClinica crashes with a NullPointerException while trying to validate the user. From the log:

Mar 03, 2017 3:24:18 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [default] in context with path [/OpenClinica] threw exception
java.lang.NullPointerException
at org.akaza.openclinica.dao.login.UserAccountDAO.findByUserName(UserAccountDAO.java:584)
at org.akaza.openclinica.web.filter.OpenClinicaUsernamePasswordAuthenticationFilter.attemptAuthentication(OpenClinicaUsernamePasswordAuthenticationFilter.java:123)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.oauth2.provider.verification.BasicUserApprovalFilter.doFilter(BasicUserApprovalFilter.java:41)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:217)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.akaza.openclinica.web.filter.LocaleFilter.doFilter(LocaleFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1083)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:640)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Comments

  • haenselhaensel Posts: 530 ✭✭
    Hi @bvo

    It is very likely that the database configuration in the config file datainfo.properties is still wrong.
    Please check the database parameters carfully.

    e.g.
    dbType=postgres
    dbUser=clinica
    dbPass=clinica
    db=openclinica
    dbPort=5432
    dbHost=localhost
    Regards,
    Christian
  • BinaryVisionBinaryVision Posts: 31
    via Email
    Could also be an issue with the .properties file. I first received the error below with 3.7 which appears the same as yours. Are you changing LDAP properties and which OS are you on? Our root issue at the time was modifying the .properties with (Notepad/Wordpad) which is not fully compatible with a UNIX formatted file (EOL).

    Oct 01, 2015 3:26:09 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet [default] in context with path [/oc37] threw exception
    java.lang.NullPointerException
    at org.akaza.openclinica.dao.login.UserAccountDAO.findByUserName(UserAccountDAO.java:584)
    at org.akaza.openclinica.web.filter.OpenClinicaUsernamePasswordAuthenticationFilter.attemptAuthentication(OpenClinicaUsernamePasswordAuthenticationFilter.java:123)
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.oauth2.provider.verification.BasicUserApprovalFilter.doFilter(BasicUserApprovalFilter.java:41)
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)


    Regards,
    Andrew
  • bvobvo Posts: 6
    Thank you both. Yes I am on Windows using Wordpad. UltraEdit saved the day. I can now log on. This needs to be documented (or fixed).
  • haenselhaensel Posts: 530 ✭✭
    A small note in the installation instructions might help others to avoid this error.

    happy testing
  • BinaryVisionBinaryVision Posts: 31
    haensel said:

    A small note in the installation instructions might help others to avoid this error.

    happy testing

    That's a fine idea. I posted about this issue back in 2015 https://forums.openclinica.com/discussion/15761/oc-3-6-receive-error-at-j-spring-security-check-upon-login#latest
  • haenselhaensel Posts: 530 ✭✭
    Unfortunately this takes a while if it ever will happen.

    Regards,
    Christian
Sign In or Register to comment.