1

I followed the steps mentioned here

Download the desired geonetwork.war file from SourceForge.
Copy the WAR file into the webapp folder of Tomcat.
If started, Tomcat will automatically deploy the application. If not, start Tomcat to deploy.

I start Tomcat, go to http://localhost:8080/manager/html, and start and click Geonetwork. The page loads for a couple of seconds but the Start button doesn't change to Stop. It shows FAIL - Application at context path [/GeoNetwork-4.0.5-0] could not be started.

enter image description here

I click GeoNetwork-4.0.5-0 is there and it returns a 404 error.

enter image description here

xampp/tomcat/webapps folder

enter image description here

Server information

enter image description here

I tried installing using the zip file but now returns a 503 error

enter image description here

I checked the log right after starting Tomcat and it says

Jul 04, 2022 7:13:30 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(C:\xampp\tomcat\webapps\GeoNetwork-4.0.5-0\WEB-INF\lib\javaee-api-7.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Jul 04, 2022 7:13:30 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(C:\xampp\tomcat\webapps\GeoNetwork-4.0.5-0\WEB-INF\lib\jsp-api-2.1-6.1.14.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class
Jul 04, 2022 7:13:30 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(C:\xampp\tomcat\webapps\GeoNetwork-4.0.5-0\WEB-INF\lib\servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Jul 04, 2022 7:13:30 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(C:\xampp\tomcat\webapps\GeoNetwork-4.0.5-0\WEB-INF\lib\servlet-api-2.5-20081211.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Jul 04, 2022 7:13:30 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(C:\xampp\tomcat\webapps\GeoNetwork-4.0.5-0\WEB-INF\lib\servlet-api-2.5-6.1.14.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class

Any tips on solving this?

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136
BallpenMan
  • 185
  • 1
  • 12

1 Answers1

0

Since you're instaling version 4, I would advice to check out the relevant documentation here. Some additional services, like ElasticSearch, need to be installed for this version.

Also, it's probably better to download the latest version 4.2.0 instead of an older one, 4.0.5, that you're using.

The error happens most likely due to messy packaging of the war file by the GeoNetwork developers. The file contains libraries that are already provided by Tomcat, so packaging them as part of the war file will result in such error.

The warnings about servlet-api and jsp-api are not critical, since these libraries are present on Tomcat and will be loaded anyway. However, the javaee-api-7.0.jar warning is critical, as Tomcat doesn't fully provide the JavaEE API, and the failure to load this library is the reason the application fails:

 Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.fao.geonet.api.records.attachments.ResourceLoggerStore] from ClassLoader [WebappClassLoader
   context: /GeoNetwork-4.0.5-0
   delegate: false
   repositories:
     /WEB-INF/classes/
 ----------> Parent Classloader:
 java.net.URLClassLoader@2a84aee7
 ]
         at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481)
         at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
         at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
         ... 77 more
 Caused by: java.lang.NoClassDefFoundError: javax/resource/NotSupportedException
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
         at java.lang.Class.getDeclaredMethods(Class.java:1975)
         at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463)
         ... 79 more
 Caused by: java.lang.ClassNotFoundException: javax.resource.NotSupportedException
         at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1951)
         at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1795)
         ... 83 more

A quick hack to fix the issue would be to copy this jar from the deployed application (tomcat/webapps/GeoNetwork-4.0.5-0/WEB-INF/lib/javaee-api-7.0.jar) to the tomcat/lib directory and restarting the Tomcat server.

A proper way would be to report this issue to the developers of GeoNetwork, so that they would remove the conflicting libraries from the distribution or update the documentation.

Forketyfork
  • 7,416
  • 1
  • 26
  • 33
  • Ran it on Tomcat 6 but same result. – BallpenMan Jul 04 '22 at 14:07
  • I've updated the answer, with this fix it seems to be working. – Forketyfork Jul 04 '22 at 15:12
  • Working now. I also renamed the file to `geonetwork.war` and changed `JAVA_HOME` variable to `C:\Program Files (x86)\Java\jre1.8.0_261`. Running Geonetwork 4 with Apache Tomcat/8.5.78. Though I'm getting `Query returned an invalid response` and `Unable to revive connection to http://localhost:9200. Error is Timeout connecting to [localhost/127.0.0.1:9200]` errors in the home page. – BallpenMan Jul 07 '22 at 14:19
  • The `localhost:9200` error is most likely related to Elasticsearch which should run locally on the same machine. Did you install it according to the guide? – Forketyfork Jul 07 '22 at 14:40