Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#1182 closed task (fixed)

Geonetwork doesnt provide any help for using JNDI container db connections with Jetty

Reported by: simonp Owned by: geonetwork-devel@…
Priority: major Milestone: v2.8.0
Component: General Version: v2.8.0RC2
Keywords: Cc:

Description

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).

Attachments (1)

web-pom.xml.patch (1.9 KB ) - added by simonp 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by simonp, 12 years ago

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

comment:2 by simonp, 12 years ago

Resolution: fixed
Status: newclosed

Included in commits:

acb8f7471dcbda64f503fc72d1c5d13e0826ac61 ce165472b1e55ff83bb63813f06ae0495efd2993 a6e0c7b5e8cc5dd9f09617c03f37064504a35012

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

comment:3 by ianwallen, 12 years ago

Milestone: v2.9.0v2.8.0

comment:4 by fxp, 12 years ago

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@465863{/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 ?

comment:5 by simonp, 12 years ago

Well perhaps not so radical as upgrading all jetty just yet :-) - 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?

comment:6 by simonp, 12 years ago

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!

by simonp, 12 years ago

Attachment: web-pom.xml.patch added
Note: See TracTickets for help on using tickets.