Full story below, but essentially I'm trying to use Geoserver and it needs the class org.geotools.util.Version, but it can't find it even though I can see it's in the appropriate jar file. Something is fundamentally wrong and I can't understand how anything has worked so far for anyone when things appear so broken or how to fix this.

Background (probably inessential):

I'm trying to use the SLDSelect control in OpenLayers (note that the example http://openlayers.org/dev/examples/SLDSelect.html is also using GeoServer according to the source, which makes this story weirder). I had installed the GeoServer app for Mac via some dmg (can't remember exactly but it doesn't matter) and I was getting an error. I diagnosed wrong and installed Tomcat and the latest geoserver.war (2.5.1) straight from the website - so now it's platform independent. I got GeoServer working but still got the same error for SLDSelect. I looked closer and eventually delved into the source of Openlayers. I found that in the function OpenLayers.Control.SLDSelect.parseDescribeLayer the variable url was null from which I saw that describeLayer wasn't being formed properly. This lead me to look at the activate function.

Here's where it gets really weird:

When OpenLayers calls activate, it GETs the following URL, as seen in Firebug:


The response to this from GeoServer is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://localhost:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd"> <ServiceExceptionReport version="1.1.1" >   <ServiceException>
      org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: org.geotools.util.Version
java.lang.ClassNotFoundException: org.geotools.util.Version

which seems pretty serious. I copied and extracted $TOMCAT/webapps/geoserver/WEB-INF/lib/gt-metadata-11.1.jar and found Version.class under org/geotools/util as expected. So why can't it find it?

I also got the same error on a slightly older version of the geoserver.war (2.4.5).

GeoServer is generally working. OpenLayers is able to request and display polygons from PostGIS over WMS. I even managed a parametrised SQL view. I've restarted my computer and still get the same issue. What could be wrong?

In case it helps, when I start Tomcat I get:

Using CATALINA_BASE:   /Library/Tomcat
Using CATALINA_HOME:   /Library/Tomcat
Using CATALINA_TMPDIR: /Library/Tomcat/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
Using CLASSPATH:       /Library/Tomcat/bin/bootstrap.jar:/Library/Tomcat/bin/tomcat-juli.jar
Tomcat started.

Update: now I'm finding that WFS isn't working in general for similar reasons. When I try making a WFS request, I get java.lang.ClassNotFoundException: org.geoserver.wfs.WFSInfo$Version. I also see this if I click on one WFS 1.1.0 link on the home page, i.e. a GetCapabilities request.

While I'm at it, in case they're linked (maybe a general JRE problem?) if I click on the WFS link on the left sidebar, I get:

org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = srsNameStyle]]

I also can't enable any services for workspaces (I'm not sure how I managed before). When I tick a checkbox (e.g. for WMS), it tells me instantly that my session has timed out when it definetely hasn't. Before, it would let me tick, but once I clicked 'Save' it would show a java.lang.reflect.InvocationException or something at the top and not save.

Basically all my installations seem completely broken.

  • It should be in gt-metadata-XX-Y.jar - make sure all your jars have the same XX-Y numbers. – Ian Turton Jul 22 '14 at 10:24
  • does your geoserver work for any request? – Ian Turton Jul 22 '14 at 11:05
  • Ah, thanks, it is there. I don't know why my initial search didn't show it there. Yes they all have the same numbers. The installation was standard and straightforward. Geoserver does work for most requests. It still can't detect the class though. I've edited the post accordingly. – alexmojaki Jul 22 '14 at 13:42
  • try turning up the logging level – Ian Turton Jul 22 '14 at 13:52
  • I thought it might be extreme to post the full stack trace in the post (and that there might be other relevant info) so here's a link to my log file: dropbox.com/s/o6cb2ndrwke6nfk/geoserver.log . Note that in a few cases other geotools classes are found and used. – alexmojaki Jul 22 '14 at 15:54

Miracle of miracles, all problems went away when I used Glassfish instead of Tomcat/Jetty.

  • Why was this downvoted? – alexmojaki Jul 25 '14 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.