[Geoserver-users] packaging geoserver.war

hi all,

i decided to deploy geoserver in tomcat container and i have few questions :

- how can i package the geoserver.war with the GEOSERVER_DATA_DIR i want ?
so that when tomcat deploy it, it will use the right data

- how can i allow only one ip adresse to request geoserver ?

any put_in_production link ?

thanks in advance !

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre a écrit :

hi all,

i decided to deploy geoserver in tomcat container and i have few questions :

- how can i package the geoserver.war with the GEOSERVER_DATA_DIR i want ?
so that when tomcat deploy it, it will use the right data
  

could it be configDirectory ???

mvn install -DconfigDirectory=/home/bob/geoserver/configuration -DconfigId=citewfs

what configId is for ?

- how can i allow only one ip adresse to request geoserver ?

any put_in_production link ?

thanks in advance !

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

mvn install -DconfigDirectory=/home/bob/geoserver/configuration -DconfigId=citewfs
  

it is the right way to include data in war file.
configDirectory is the directory of configId data for your application. configId is also a directory !!!

so i have my war file, i try to deploy it in tomcat , but i did not work :
pb with claa not found :
INFO: Illegal access: this web application instance has been stopped already. Could not load org.hsqldb.lib.IntKeyIntVal
ueHashMap$KeySet. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to a
ttempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1248)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1208)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.hsqldb.lib.IntKeyIntValueHashMap.keySet(Unknown Source)
        at org.hsqldb.CompiledStatementManager.removeSession(Unknown Source)
        at org.hsqldb.Session.close(Unknown Source)
        at org.hsqldb.jdbc.jdbcConnection.close(Unknown Source)
        at org.geotools.referencing.factory.epsg.DirectEpsgFactory.dispose(DirectEpsgFactory.java:2965)
        at org.geotools.referencing.factory.DeferredAuthorityFactory$Disposer.run(DeferredAuthorityFactory.java:224)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Exception in thread "Timer-0" java.lang.NoClassDefFoundError: org/hsqldb/lib/IntKeyIntValueHashMap$KeySet
        at org.hsqldb.lib.IntKeyIntValueHashMap.keySet(Unknown Source)
        at org.hsqldb.CompiledStatementManager.removeSession(Unknown Source)
        at org.hsqldb.Session.close(Unknown Source)
        at org.hsqldb.jdbc.jdbcConnection.close(Unknown Source)
        at org.geotools.referencing.factory.epsg.DirectEpsgFactory.dispose(DirectEpsgFactory.java:2965)
        at org.geotools.referencing.factory.DeferredAuthorityFactory$Disposer.run(DeferredAuthorityFactory.java:224)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
18 janv. 2008 16:59:54 org.apache.catalina.startup.HostConfig deployWAR

and pb with :
18 janv. 16:59:59 ERROR [context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Cannot register alias 'catalog' for bean name 'data': it's already registered for bean name 'data'
        at org.springframework.beans.factory.support.AbstractBeanFactory.registerAlias(AbstractBeanFactory.java:461)

any ideas ?

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

could it be configDirectory ???

mvn install -DconfigDirectory=/home/bob/geoserver/configuration -DconfigId=citewfs

what configId is for ?

- how can i allow only one ip adresse to request geoserver ?

This is the correct way. 'configDirectory' points to a repository of
various data directories, and 'configId' is the name of the actual data
directory. I admit this is a bit confusing... we should probably just
have one command line parameter for it.

any put_in_production link ?

thanks in advance !

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

So we have geoserver_data repository pointed by in web.xml file.
          <context-param>
                   <param-name>GEOSERVER_DATA_DIR</param-name>
                   <param-value>/home/geindre/bin/geoserver-1.6/flysafe_data</param-value>
          </context-param>

when we package the war file :
mvn clean -Dmaven.test.skip=true package -o -DconfigDirectory=/home/geindre/bin/geoserver-1.6 -DconfigId=flysafe_data

it seems that my flysafe_data directory is copied to data directory at the top of the war file.

But web.xml is not changed, isn't it ?

How can i refer this inside war data repository ?
How can i use my dev environment to package the application without changing web.xml file ??

Other questions : how can i allow only one ip adresse to request geoserver ?
example : allows only localhost to request the http://mymachine:tomcatPort/mygeoserverInstance/wfs

This is the correct way. 'configDirectory' points to a repository of
various data directories, and 'configId' is the name of the actual data
directory. I admit this is a bit confusing... we should probably just
have one command line parameter for it.

Hi Sébastien,

I will agree with you, this is confusing. When you build with
configId=.. configDirectory=.. you are correct, the contents of the
datadirectory is copied into the war. The web.xml GEOSERVER_DATA_DIR
context parameter is completely unrelated, and is another way to set
your data directory.

I recommend not setting configId and configDirectory (since when you
have lots of data does not make sense). This will build with the
"minimal" configuration. Then deploy the war and change web.xml to point
to your new data directory.

However... if you are constantly building a new war then this can become
tiresome and the configId / configDirectory way may be more appealing.

-Justin

Sébastien Geindre wrote:

So we have geoserver_data repository pointed by in web.xml file.
         <context-param>
                  <param-name>GEOSERVER_DATA_DIR</param-name>
                 
<param-value>/home/geindre/bin/geoserver-1.6/flysafe_data</param-value>
         </context-param>

when we package the war file :
mvn clean -Dmaven.test.skip=true package -o
-DconfigDirectory=/home/geindre/bin/geoserver-1.6 -DconfigId=flysafe_data

it seems that my flysafe_data directory is copied to data directory at
the top of the war file.

But web.xml is not changed, isn't it ?

How can i refer this inside war data repository ?
How can i use my dev environment to package the application without
changing web.xml file ??

Other questions : how can i allow only one ip adresse to request
geoserver ?
example : allows only localhost to request the
http://mymachine:tomcatPort/mygeoserverInstance/wfs

This is the correct way. 'configDirectory' points to a repository of
various data directories, and 'configId' is the name of the actual data
directory. I admit this is a bit confusing... we should probably just
have one command line parameter for it.

!DSPAM:4007,4794abb5127381137850744!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira a écrit :

Hi Sébastien,

I will agree with you, this is confusing. When you build with
configId=.. configDirectory=.. you are correct, the contents of the
datadirectory is copied into the war. The web.xml GEOSERVER_DATA_DIR
context parameter is completely unrelated, and is another way to set
your data directory.

I recommend not setting configId and configDirectory (since when you
have lots of data does not make sense). This will build with the
"minimal" configuration. Then deploy the war and change web.xml to point
to your new data directory.
  

i thought that deploying a war with the data (it is more configuration file, the 'heavy' data are in database)within was elegant way of delivering software to IT people for instance...

make the war, deploy war, deploy data dir, modify web.xml...

i d like make the war and deploy it.
data dir should be inside the war and web.xml referenced it.
i hope it is possible...

However... if you are constantly building a new war then this can become
tiresome and the configId / configDirectory way may be more appealing.

-Justin

Sébastien Geindre wrote:
  

So we have geoserver_data repository pointed by in web.xml file.
         <context-param>
                  <param-name>GEOSERVER_DATA_DIR</param-name>
                 <param-value>/home/geindre/bin/geoserver-1.6/flysafe_data</param-value>
         </context-param>

when we package the war file :
mvn clean -Dmaven.test.skip=true package -o
-DconfigDirectory=/home/geindre/bin/geoserver-1.6 -DconfigId=flysafe_data

it seems that my flysafe_data directory is copied to data directory at
the top of the war file.

But web.xml is not changed, isn't it ?

How can i refer this inside war data repository ?
How can i use my dev environment to package the application without
changing web.xml file ??

Other questions : how can i allow only one ip adresse to request
geoserver ?
example : allows only localhost to request the
http://mymachine:tomcatPort/mygeoserverInstance/wfs
    

This is the correct way. 'configDirectory' points to a repository of
various data directories, and 'configId' is the name of the actual data
directory. I admit this is a bit confusing... we should probably just
have one command line parameter for it.
      

!DSPAM:4007,4794abb5127381137850744!

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr