[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1065: GeoNetwork does not start when using /jsp/geonetwork as the context path

#1065: GeoNetwork does not start when using /jsp/geonetwork as the context path
---------------------+------------------------------------------------------
Reporter: murrayh | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Keywords: |
---------------------+------------------------------------------------------
Hello,

SVN revision: 9266

The GeoNetwork webapp does not start when using a context path of
/jsp/geonetwork.

The cause of this problem is that GeoNetwork attempts to create the
directory "null/images/logos", which throws an exception. The exception
never gets to the user, because:

  * The exception does not get logged

  * The webapp does not start, so HTTP requests don't return and the user
cannot see the exception report

The root cause of this problem is:

  * System properties are set using the webapp's context path (in my case:
jsp/geonetwork)

  * In some places system properties are read using
"getServletContextName()", which is the display name of the webapp, which
defaults to "geonetwork".

I was able to work around this issue by editing web.xml and changing the
display name from "geonetwork" to "jsp/geonetwork".

I was not able to reproduce the startup issue on a separate machine. On
the other machine Java would quite happily make the folder
"null/images/logos" without failing or throwing exceptions. I did full
filesystem searches and couldn't find that folder anywhere, so there are
some aspects to this issue that I do not understand.

Cheers,
Murray

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1065&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1065: GeoNetwork does not start when using /jsp/geonetwork as the context path
----------------------+-----------------------------------------------------
  Reporter: murrayh | Owner: geonetwork-devel@…
      Type: defect | Status: closed
  Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Resolution: invalid | Keywords:
----------------------+-----------------------------------------------------
Changes (by ianwallen):

  * status: new => closed
  * resolution: => invalid

Comment:

Murray,

We now (Since June 14, 2012) use GIt for the repository. See the following
URL regarding compiling the 2.8 branch.

http://trac.osgeo.org/geonetwork/wiki/HowToCompile

Regarding your particular issue there have been some changes recently
regarding the context path - please try compiling a more recent version to
see if you issue still exist.

I'm closing the ticket - Reopen ticket if the issue can still be
reproduced using a more recent build.

Thanks.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1065#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1065: GeoNetwork does not start when using /jsp/geonetwork as the context path
----------------------+-----------------------------------------------------
  Reporter: murrayh | Owner: geonetwork-devel@…
      Type: defect | Status: reopened
  Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Changes (by murrayh):

  * status: closed => reopened
  * resolution: invalid =>

Comment:

Hi Ian,

The same issue exists in both the master branch and the 2.8.x branch of
the git repository.

The "webAppName" argument passed into the GeonetworkDataDirectory object
is actually the context path, not the display name. You can see this in
GeoNetwork.java.

Then it is just a matter of searching for "getServletContextName" to find
instances of the bug.

Cheers,
Murray

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1065#comment:2&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1065: GeoNetwork does not start when using /jsp/geonetwork as the context path
----------------------+-----------------------------------------------------
  Reporter: murrayh | Owner: geonetwork-devel@…
      Type: defect | Status: reopened
  Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC0
Resolution: | Keywords:
----------------------+-----------------------------------------------------

Comment(by murrayh):

Hello,

One more note: If you have file permission errors on the logo directory
(ie. the logo directory cannot be created), it is very hard to debug.

Even when this getServletContextName bug is fixed, this file permissions
error state is still possible, and I strongly recommend making it easier
to debug that particular failure mode (by logging the runtime exception in
the debug log).

The operations team weren't happy with me. We were restarting our shared
Tomcat instance at least once a day for about two weeks while I was trying
debug this (as noted in the original report, for a long time I was unable
to reproduce on a separate environment because Java filesystem commands
behaved differently).

Cheers,
Murray

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1065#comment:3&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.