Announcement Announcement Module
Collapse
No announcement yet.
configuring Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • configuring Spring

    Where in the documentation is this topic discussed?

    I am using Tapestry for my presentation so I would have to integrate Spring with it as well as Hibernate and xdoclet.

    I would like to use the ApplicationContext and I read in a tutorial (http://www.theserverside.com/article...r/chapter2.pdf) that I needed to add a <listener> to the web.xml file.

    So I added:

    <listener>
    <listener-class> org.springframework.web.context.ContextLoaderListe ner
    </listener-class>
    </listener>



    inside the <webapp> tags and received an error from Tomcat:


    Aug 27, 2004 1:08:59 PM org.apache.commons.digester.Digester error
    SEVERE: Parse Error at line 32 column 11: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
    org.xml.sax.SAXParseException: The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(U nknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleE ndElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.endElem ent(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)
    at org.apache.xerces.parsers.DTDConfiguration.parse(U nknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)
    at org.apache.commons.digester.Digester.parse(Digeste r.java:1548)
    at org.apache.catalina.startup.ContextConfig.applicat ionConfig(ContextConfig.java:282)
    at org.apache.catalina.startup.ContextConfig.start(Co ntextConfig.java:639)
    at org.apache.catalina.startup.ContextConfig.lifecycl eEvent(ContextConfig.java:243)
    at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:166)
    at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3587)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1188)
    at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:754)
    at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1188)
    at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:363)
    at org.apache.catalina.core.StandardService.start(Sta ndardService.java:497)
    at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:2190)
    at org.apache.catalina.startup.Catalina.start(Catalin a.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catal ina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catal ina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:203)

  • #2
    You must pay attention where you add the listener in web.xml
    The exact sequence of XMl tags in web.xml is provided in the stackTrace:
    Code:
    "&#40;icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*&#41;
    so, you should add <listener> ...</listener> after filter-mapping and before servlet.

    HTH

    Comment


    • #3
      I wasn't aware of that, thank you.

      Comment


      • #4
        HISPACTA

        You can have a look at HISPACTA (HIbernate, SPring, ACegi security and TApestry) example application at http://sourceforge.net/projects/hispacta . This may show you solutions to some common problems.

        Comment

        Working...
        X