[GeoNetwork-devel] NullpointerExeption, can't login

Hi all,

I get the same error as reported here:
http://n2.nabble.com/BlueNet-crashes-with-nullpointerexception-td2020428.html

When logging in I get a NullPointerException in the UI, the log contains
the same NPE as reported in the above link.

I tried to dig into this, but actually I'm a bit confused:

1. The exception above comes with the first request to the servlet, not
with the login request.
2. The output for the first request looks fine.
3. Login doesn't work, it shows an NPE in the UI (without a stacktrace),
but no further NPE can be found in the logfile

So I looked at the code at Line 52:
http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/src/org/fao/geonet/guiservices/util/Env.java?view=markup
"gc" is null, so line 53 throws the NPE.
"sm" is never read, so we could remove line 53. However, line 56 would
throw the NPE anyway.

Attached debugger reveals that "context" is an Object of jeeves
"BasicContext" class. Looked at line 91:
http://jeeves.svn.sourceforge.net/viewvc/jeeves/trunk/src/jeeves/server/context/BasicContext.java?revision=3&view=markup

So there is not only no context for the string "contextName", htContexts
is totally empty.

I also attached the logfile. It contains a few other exceptions, which
don't look suspicious to me. However, I'm new to geonetwork and jeeves,
so who knows.

So I have the following questions:

Why is the NPE during login not logged to the logfile?
Is someone catching it silently?
Or maybe it is the same as the NPE logged with the first request?
Maybe both?
It it correct that "context" is of type "BasicContext" (looks more like
a mock object to me)?

Strange thing is, that is was working at some point. Don't know what
changed in between.

Any hints ?

Thanks in advance,
Christian

--
German Aerospace Center (DLR)
Member of the Helmholtz Association
German Remote Sensing Data Center (DFD)
National Ground Segment
Kalkhorstweg 53
D-17235 Neustrelitz
Germany
T: +49 (0) 3981-480-188
F: +49 (0) 3981-480-299
E-mail: Christian.Krafft@anonymised.com
Internet: http://www.dlr.de

(attachments)

geonetwork.log (23.2 KB)

Hi Christian, it looks like you added a new schema to your catalog and
something goes wrong when loading the new schema (missing xsd). Is
your new schema valid ? You have to make this working before anything
else. We could probably improve schema loader mechanism on startup but
you have to configure it properly in order to have a working node :

2009-06-03 16:55:14,002 INFO [jeeves.apphand] - Adding xml schema : premis
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Raised exception while
starting appl handler. Skipped.
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Exception :
java.io.FileNotFoundException:
/usr/local/geonetwork/web/geonetwork/xml/schemas/premis/xlink.xsd (No
such file or directory)
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Message :
/usr/local/geonetwork/web/geonetwork/xml/schemas/premis/xlink.xsd (No
such file or directory)
2009-06-03 16:55:14,121 ERROR [jeeves.engine] - Stack :
java.io.FileNotFoundException:

HTH. Francois

2009/6/3 Christian Krafft <Christian.Krafft@anonymised.com>:

Hi all,

I get the same error as reported here:
http://n2.nabble.com/BlueNet-crashes-with-nullpointerexception-td2020428.html

When logging in I get a NullPointerException in the UI, the log contains
the same NPE as reported in the above link.

I tried to dig into this, but actually I'm a bit confused:

1. The exception above comes with the first request to the servlet, not
with the login request.
2. The output for the first request looks fine.
3. Login doesn't work, it shows an NPE in the UI (without a stacktrace),
but no further NPE can be found in the logfile

So I looked at the code at Line 52:
http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/src/org/fao/geonet/guiservices/util/Env.java?view=markup
"gc" is null, so line 53 throws the NPE.
"sm" is never read, so we could remove line 53. However, line 56 would
throw the NPE anyway.

Attached debugger reveals that "context" is an Object of jeeves
"BasicContext" class. Looked at line 91:
http://jeeves.svn.sourceforge.net/viewvc/jeeves/trunk/src/jeeves/server/context/BasicContext.java?revision=3&view=markup

So there is not only no context for the string "contextName", htContexts
is totally empty.

I also attached the logfile. It contains a few other exceptions, which
don't look suspicious to me. However, I'm new to geonetwork and jeeves,
so who knows.

So I have the following questions:

Why is the NPE during login not logged to the logfile?
Is someone catching it silently?
Or maybe it is the same as the NPE logged with the first request?
Maybe both?
It it correct that "context" is of type "BasicContext" (looks more like
a mock object to me)?

Strange thing is, that is was working at some point. Don't know what
changed in between.

Any hints ?

Thanks in advance,
Christian

--
German Aerospace Center (DLR)
Member of the Helmholtz Association
German Remote Sensing Data Center (DFD)
National Ground Segment
Kalkhorstweg 53
D-17235 Neustrelitz
Germany
T: +49 (0) 3981-480-188
F: +49 (0) 3981-480-299
E-mail: Christian.Krafft@anonymised.com
Internet: http://www.dlr.de

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

Hi Francois,

thanks for your answer, and yes I'm trying to add a new schema :wink:

Indeed, the whole Exception handling looks a bit bogus.
Maybe I could help out a bit. I know a bit about plain old java, but not
so much about OGC, metadata and Web 2.0.
But as always, time is short. Have to concentrate to the premis schema
for now.

Cheers,
Christian

On Wed, 2009-06-03 at 21:48 +0200, Francois Prunayre wrote:

Hi Christian, it looks like you added a new schema to your catalog and
something goes wrong when loading the new schema (missing xsd). Is
your new schema valid ? You have to make this working before anything
else. We could probably improve schema loader mechanism on startup but
you have to configure it properly in order to have a working node :

2009-06-03 16:55:14,002 INFO [jeeves.apphand] - Adding xml schema : premis
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Raised exception while
starting appl handler. Skipped.
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Handler :
org.fao.geonet.Geonetwork
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Exception :
java.io.FileNotFoundException:
/usr/local/geonetwork/web/geonetwork/xml/schemas/premis/xlink.xsd (No
such file or directory)
2009-06-03 16:55:14,119 ERROR [jeeves.engine] - Message :
/usr/local/geonetwork/web/geonetwork/xml/schemas/premis/xlink.xsd (No
such file or directory)
2009-06-03 16:55:14,121 ERROR [jeeves.engine] - Stack :
java.io.FileNotFoundException:

HTH. Francois

2009/6/3 Christian Krafft <Christian.Krafft@anonymised.com>:
> Hi all,
>
> I get the same error as reported here:
> http://n2.nabble.com/BlueNet-crashes-with-nullpointerexception-td2020428.html
>
> When logging in I get a NullPointerException in the UI, the log contains
> the same NPE as reported in the above link.
>
> I tried to dig into this, but actually I'm a bit confused:
>
> 1. The exception above comes with the first request to the servlet, not
> with the login request.
> 2. The output for the first request looks fine.
> 3. Login doesn't work, it shows an NPE in the UI (without a stacktrace),
> but no further NPE can be found in the logfile
>
> So I looked at the code at Line 52:
> http://geonetwork.svn.sourceforge.net/viewvc/geonetwork/trunk/src/org/fao/geonet/guiservices/util/Env.java?view=markup
> "gc" is null, so line 53 throws the NPE.
> "sm" is never read, so we could remove line 53. However, line 56 would
> throw the NPE anyway.
>
> Attached debugger reveals that "context" is an Object of jeeves
> "BasicContext" class. Looked at line 91:
> http://jeeves.svn.sourceforge.net/viewvc/jeeves/trunk/src/jeeves/server/context/BasicContext.java?revision=3&view=markup
>
> So there is not only no context for the string "contextName", htContexts
> is totally empty.
>
> I also attached the logfile. It contains a few other exceptions, which
> don't look suspicious to me. However, I'm new to geonetwork and jeeves,
> so who knows.
>
>
> So I have the following questions:
>
> Why is the NPE during login not logged to the logfile?
> Is someone catching it silently?
> Or maybe it is the same as the NPE logged with the first request?
> Maybe both?
> It it correct that "context" is of type "BasicContext" (looks more like
> a mock object to me)?
>
>
> Strange thing is, that is was working at some point. Don't know what
> changed in between.
>
> Any hints ?
>
>
> Thanks in advance,
> Christian
>
> --
> German Aerospace Center (DLR)
> Member of the Helmholtz Association
> German Remote Sensing Data Center (DFD)
> National Ground Segment
> Kalkhorstweg 53
> D-17235 Neustrelitz
> Germany
> T: +49 (0) 3981-480-188
> F: +49 (0) 3981-480-299
> E-mail: Christian.Krafft@anonymised.com
> Internet: http://www.dlr.de
>
> ------------------------------------------------------------------------------
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> GeoNetwork-devel mailing list
> GeoNetwork-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
> GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
>