[GeoNetwork-users] NullPointerException at login

Hello,

On a fresh install of Ubuntu - PostgreSQL - Tomcat6 - GeoNetwork, after a
reboot, I see in the log :

2010-06-08 11:28:04,070 INFO [jeeves.engine] - --- Starting handler
--------------------------------------
2010-06-08 11:28:04,070 INFO [jeeves.apphand] - Initializing geonetwork...
2010-06-08 11:28:04,070 ERROR [jeeves.engine] - Raised exception while
starting appl handler. Skipped.
2010-06-08 11:28:04,070 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2010-06-08 11:28:04,070 ERROR [jeeves.engine] - Exception :
java.lang.NullPointerException
2010-06-08 11:28:04,070 ERROR [jeeves.engine] - Message : null
2010-06-08 11:28:04,071 ERROR [jeeves.engine] - Stack :
java.lang.NullPointerException
        at jeeves.server.resources.ResourceManager.open(Unknown Source)
        at org.fao.geonet.Geonetwork.start(Unknown Source)
        at jeeves.server.JeevesEngine.initAppHandler(Unknown Source)
        at jeeves.server.JeevesEngine.init(Unknown Source)
        at jeeves.server.sources.http.JeevesServlet.init(Unknown Source)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177)

2010-06-08 11:28:04,071 INFO [jeeves.engine] - Starting schedule manager...
2010-06-08 11:28:04,072 INFO [jeeves.engine] - Memory used is : 1864 Kb
2010-06-08 11:28:04,072 INFO [jeeves.engine] - Total memory is : 126720 Kb
2010-06-08 11:28:04,072 INFO [jeeves.engine] - Startup time is : 1 (secs)
2010-06-08 11:28:04,072 INFO [jeeves.engine] - === System working

When I try to login as admin:admin, I get a NullPointerException and I see
in the log :

2010-06-08 11:31:52,290 INFO [jeeves.request] -

2010-06-08 11:31:52,290 INFO [jeeves.request] - HTML Request (from
10.1.20.26) : /geonetwork/srv/fr/user.login
2010-06-08 11:31:52,290 DEBUG [jeeves.request] - Method : POST
2010-06-08 11:31:52,290 DEBUG [jeeves.request] - Content type :
application/x-www-form-urlencoded
2010-06-08 11:31:52,290 DEBUG [jeeves.request] - Accept :
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
2010-06-08 11:31:52,290 DEBUG [jeeves.request] - Session id is
30A5B7F1D4995A102A4D4B07203B30B1
2010-06-08 11:31:52,290 INFO [jeeves.service] - Dispatching : user.login
2010-06-08 11:31:52,290 DEBUG [jeeves.service] - -> parameters are :
<request>
  <password>admin</password>
  <username>admin</username>
</request>
2010-06-08 11:31:52,291 ERROR [jeeves.service] - Exception when executing
service
2010-06-08 11:31:52,291 ERROR [jeeves.service] - (C) Exc :
java.lang.NullPointerException
2010-06-08 11:31:52,291 DEBUG [jeeves.service] - Raised exception while
executing service
<error id="error">
  <message />
  <class>NullPointerException</class>
  <stack>
    <at class="org.fao.geonet.services.login.Login" file="???" line="-1"
method="exec" />
    <at class="jeeves.server.dispatchers.ServiceInfo" file="???" line="-1"
method="execService" />
    <at class="jeeves.server.dispatchers.ServiceInfo" file="???" line="-1"
method="execServices" />
    <at class="jeeves.server.dispatchers.ServiceManager" file="???"
line="-1" method="dispatch" />
    <at class="jeeves.server.JeevesEngine" file="???" line="-1"
method="dispatch" />
    <at class="jeeves.server.sources.http.JeevesServlet" file="???"
line="-1" method="execute" />
    <at class="jeeves.server.sources.http.JeevesServlet" file="???"
line="-1" method="doPost" />
    <at class="javax.servlet.http.HttpServlet" file="HttpServlet.java"
line="637" method="service" />
    <at class="javax.servlet.http.HttpServlet" file="HttpServlet.java"
line="717" method="service" />
    <at class="org.apache.catalina.core.ApplicationFilterChain"
file="ApplicationFilterChain.java" line="290" method="internalDoFilter" />
  </stack>
  <request>
    <language>fr</language>
    <service>user.login</service>
  </request>
</error>
2010-06-08 11:31:52,291 INFO [jeeves.service] - -> dispatching to error
for : user.login
2010-06-08 11:31:52,293 ERROR [jeeves.service] - Exception executing gui
service : java.lang.NullPointerException
2010-06-08 11:31:52,293 ERROR [jeeves.service] - (C) Stack trace is :
java.lang.NullPointerException
        at org.fao.geonet.guiservices.util.Env.exec(Unknown Source)
        at jeeves.server.dispatchers.guiservices.Call.exec(Unknown Source)
        at jeeves.server.dispatchers.AbstractPage.invokeGuiService(Unknown
Source)
        at jeeves.server.dispatchers.AbstractPage.invokeGuiServices(Unknown
Source)
        at jeeves.server.dispatchers.ServiceManager.dispatchError(Unknown
Source)
        at jeeves.server.dispatchers.ServiceManager.handleError(Unknown
Source)
        at jeeves.server.dispatchers.ServiceManager.dispatch(Unknown Source)
        at jeeves.server.JeevesEngine.dispatch(Unknown Source)
        at jeeves.server.sources.http.JeevesServlet.execute(Unknown Source)
        at jeeves.server.sources.http.JeevesServlet.doPost(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:619)

2010-06-08 11:31:52,293 INFO [jeeves.service] - -> transforming with
stylesheet : /opt/geonetwork/web/geonetwork/xsl/error.xsl
2010-06-08 11:31:52,315 INFO [jeeves.service] - -> end error
transformation for : user.login
2010-06-08 11:31:52,315 INFO [jeeves.service] - -> error ended for :
user.login

I solve this problem by doing :
sudo su - postgres
/etc/init.d/postgresql-8.4 stop
/usr/lib/postgresql/8.4/bin/pg_ctl -D /var/pg_data/ -l
/var/log/pg_logs/pg.log start
exit
sudo /etc/init.d/tomcat6 stop
sudo /etc/init.d/tomcat6 start

It looks like a problem with the init script of PostgreSQL, but I thought
that would be interesting to post here too, as I see many people with errors
of NullPointerExceptions at login.

For the installation, I followed
http://geonetwork-opensource.org/documentation/how-to/installing-geonetwork-2-1-0-on-ubuntu
with some changes.

java6
tomcat6
postgresql 8.4
geonetwork 2.4.3
apache2 (mod_jk not working like it should)

I can provide the list of commands used for installation if somebody's
interested.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/NullPointerException-at-login-tp5152973p5156927.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.