[GIS] Upgrading Geoserver from 2.5 to 2.7.5 or 2.8.1

geoserver

I have in production a Geoserver 2.5 installation, with GDAL libraries and extension installed and working to display MrSID data, the SQL Server extension to provide dynamic layers stored in a SQL Server table, and I would like to start utilizing the CSS styling capabilities, but this is not yet installed.

The server is a VM, so I have the luxury of restoring a backup of it, so I have the identical machine, then trying to upgrade it to see what happens. I've failed miserably twice now, and am getting anxious and frustrated. But I probably took a shortcut I should not have taken.

In both attempts (one to upgrade to 2.8.1, the other to 2.7.5), I've downloaded the Windows Installer, shutdown the currently running server (which runs as a Windows service) and then running the install as an in-place upgrade. When it didn't work, (localhost:8080/geoserver returned 503 error), I upgraded the plugins, added a line to my wrapper.conf file so GDAL native loaded properly, but I still get Java errors. Different ones for 2.8.1 and 2.7.5.

2.7.5 gives me the following error

    STATUS | wrapper  | 2016/01/15 07:51:51 | --> Wrapper Started as Service
    STATUS | wrapper  | 2016/01/15 07:51:51 | Java Service Wrapper Community Edition 3.3.3
    STATUS | wrapper  | 2016/01/15 07:51:51 |   Copyright (C) 1999-2009 Tanuki Software, Ltd.  All Rights Reserved.
    STATUS | wrapper  | 2016/01/15 07:51:51 |     http://wrapper.tanukisoftware.org
    STATUS | wrapper  | 2016/01/15 07:51:51 | 
    STATUS | wrapper  | 2016/01/15 07:51:51 | Launching a JVM...
    INFO   | jvm 1    | 2016/01/15 07:51:52 | WrapperManager: Initializing...
    INFO   | jvm 1    | 2016/01/15 07:51:52 | 0 [WrapperSimpleAppMain] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@c550 via org.mortbay.log.Slf4jLog
    INFO   | jvm 1    | 2016/01/15 07:51:52 | 188 [WrapperSimpleAppMain] WARN org.mortbay.log - Deprecated configuration used for C:\Program Files (x86)\GeoServer 2.5/webapps
    INFO   | jvm 1    | 2016/01/15 07:51:52 | 219 [WrapperSimpleAppMain] INFO org.mortbay.log - jetty-6.1.8
    INFO   | jvm 1    | 2016/01/15 07:51:54 | Jan 15, 2016 7:51:54 AM it.geosolutions.imageio.gdalframework.GDALUtilities loadGDAL
    INFO   | jvm 1    | 2016/01/15 07:51:54 | INFO: GDAL Native Library loaded (version: 1.9.2)
    INFO   | jvm 1    | 2016/01/15 07:51:55 | Jan 15, 2016 7:51:55 AM org.geoserver.platform.GeoServerExtensions checkContext
    INFO   | jvm 1    | 2016/01/15 07:51:55 | WARNING: Extension lookup 'XStreamPersisterInitializer', but ApplicationContext is unset.
    INFO   | jvm 1    | 2016/01/15 07:51:55 | log4j:WARN File option not set for appender [geoserverlogfile].
    INFO   | jvm 1    | 2016/01/15 07:51:55 | log4j:WARN Are you using FileAppender instead of ConsoleAppender?
    INFO   | jvm 1    | 2016/01/15 07:51:55 | 3344 [WrapperSimpleAppMain] INFO /geoserver - Initializing Spring root WebApplicationContext
    INFO   | jvm 1    | 2016/01/15 07:51:58 | Jan 15, 2016 7:51:58 AM org.geoserver.platform.GeoServerExtensions checkContext
    INFO   | jvm 1    | 2016/01/15 07:51:58 | WARNING: Extension lookup 'GeoServerSecurityProvider', but ApplicationContext is unset.
    INFO   | jvm 1    | 2016/01/15 07:51:58 | 15 Jan 07:51:58 INFO [org.geoserver] - Loaded style 'AStyle'
    ...
    INFO   | jvm 1    | 2016/01/15 07:51:59 | 15 Jan 07:51:58 WARN [org.geoserver] - Failed to load coverage store 'arcGridSample'
    INFO   | jvm 1    | 2016/01/15 07:51:59 | com.thoughtworks.xstream.converters.ConversionException: Error creating bean with name 'pbePasswordEncoder' defined in URL [jar:file:/C:/Program%20Files%20(x86)/GeoServer%202.5/webapps/geoserver/WEB-INF/lib/gs-main-2.7.5.jar!/applicationSecurityContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jasypt/encryption/pbe/PBEStringEncryptor : Error creating bean with name 'pbePasswordEncoder' defined in URL [jar:file:/C:/Program%20Files%20(x86)/GeoServer%202.5/webapps/geoserver/WEB-INF/lib/gs-main-2.7.5.jar!/applicationSecurityContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jasypt/encryption/pbe/PBEStringEncryptor
    INFO   | jvm 1    | 2016/01/15 07:51:59 | ---- Debugging information ----
    INFO   | jvm 1    | 2016/01/15 07:51:59 | message             : Error creating bean with name 'pbePasswordEncoder' defined in URL [jar:file:/C:/Program%20Files%20(x86)/GeoServer%202.5/webapps/geoserver/WEB-INF/lib/gs-main-2.7.5.jar!/applicationSecurityContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jasypt/encryption/pbe/PBEStringEncryptor
    INFO   | jvm 1    | 2016/01/15 07:51:59 | cause-exception     : org.springframework.beans.factory.BeanCreationException
    INFO   | jvm 1    | 2016/01/15 07:51:59 | cause-message       : Error creating bean with name 'pbePasswordEncoder' defined in URL [jar:file:/C:/Program%20Files%20(x86)/GeoServer%202.5/webapps/geoserver/WEB-INF/lib/gs-main-2.7.5.jar!/applicationSecurityContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/jasypt/encryption/pbe/PBEStringEncryptor
    INFO   | jvm 1    | 2016/01/15 07:51:59 | class               : org.geoserver.catalog.impl.CoverageStoreInfoImpl
    INFO   | jvm 1    | 2016/01/15 07:51:59 | required-type       : org.geoserver.catalog.impl.CoverageStoreInfoImpl
    INFO   | jvm 1    | 2016/01/15 07:51:59 | converter-type      : org.geoserver.config.util.XStreamPersister$StoreInfoConverter
    INFO   | jvm 1    | 2016/01/15 07:51:59 | line number         : 10
    INFO   | jvm 1    | 2016/01/15 07:51:59 | version             : 2.7.5
    INFO   | jvm 1    | 2016/01/15 07:51:59 | -------------------------------
    ...

I can provide the whole extremely long list of errors if necessary, but I believe all or most are related to bean named pbePasswordEncoder not being found, and/or PBEStringEncryptor.

I read that some save the data folder, install the new version, and then replace the data folder, but because of the extensions and config changes I've made it may not be that simple.

Best Answer

Well, here is what I've discovered... I would NOT recommend doing an "in place" installation with the Windows installer, at least if you use GDAL extensions. Not sure what other extensions might cause issues. Perhaps all of them? I successfully upgraded as follows:

1) I backed up my data_dir folder, which already was not in the same place as the geoserver program (it was on another drive).

2) I uninstalled geoserver 2.5 (I kept a copy of the program folders so I could review config file changes I may need to make again).

3) I uninstalled Geoserver 2.5.

4) I installed Geoserver 2.8.1 (as a service, which is how I run it)

5) I went to Services and stopped the service (the install starts it)

6) I had a system wide Environment variable GEOSERVER_DATA_DIR which the new install overwrote to be in C:\Program Files (86)\Geoserver 2.8.1... So I right clicked on Computer, went to advanced settings, and had it point once again to the data_dir on my other drive.

7) I downloaded and followed instructions for installing the three extensions I need: the GDAL extensions, the SQL Server extension, and the CSS extension. The GDAL binaries are still the same version as for 2.5, so I did not have to update those. But I did anyway. You have to make sure, for all extensions, you have the ones that match the Geoserver version (2.8.1 in this case).

8) I had to edit Wrapper.conf for GDAL to work, as described in the Geoserver user manual, but also had to add

set.PATH=wrapper/lib;%PATH%

in the wrapper.conf file as recommended in http://www.geo-solutions.it/blog/fix-gdal-extension-not-working-with-geoservers-windows-service-wrapper/ but this is not yet documented in the online user manual.

9) I started up the service, and it worked great! I could logon with my admin id/pw, all the stores and layers were there, including the MrSID layer and the SQL Server layer I had already defined in 2.5.

So far so good... If I find it isn't working properly for some reason, I'll edit this response.

In my opinion, the upgrade process sucks. The installation process should include MUCH better administrative management of installing and upgrading extensions. It would be great if, when installing over a previous installation, the installer could know what extensions I have, and at the very least provide information on how/where I must upgrade them for the program to work. And installing over does NOT delete any of the jar files already in the lib folders, so I had multiple versions of the extensions in there. Quite possibly this caused the exceptions when I tried to run after the automated upgrade.

The process of simply plopping jar files into the library and your extensions suddenly get loaded is, for lack of a better way to say it, not good. If I can ever get all my other work done, I may look into helping support a better install and extension methodology in the future. I almost bought consulting time for this one - I may consider it in the future. Making the Geoserver work should not take so much of my time. I'm busy enough utilizing it!

Bottom line - my recommendation for upgrades will always be, for now, save the data_dir, uninstall the old one, install the new one, reinstall all your extensions, put the data_dir back, that's it.

Related Question