[Geoserver-users] Error starting Geoserver (1.4.0-RC3) as a Windows Service

I am having difficulty getting GeoServer to run as a Windows service using the wrapper files that were included in release 1.4.0-RC3.

GeoServer starts and stops fine from the Start Menu… “C:\Program Files\Java\jdk1.5.0_09\bin\java.exe” -DGEOSERVER_DATA_DIR=“%GEOSERVER_DATA_DIR%” -Xmx300m -jar start.jar

… but does not start when I try to start it as a service using the java wrapper (i.e. C:\Program Files\GeoServer 1.4.0-RC3>wrapper.exe -r ./bin/wrapper/wrapper.conf)

The log file indicates that the JVM cannot find a class it is expecting (java.lang.NoClassDefFoundError: Files\GeoServer)

Here is a section of the wrapper log file, giving the context for the error.

STATUS | wrapper | 2006/11/15 11:02:38 | → Wrapper Started as Console
DEBUG | wrapper | 2006/11/15 11:02:38 | Using system timer.
DEBUG | wrapperp | 2006/11/15 11:02:38 | server listening on port 32000.
STATUS | wrapper | 2006/11/15 11:02:38 | Launching a JVM…
DEBUG | wrapper | 2006/11/15 11:02:38 | command: “C:\Program Files\Java\jdk1.5.0_09\bin\java” -Djetty.home=. -DGEOSERVER_DATA_DIR=C:\Program Files\GeoServer 1.4.0-RC3\webapps\geoserver\conf -Xms3m -Xmx64m -Djava.library.path=“lib” -classpath “bin/wrapper/lib/wrapper.jar;start.jar;lib/ant-1.6.4.jar;lib/commons-el-1.0.jar;lib/commons-lang-2.1.jar;lib/concurrent-1.3.4.jar;lib/db2jcc_dummy-8.2.1.jar;lib/geoapi-2.0.jar;lib/jasper-compiler-5.5.15.jar;lib/jasper-compiler-jdt-5.5.15.jar;lib/jasper-runtime-5.5.15.jar;lib/jcl104-over-slf4j-1.0.1.jar;lib/jdbc-stdext-2.0.jar;lib/jdom-1.0.jar;lib/jetty-6.0.1.jar;lib/jetty-util-6.0.1.jar;lib/jsp-api-2.0.jar;lib/jsr108-0.01.jar;lib/jta-1.0.1B.jar;lib/jts-1.7.1.jar;lib/servlet-api-2.5-6.0.1.jar;lib/slf4j-simple-1.0.1.jar;lib/vecmath-1.3.1.jar;lib/xercesImpl-2.6.2.jar;lib/xmlParserAPIs-2.6.2.jar” -Dwrapper.key=“mGaKb75GkUKFsfnW” -Dwrapper.port=32000 -Dwrapper.debug=“TRUE” -Dwrapper.use_system_time=“TRUE” -Dwrapper.version=“3.1.2” -Dwrapper.native_library=“wrapper” -Dwrapper.cpu.timeout=“10” -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.mortbay.start.Main etc/jetty.xml
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM started (PID=644)
INFO | jvm 1 | 2006/11/15 11:02:38 | java.lang.NoClassDefFoundError: Files\GeoServer
INFO | jvm 1 | 2006/11/15 11:02:38 | Exception in thread “main”
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM process exited with a code of 1, setting the wrapper exit code to 1.
ERROR | wrapper | 2006/11/15 11:02:38 | JVM exited while loading the application.
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM was only running for 0 seconds leading to a failed restart count of 1.
DEBUG | wrapper | 2006/11/15 11:02:38 | Waiting 5 seconds before launching another JVM.


View this message in context: Error starting Geoserver (1.4.0-RC3) as a Windows Service
Sent from the GeoServer - User mailing list archive at Nabble.com.

The issue in the wrapper here is that it isn't handling spaces in the path name of geoserver ("Program files"). You will have to move geoserver and the data directory to a path that does not contain any spaces.
It's a bit of an annoying problem; that one and a few others have forced us to make the wrapper a separate download for the official 1.4.0 release.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:

I am having difficulty getting GeoServer to run as a Windows service using the wrapper files that were included in release 1.4.0-RC3.

GeoServer starts and stops fine from the Start Menu... "C:\Program Files\Java\jdk1.5.0_09\bin\java.exe" -DGEOSERVER_DATA_DIR="%GEOSERVER_DATA_DIR%" -Xmx300m -jar start.jar

... but does not start when I try to start it as a service using the java wrapper (i.e. C:\Program Files\GeoServer 1.4.0-RC3>wrapper.exe -r ./bin/wrapper/wrapper.conf)

The log file indicates that the JVM cannot find a class it is expecting (java.lang.NoClassDefFoundError: Files\GeoServer)

Here is a section of the wrapper log file, giving the context for the error.

STATUS | wrapper | 2006/11/15 11:02:38 | --> Wrapper Started as Console
DEBUG | wrapper | 2006/11/15 11:02:38 | Using system timer.
DEBUG | wrapperp | 2006/11/15 11:02:38 | server listening on port 32000.
STATUS | wrapper | 2006/11/15 11:02:38 | Launching a JVM...
DEBUG | wrapper | 2006/11/15 11:02:38 | command: "C:\Program Files\Java\jdk1.5.0_09\bin\java" -Djetty.home=. -DGEOSERVER_DATA_DIR=C:\Program Files\GeoServer 1.4.0-RC3\webapps\geoserver\conf -Xms3m -Xmx64m -Djava.library.path="lib" -classpath "bin/wrapper/lib/wrapper.jar;start.jar;lib/ant-1.6.4.jar;lib/commons-el-1.0.jar;lib/commons-lang-2.1.jar;lib/concurrent-1.3.4.jar;lib/db2jcc_dummy-8.2.1.jar;lib/geoapi-2.0.jar;lib/jasper-compiler-5.5.15.jar;lib/jasper-compiler-jdt-5.5.15.jar;lib/jasper-runtime-5.5.15.jar;lib/jcl104-over-slf4j-1.0.1.jar;lib/jdbc-stdext-2.0.jar;lib/jdom-1.0.jar;lib/jetty-6.0.1.jar;lib/jetty-util-6.0.1.jar;lib/jsp-api-2.0.jar;lib/jsr108-0.01.jar;lib/jta-1.0.1B.jar;lib/jts-1.7.1.jar;lib/servlet-api-2.5-6.0.1.jar;lib/slf4j-simple-1.0.1.jar;lib/vecmath-1.3.1.jar;lib/xercesImpl-2.6.2.jar;lib/xmlParserAPIs-2.6.2.jar" -Dwrapper.key="mGaKb75GkUKFsfnW" -Dwrapper.port=32000 -Dwrapper.debug="TRUE" -Dwrapper.use_system_time="TRUE" -Dwrapper.version="3.1.2" -Dwrapper.native_library="wrapper" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.mortbay.start.Main etc/jetty.xml
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM started (PID=644)
INFO | jvm 1 | 2006/11/15 11:02:38 | java.lang.NoClassDefFoundError: Files\GeoServer
INFO | jvm 1 | 2006/11/15 11:02:38 | Exception in thread "main"
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM process exited with a code of 1, setting the wrapper exit code to 1.
ERROR | wrapper | 2006/11/15 11:02:38 | JVM exited while loading the application.
DEBUG | wrapper | 2006/11/15 11:02:38 | JVM was only running for 0 seconds leading to a failed restart count of 1.
DEBUG | wrapper | 2006/11/15 11:02:38 | Waiting 5 seconds before launching another JVM.
------------------------------------------------------------------------
View this message in context: Error starting Geoserver (1.4.0-RC3) as a Windows Service <http://www.nabble.com/Error-starting-Geoserver-(1.4.0-RC3)-as-a-Windows-Service-tf2637224.html#a7360877&gt;
Sent from the GeoServer - User <http://www.nabble.com/GeoServer---User-f1194.html&gt; mailing list archive at Nabble.com.
------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  

Installing geoserver so the path name does not contain spaces fixed the error
I was having.

I now get another error, which seems to be related a missing class
definition. The error log is shown below. Any suggestions on how to track
down the cause?

STATUS | wrapper | 2006/11/17 17:23:46 | --> Wrapper Started as Service
STATUS | wrapper | 2006/11/17 17:23:47 | Launching a JVM...
INFO | jvm 1 | 2006/11/17 17:23:47 | Wrapper (Version 3.1.2)
http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2006/11/17 17:23:47 |
INFO | jvm 1 | 2006/11/17 17:23:47 |
INFO | jvm 1 | 2006/11/17 17:23:47 | WrapperSimpleApp: Encountered an
error running main: java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/AntMain
INFO | jvm 1 | 2006/11/17 17:23:47 | java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/AntMain
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.defineClass1(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.security.AccessController.doPrivileged(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Class.forName0(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Class.forName(Class.java:164)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.isAvailable(Main.java:147)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.configure(Main.java:272)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.start(Main.java:450)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.main(Main.java:116)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.reflect.Method.invoke(Method.java:585)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:136)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Thread.run(Thread.java:595)
STATUS | wrapper | 2006/11/17 17:23:49 | <-- Wrapper Stopped

Brent Owens wrote:

The issue in the wrapper here is that it isn't handling spaces in the
path name of geoserver ("Program files"). You will have to move
geoserver and the data directory to a path that does not contain any
spaces.
It's a bit of an annoying problem; that one and a few others have forced
us to make the wrapper a separate download for the official 1.4.0 release.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:

I am having difficulty getting GeoServer to run as a Windows service
using the wrapper files that were included in release 1.4.0-RC3.
...

--
View this message in context: http://www.nabble.com/Error-starting-Geoserver-(1.4.0-RC3)-as-a-Windows-Service-tf2637224.html#a7412380
Sent from the GeoServer - User mailing list archive at Nabble.com.

In the wrapper.conf file, make sure the line:
*wrapper.java.classpath.3=lib/*.jar*
is included under the lines:

/# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=bin/wrapper/lib/wrapper.jar
wrapper.java.classpath.2=start.jar
/
This will include all the jars that are needed to start geoserver.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:

Installing geoserver so the path name does not contain spaces fixed the error
I was having.

I now get another error, which seems to be related a missing class
definition. The error log is shown below. Any suggestions on how to track
down the cause?

STATUS | wrapper | 2006/11/17 17:23:46 | --> Wrapper Started as Service
STATUS | wrapper | 2006/11/17 17:23:47 | Launching a JVM...
INFO | jvm 1 | 2006/11/17 17:23:47 | Wrapper (Version 3.1.2)
http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2006/11/17 17:23:47 | INFO | jvm 1 | 2006/11/17 17:23:47 | INFO | jvm 1 | 2006/11/17 17:23:47 | WrapperSimpleApp: Encountered an
error running main: java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/AntMain
INFO | jvm 1 | 2006/11/17 17:23:47 | java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/AntMain
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.defineClass1(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.defineClass(ClassLoader.java:620)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.access$100(URLClassLoader.java:56)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader$1.run(URLClassLoader.java:195)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.security.AccessController.doPrivileged(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClass(ClassLoader.java:306)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Class.forName0(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Class.forName(Class.java:164)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.isAvailable(Main.java:147)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.configure(Main.java:272)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.start(Main.java:450)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.mortbay.start.Main.main(Main.java:116)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.reflect.Method.invoke(Method.java:585)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:136)
INFO | jvm 1 | 2006/11/17 17:23:47 | at
java.lang.Thread.run(Thread.java:595)
STATUS | wrapper | 2006/11/17 17:23:49 | <-- Wrapper Stopped

Brent Owens wrote:
  

The issue in the wrapper here is that it isn't handling spaces in the path name of geoserver ("Program files"). You will have to move geoserver and the data directory to a path that does not contain any
spaces.
It's a bit of an annoying problem; that one and a few others have forced us to make the wrapper a separate download for the official 1.4.0 release.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:
    

I am having difficulty getting GeoServer to run as a Windows service using the wrapper files that were included in release 1.4.0-RC3.
...
      

Your suggestion solved the problem of the missing library.

I am now able to start GeoServer using the wrapper (i.e. wrapper.exe -c),
but I am not able to start GeoServer when it is installed as a Windows
service (i.e. wrapper.exe -i). When it is installed as a Windows service it
does not seem to be able to resolve the %GEOSERVER_DATA_DIR% evironmental
variable.

The following is a list of what I am currently experiencing. Any
suggestions for debugging this would be appreciated.

1. Starting GeoServer from the Start Menu... works fine
    Stopping GeoServer from the Start Menu... works fine

2. Testing the wrapper...
        C:\Program\Geoserver_1_4_0_RC3>wrapper.exe -c
./bin/wrapper/wrapper.conf
    Results:
        Geoserver is accessible at: http://localhost:8080/geoserver
    Wrapper Log messages:
        (No obvious errors in the wrapper log file.)

3a. Installing the Wrapper as a service...
        C:\Program\Geoserver_1_4_0_RC3>wrapper.exe -i
./bin/wrapper/wrapper.conf
    Wrapper Log message:
        STATUS | wrapper | 2006/11/22 16:46:39 | GeoServer installed.
    Result:
        Geoserver is listed as a service in the service control. (not
started;
                startup type=Automatic; Log On As: Local System)

3b. Starting the service...
    Result:
        The service status changes to 'Started'
        Geoserver is not accessible at: http://localhost:8080/geoserver and
the follow error is returned
            HTTP ERROR: 404
            NOT_FOUND
            RequestURI=/geoserver
            Powered by jetty://
   Wrapper Log messages:
...
INFO | jvm 1 | 2006/11/22 16:28:49 | ----------------------------------
INFO | jvm 1 | 2006/11/22 16:28:49 | - GEOSERVER_DATA_DIR:
C:\Program\GeoServer_1_4_0_RC3\%GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 | ----------------------------------
INFO | jvm 1 | 2006/11/22 16:28:49 | 3328 [WrapperSimpleAppMain] INFO
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Destroying singletons in factory
{org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[catalog,serviceFinder,wfs,wfsConfig,wfsRegisterar,wfsConfigRegisterar,wfsAbstractService,wfsService,wfsGetCapabilities,wfsDescribeFeatureType,wfsGetFeature,wfsLockFeature,wfsGetFeatureWithLock,wfsTransaction,config,geoServer,globalConfig,data,dataConfig,dataRegisterar,dataConfigRegisterar,globalConfigRegisterar,geoServerRegisterar,speedServiceStrategy,fileServiceStrategy,bufferServiceStrategy,partialBufferServiceStrategy,validation,validationConfig,validationRegisterar,validationConfigRegisterar,applicationState,applicationStateRegisterar,wms,wmsConfig,wmsRegisterar,wmsConfigRegisterar,wmsAbstractService,wmsService,wmsGetCapabilities,wmsDescribeFeatureType,wmsGetFeatureInfo,wmsGetLegendGraphic,wmsGetMap,wmsGetMapLegacy,wmsPutStyles,kmlReflector,PNGMapProducerFactory,JAIMapProducerFactory,SVGMapProducerFactory,GIFMapProducerFactory,KMLMapProducerFactory,KMZMapProducerFactory,PDFMapProducerFactory];
root of BeanFactory hierarchy}
INFO | jvm 1 | 2006/11/22 16:28:49 | 3328 [WrapperSimpleAppMain]
ERROR org.springframework.web.context.ContextLoader - Context
initialization failed
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'wfs' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/wfs-1.4.0-RC3.jar!/applicationContext.xml]:
Can't resolve reference to bean 'config' while setting property
'constructor argument'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'config' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/main-1.4.0-RC3.jar!/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'config' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/main-1.4.0-RC3.jar!/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 | at
org.vfny.geoserver.global.xml.XMLConfigReader.load(XMLConfigReader.java:171)
--
View this message in context: http://www.nabble.com/Error-starting-Geoserver-(1.4.0-RC3)-as-a-Windows-Service-tf2637224.html#a7500799
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Tyler,

It appears that as a service it is not able to process environment variables. That is why the "%GEOSERVER_DATA_DIR%" string is being tacked onto the end of the geoserver install directory, and not actually grabbing the proper value.

This page here has some info on using environment variables:http://wrapper.tanukisoftware.org/doc/english/props-envvars.html
I have tried to get it to work but with little success. One thing you can do is to just use the default (fallback) data_dir location which is located under [geoserver_home]/webapps/geoserver/conf, just make sure no data_dir environment variable is set and it is also not defined in the web.xml file.
I will try and play with the wrapper some more today to see if I can get the environment variable working.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:

Your suggestion solved the problem of the missing library.

I am now able to start GeoServer using the wrapper (i.e. wrapper.exe -c),
but I am not able to start GeoServer when it is installed as a Windows
service (i.e. wrapper.exe -i). When it is installed as a Windows service it
does not seem to be able to resolve the %GEOSERVER_DATA_DIR% evironmental
variable.

The following is a list of what I am currently experiencing. Any
suggestions for debugging this would be appreciated.

1. Starting GeoServer from the Start Menu... works fine
    Stopping GeoServer from the Start Menu... works fine

2. Testing the wrapper...
        C:\Program\Geoserver_1_4_0_RC3>wrapper.exe -c
./bin/wrapper/wrapper.conf
    Results:
        Geoserver is accessible at: http://localhost:8080/geoserver
    Wrapper Log messages:
        (No obvious errors in the wrapper log file.)

3a. Installing the Wrapper as a service...
        C:\Program\Geoserver_1_4_0_RC3>wrapper.exe -i
./bin/wrapper/wrapper.conf
    Wrapper Log message:
        STATUS | wrapper | 2006/11/22 16:46:39 | GeoServer installed.
    Result:
        Geoserver is listed as a service in the service control. (not
started;
                startup type=Automatic; Log On As: Local System)

3b. Starting the service...
    Result:
        The service status changes to 'Started'
        Geoserver is not accessible at: http://localhost:8080/geoserver and
the follow error is returned
            HTTP ERROR: 404
            NOT_FOUND
            RequestURI=/geoserver
            Powered by jetty://
   Wrapper Log messages:
...
INFO | jvm 1 | 2006/11/22 16:28:49 | ----------------------------------
INFO | jvm 1 | 2006/11/22 16:28:49 | - GEOSERVER_DATA_DIR:
C:\Program\GeoServer_1_4_0_RC3\%GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 | ----------------------------------
INFO | jvm 1 | 2006/11/22 16:28:49 | 3328 [WrapperSimpleAppMain] INFO
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Destroying singletons in factory
{org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[catalog,serviceFinder,wfs,wfsConfig,wfsRegisterar,wfsConfigRegisterar,wfsAbstractService,wfsService,wfsGetCapabilities,wfsDescribeFeatureType,wfsGetFeature,wfsLockFeature,wfsGetFeatureWithLock,wfsTransaction,config,geoServer,globalConfig,data,dataConfig,dataRegisterar,dataConfigRegisterar,globalConfigRegisterar,geoServerRegisterar,speedServiceStrategy,fileServiceStrategy,bufferServiceStrategy,partialBufferServiceStrategy,validation,validationConfig,validationRegisterar,validationConfigRegisterar,applicationState,applicationStateRegisterar,wms,wmsConfig,wmsRegisterar,wmsConfigRegisterar,wmsAbstractService,wmsService,wmsGetCapabilities,wmsDescribeFeatureType,wmsGetFeatureInfo,wmsGetLegendGraphic,wmsGetMap,wmsGetMapLegacy,wmsPutStyles,kmlReflector,PNGMapProducerFactory,JAIMapProducerFactory,SVGMapProducerFactory,GIFMapProducerFactory,KMLMapProducerFactory,KMZMapProducerFactory,PDFMapProducerFactory];
root of BeanFactory hierarchy}
INFO | jvm 1 | 2006/11/22 16:28:49 | 3328 [WrapperSimpleAppMain]
ERROR org.springframework.web.context.ContextLoader - Context
initialization failed
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'wfs' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/wfs-1.4.0-RC3.jar!/applicationContext.xml]:
Can't resolve reference to bean 'config' while setting property
'constructor argument'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'config' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/main-1.4.0-RC3.jar!/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'config' defined in URL
[jar:file:/C:/Program/GeoServer_1_4_0_RC3/webapps/geoserver/WEB-INF/lib/main-1.4.0-RC3.jar!/applicationContext.xml]:
Initialization of bean failed; nested exception is
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.springframework.beans.factory.BeanInitializationException: Error
creating xml config reader; nested exception is
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 |
org.vfny.geoserver.global.ConfigurationException: java.lang.Exception:
File does not exist: %GEOSERVER_DATA_DIR%
INFO | jvm 1 | 2006/11/22 16:28:49 | at
org.vfny.geoserver.global.xml.XMLConfigReader.load(XMLConfigReader.java:171)
  

Brent,

After looking through the web page you suggested, I think I figured out my
problem. I had set up GEOSERVER_DATA_DIR as a user environment variable
instead of a system environment variable. Now that I have created a system
environment variable, geoserver starts up normally. Thank you.

Brent Owens wrote:

Hi Tyler,

It appears that as a service it is not able to process environment
variables. That is why the "%GEOSERVER_DATA_DIR%" string is being tacked
onto the end of the geoserver install directory, and not actually
grabbing the proper value.

...

--
View this message in context: http://www.nabble.com/Error-starting-Geoserver-(1.4.0-RC3)-as-a-Windows-Service-tf2637224.html#a7550958
Sent from the GeoServer - User mailing list archive at Nabble.com.

Cool, glad to hear it is working.
I will add this experience to the FAQ.

Brent Owens
(The Open Planning Project)

Tyler Erickson wrote:

Brent,

After looking through the web page you suggested, I think I figured out my
problem. I had set up GEOSERVER_DATA_DIR as a user environment variable
instead of a system environment variable. Now that I have created a system
environment variable, geoserver starts up normally. Thank you.

Brent Owens wrote:
  

Hi Tyler,

It appears that as a service it is not able to process environment variables. That is why the "%GEOSERVER_DATA_DIR%" string is being tacked onto the end of the geoserver install directory, and not actually grabbing the proper value.

...