Are you running this on a server that has an XML parser that doesn't
support XSDs?  I suspect your problem is due to a server + JDK
mismatch. I'd recommend trying Tomcat 5.5.x with JDK 5.

Matt

On 5/21/07, nmall <[EMAIL PROTECTED]> wrote:

Hi Matt

 Thanks for the reply. I am still struggling with the following problem.
When I inlcude the following header, the xerces parse r throws errors as
follows. If I simply use spring-beans-2.0.dtd, it doesn't recognize the
<aop:config> stuff in security.xml. Any help would be appreciated. Why am I
getting this error in this project only.

The header:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:aop="http://www.springframework.org/schema/aop";
 xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";>

[ERROR] Exception sending context initialized event to listener instance of
clas
s org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 3 in
XML do
cument from ServletContext resource [/WEB-INF/security.xml] is invalid;
nested e
xception is org.xml.sax.SAXParseException: Document root element "beans",
must m
atch DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "beans", must match
DOCTYPE
 root "null".
        at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unkno
wn Source)
        at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
 Source)
        at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Sourc
e)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElemen
t(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanR
ootElementHook(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadB
eanDefinitions(XmlBeanDefinitionReader.java:222)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:173)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
nDefinitions(XmlBeanDefinitionReader.java:148)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)
        at
org.springframework.beans.factory.support.AbstractBeanDefinitionReade
r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
        at
org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:126)
        at
org.springframework.web.context.support.XmlWebApplicationContext.load
BeanDefinitions(XmlWebApplicationContext.java:94)
        at
org.springframework.context.support.AbstractRefreshableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
        at
org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:269)
        at
org.springframework.web.context.support.AbstractRefreshableWebApplica
tionContext.refresh(AbstractRefreshableWebApplicationContext.java:134)




mraible wrote:
>
> It seems like you're doing things the hard way - why do you need to
> initialize your Spring ApplicationContext programmatically?  If you
> load it from the classpath, it won't be an XmlWebApplicationContext,
> which is what you might be looking for.
>
> Matt
>
> On 5/21/07, nmall <[EMAIL PROTECTED]> wrote:
>>
>> hi,
>>
>>  My application requires that I initialize the Spring application Context
>> programmatically where I initialize a bunch of other stuff ( code below)
>> instead of using ContextLoaderListener in the web.xml
>>  appContext = new ClassPathXmlApplicationContext(
>>                 new String[] {"applicationContext.xml"});
>>
>> Now, when I add the web filters/struts filters provided by appfuse, I get
>> errors about NOT FINDING the applicationContext. How can I get these
>> filters
>> to work. Thanks a lot for your help!!!
>>
>>  [ERROR] Exception starting filter securityFilter
>> java.lang.IllegalStateException: No WebApplicationContext found: no
>> ContextLoade
>> rListener registered?
>>         at
>> org.springframework.web.context.support.WebApplicationContextUtils.ge
>> tRequiredWebApplicationContext(WebApplicationContextUtils.java:84)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.getContext(FilterToBeanProxy
>> .java:177)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.doInit(FilterToBeanProxy.jav
>> a:119)
>>         at
>> org.acegisecurity.util.FilterToBeanProxy.init(FilterToBeanProxy.java:
>> 189)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio
>> nFilterConfig.java:223)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica
>> tionFilterConfig.java:304)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi
>> lterConfig.java:77)
>>         at
>> org.apache.catalina.core.StandardContext.filterStart(StandardContext.
>> java:3598)
>>         at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
>> 168)
>>         at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
>>
>>         at
>> org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
>>         at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
>>
>>         at
>> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
>> )
>>         at org.apache.catalina.startup.Embedded.start(Embedded.java:821)
>>         at
>> org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
>> jo.java:253)
>>         at
>> org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
>> :113)
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> nManager.java:443)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:539)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
>> Goal(DefaultLifecycleExecutor.java:493)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:463)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:311)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:278)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:143)
>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>         at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>
>>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> [ERROR] Exception starting filter gzipFilter
>> java.lang.ClassNotFoundException:
>> net.sf.ehcache.constructs.web.filter.GzipFilte
>> r
>>         at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
>> der.java:1352)
>>         at
>> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
>> der.java:1198)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio
>> nFilterConfig.java:209)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica
>> tionFilterConfig.java:304)
>>         at
>> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi
>> lterConfig.java:77)
>>         at
>> org.apache.catalina.core.StandardContext.filterStart(StandardContext.
>> java:3598)
>>         at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
>> 168)
>>         at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
>>
>>         at
>> org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
>>         at
>> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
>>
>>         at
>> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442
>> )
>>         at org.apache.catalina.startup.Embedded.start(Embedded.java:821)
>>         at
>> org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo
>> jo.java:253)
>>         at
>> org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
>> :113)
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
>> nManager.java:443)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
>> ultLifecycleExecutor.java:539)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
>> Goal(DefaultLifecycleExecutor.java:493)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
>> ltLifecycleExecutor.java:463)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
>> dleFailures(DefaultLifecycleExecutor.java:311)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
>> ts(DefaultLifecycleExecutor.java:278)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
>> fecycleExecutor.java:143)
>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>> java:39)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>>         at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Spring-applicationContext-tf3792315s2369.html#a10725328
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/Spring-applicationContext-tf3792315s2369.html#a10731546
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to