[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1182: Geonetwork doesnt provide any help for using JNDI container db connections with Jetty

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
---------------------+------------------------------------------------------
Reporter: simonp | Owner: geonetwork-devel@…
     Type: task | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------
Advanced config section of User manual refers to using JNDI container db
connections with tomcat container but doesn't give any details of how to
do this with jetty container.

This is important because JNDI connections use only one database pool and
allow the database to handle spatial indexing for CSW queries (Lucene is
used for search by bounding box as it is very speedy for that type of
query).

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182&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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
---------------------+------------------------------------------------------
Reporter: simonp | Owner: geonetwork-devel@…
     Type: task | Status: new
Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Keywords: |
---------------------+------------------------------------------------------

Comment(by simonp):

Task can be implemented by:

- enabling JNDI in Jetty by switching on jetty plus (see start.ini and etc
/jetty-plus.xml in release dir)
- place (sample) database config in file jetty-env.xml in the GeoNetwork
WEB-INF directory
- include sample database config from jetty-env.xml in advanced config
section of users manual and ensure descriptions are included for both
tomcat and jetty

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
----------------------+-----------------------------------------------------
  Reporter: simonp | Owner: geonetwork-devel@…
      Type: task | Status: closed
  Priority: major | Milestone: v2.9.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------
Changes (by simonp):

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

Comment:

Included in commits:

acb8f7471dcbda64f503fc72d1c5d13e0826ac61
ce165472b1e55ff83bb63813f06ae0495efd2993
a6e0c7b5e8cc5dd9f09617c03f37064504a35012

to master (also committed to 2.8.x RC2).

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
----------------------+-----------------------------------------------------
  Reporter: simonp | Owner: geonetwork-devel@…
      Type: task | Status: closed
  Priority: major | Milestone: v2.8.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------
Changes (by ianwallen):

  * milestone: v2.9.0 => v2.8.0

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
----------------------+-----------------------------------------------------
  Reporter: simonp | Owner: geonetwork-devel@…
      Type: task | Status: closed
  Priority: major | Milestone: v2.8.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------

Comment(by fxp):

When running mvn jetty:run, jetty complains about missing class
(org.eclipse.jetty.webapp.!WebAppContext):
{{{

2012-12-17 17:41:50.697::WARN: Failed startup of context
org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@...927...{/geonetwork,file:/geonetwork/
web/src/main/webapp/;file:/geonetwork/web/target/webapp/;file:/geonetwork
/web-client/src/main/resources/;}
java.lang.ClassNotFoundException: org.eclipse.jetty.webapp.WebAppContext
         at
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
         at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
         at
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
         at
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:401)
}}}
Removing web/src/main/webapp/WEB-INF/jetty-env.xml fix the issue.

The problem is related to the Jetty version we are using in maven config
6.1.18 (and probably in release). Should we plan for an update to a newer
version of Jetty ?

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#comment:4&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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
----------------------+-----------------------------------------------------
  Reporter: simonp | Owner: geonetwork-devel@…
      Type: task | Status: closed
  Priority: major | Milestone: v2.8.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------

Comment(by simonp):

Well perhaps not so radical as upgrading all jetty just yet :slight_smile: - but the
patch attached to this ticket works for me (apart from one funky prob with
Z3950 spring config to solve). This would make the jetty version the same
for both the mvn jetty:run target and the webapp itself which at least is
better for the time being. If ok perhaps we can commit?

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#comment:5&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.

#1182: Geonetwork doesnt provide any help for using JNDI container db connections
with Jetty
----------------------+-----------------------------------------------------
  Reporter: simonp | Owner: geonetwork-devel@…
      Type: task | Status: closed
  Priority: major | Milestone: v2.8.0
Component: General | Version: v2.8.0RC2
Resolution: fixed | Keywords:
----------------------+-----------------------------------------------------

Comment(by simonp):

Fixing the problem with JZKit meant restoring the baseResource config
option to jetty class ResourceCollection, which in turn was broken in
Jetty up until 7.5.0 (hmm). So moving to jetty 7.5.0 as per the attached
patch fixes the problem properly. So yes - out of sync jetty again but at
least they are the same major version now!

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1182#comment:6&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.