I couldn't get this to work after spending around 2 days. I'm using the war
file setup. Initially had trouble with classpaths and was getting
ClassNotFoundExceptions. Now these are gone. However I see the following
exceptions:
2007-04-25 18:34:32,797 [10] INFO
org.springframework.web.context.ContextLoader - Root WebApplicationContext:
initialization started
2007-04-25 18:34:32,798 [10] INFO
org.apache.catalina.core.ApplicationContext - Loading Spring root
WebApplicationContext
2007-04-25 18:34:33,011 [10] INFO
org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML
bean definitions from class path resource
[WEB-INF/classes/applicationContext.xml]
2007-04-25 18:34:33,216 [10] INFO
org.springframework.context.support.AbstractRefreshableApplicationContext -
Bean factory for application context [Root WebApplicationContext]:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy
2007-04-25 18:34:33,256 [10] INFO
org.springframework.context.support.AbstractApplicationContext - 2 beans
defined in application context [Root WebApplicationContext]
2007-04-25 18:34:33,291 [10] INFO
org.springframework.context.support.AbstractApplicationContext - Unable to
locate MessageSource with name 'messageSource': using default
[org.springframework.context.support.DelegatingMessageSource@anonymised.com]
2007-04-25 18:34:33,299 [10] INFO
org.springframework.context.support.AbstractApplicationContext - Unable to
locate ApplicationEventMulticaster with name 'applicationEventMulticaster':
using default
[org.springframework.context.event.SimpleApplicationEventMulticaster@anonymised.com]
2007-04-25 18:34:33,317 [10] INFO
org.springframework.ui.context.support.UiApplicationContextUtils - Unable to
locate ThemeSource with name 'themeSource': using default
[org.springframework.ui.context.support.ResourceBundleThemeSource@anonymised.com]
2007-04-25 18:34:33,321 [10] INFO
org.springframework.beans.factory.support.DefaultListableBeanFactory -
Pre-instantiating singletons in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy]
2007-04-25 18:34:33,409 [10] INFO
org.springframework.beans.factory.support.AbstractBeanFactory - Destroying
singletons in factory
{org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy}
2007-04-25 18:34:33,410 [10] MAJOR
org.springframework.web.context.ContextLoader - Context initialization
failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'applicationState' defined in class path resource
[WEB-INF/classes/applicationContext.xml]: Can't resolve reference to bean
'data' while setting property 'constructor argument'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'data' is defined:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'data' is defined:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:349)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:671)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveConstructorArguments(AbstractAutowireCapableBeanFactory.java:713)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:611)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:329)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
I'd really appreciate if anyone can help me out here.
I couldn't get this to work after spending around 2 days. I'm using the war
file setup. Initially had trouble with classpaths and was getting
ClassNotFoundExceptions. Not these are gone. However I see the following
exceptions:
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'applicationState' defined in class path resource
[WEB-INF/classes/applicationContext.xml]: Can't resolve reference to bean
'data' while setting property 'constructor argument'; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'data' is defined:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [applicationState,applicationStateRegisterar]; root of
BeanFactory hierarchy
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'data' is defined:
Well, this seems to be a variation of the class not found... the bean "data", defined in spring context file of the data module, cannot be found. Are you sure data.jar from Geoserver is in your classpath, and
that all applicationContext.xml files are in place? If you built the
jars with maven they should be in the right place, but if you did
the same with some other tool, they may have been shaved off.
Thanks for that. It's true that it's not being able to load the applicationContext.xml files. Here is the exception I see:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from
URL [file:/opt/web/geoserver/geoserver.war/WEB-INF/classes/applicationContext.xml]; nested exception is java.io.FileNotFoundException:
/opt/web/geoserver/geoserver.war/WEB-INF/classes/applicationContext.xml (No such file or directory)
Ouch ouch ouch... wrong place that one. Each of the Geoserver jars contains its own applicationContext.xml file, did you try to compile
geoserver and generating a single war directly from the sources?
That won't work, you have to generate separate jars so that each
one preserves its copy of the applicationContext.xml file.
It's the way we use to wire up modular plugins, on startup
Spring will look in each jar for an applicationContext.xml
file and load it along the others.
I didn't compile. I'm directly using the war file available for download. Since I'm using EmbeddedTomcat, I had to add all the jars in WEB-INF/lib to the classpath. This is from WEB-INF/web.xml:
This isn't really working for some reason. Am I missing anything from the classpath ?
I really have no idea...
We do use embedded Jetty for testing and it works fine (if you have source, see Start.java in the web module test sources), but no-one among us ever tried playing with embedded tomcat.
Trying a totally uneducated guess because I have no other solid lead: does the embedded version play tricks with the classloader?
I don't really know what tricks are being applied by classloader. Is there any chance that application expects the war file to be expanded to webapps/geoserver.war/ folder ?
Regards,
Enamul Haque
R & D, Redknee Inc.
-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Thursday, April 26, 2007 4:05 AM
To: Enamul Haque
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Embedded Tomcat 5.5 with Geoserver
Enamul Haque ha scritto:
I didn't compile. I'm directly using the war file available for download. Since I'm using EmbeddedTomcat, I had to add all the jars in WEB-INF/lib to the classpath. This is from WEB-INF/web.xml:
This isn't really working for some reason. Am I missing anything from the classpath ?
I really have no idea...
We do use embedded Jetty for testing and it works fine (if you have
source, see Start.java in the web module test sources), but no-one among
us ever tried playing with embedded tomcat.
Trying a totally uneducated guess because I have no other solid lead:
does the embedded version play tricks with the classloader?
The reason for asking this is that there is a applicationContext.xml file that is loaded from WEB-INF/classes/applicationContext.xml rather than a jar file.
Regards,
Enamul Haque
R & D, Redknee Inc.
-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Thursday, April 26, 2007 4:05 AM
To: Enamul Haque
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Embedded Tomcat 5.5 with Geoserver
Enamul Haque ha scritto:
I didn't compile. I'm directly using the war file available for download. Since I'm using EmbeddedTomcat, I had to add all the jars in WEB-INF/lib to the classpath. This is from WEB-INF/web.xml:
This isn't really working for some reason. Am I missing anything from the classpath ?
I really have no idea...
We do use embedded Jetty for testing and it works fine (if you have
source, see Start.java in the web module test sources), but no-one among
us ever tried playing with embedded tomcat.
Trying a totally uneducated guess because I have no other solid lead:
does the embedded version play tricks with the classloader?
I don't really know what tricks are being applied by classloader. Is there any chance that application expects the war file to be expanded to webapps/geoserver.war/ folder ?
I got geoserver running! For some reason it won't take the appbase and it seems to be looking at web/Geoserver when it really should be looking at web/webapps/Geoserver.
I'm thinking about using Oracle (sorry, can't use posgis because my app already uses oracle and geoserver must continue doing so) + geoserver. However, I need to be able to import data into oracle db from existing shapefiles. Is there any tool that will do the migration for me ? Suggestions ?
Regards,
Enamul Haque
R & D, Redknee Inc.
-----Original Message-----
From: Andrea Aime [mailto:aaime@anonymised.com]
Sent: Thursday, April 26, 2007 4:46 AM
To: Enamul Haque
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Embedded Tomcat 5.5 with Geoserver
Enamul Haque ha scritto:
I don't really know what tricks are being applied by classloader. Is there any chance that application expects the war file to be expanded to webapps/geoserver.war/ folder ?
I got geoserver running! For some reason it won't take the appbase
and it seems to be looking at web/Geoserver when it really should be
looking at web/webapps/Geoserver.
Nice! Any chance you may want to write a little page about how to
setup geoserver running in embedded tomcat?
I'm thinking about using Oracle (sorry, can't use posgis because my
app already uses oracle and geoserver must continue doing so) +
geoserver. However, I need to be able to import data into oracle db
from existing shapefiles. Is there any tool that will do the
migration for me ? Suggestions ?
I've been luckier with OGR, but you need to find a version of OGR
compiled with the Oracle extensions, and the standard distribution
is not. The one distributed along MS4W (http://www.maptools.org/ms4w/)
is thought, and I ended up using that one.