Results 1 to 4 of 4
  1. #1
    Ms.Ranjan is offline Member
    Join Date
    Jun 2008
    Posts
    85
    Rep Power
    0

    Default java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet

    Hi all
    I am trying to work out struts2 tutorial.This is the tutorial link that I followed Dev talks blog: Eclipse Galileo and Struts2
    Below is the exception I get.

    Java Code:
    Mar 15, 2010 9:47:02 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: Error loading WebappClassLoader
      delegate: false
      repositories:
        /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@115273a
     org.springframework.web.servlet.DispatcherServlet
    java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Mar 15, 2010 9:47:02 AM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /SpringMVCTutorial threw load() exception
    java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Mar 15, 2010 9:47:02 AM org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet action as unavailable
    Mar 15, 2010 9:47:02 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: Error loading WebappClassLoader
      delegate: false
      repositories:
        /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@115273a
     org.apache.struts.action.ActionServlet
    java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Mar 15, 2010 9:47:02 AM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /StrutsHelloWorld threw load() exception
    java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1386)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1232)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Mar 15, 2010 9:47:02 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    INFO: Parsing configuration file [struts-default.xml]
    Mar 15, 2010 9:47:02 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping
    Mar 15, 2010 9:47:02 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
    INFO: Parsing configuration file [struts-plugin.xml]
    Mar 15, 2010 9:47:02 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
    SEVERE: Document root element "struts", must match DOCTYPE root "unspecified". at (null:3:9)
    org.xml.sax.SAXParseException: Document root element "struts", must match DOCTYPE root "unspecified".
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    	at javax.xml.parsers.SAXParser.parse(Unknown Source)
    	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:893)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:143)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:110)
    	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:168)
    	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
    	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
    	at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
    	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3666)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4258)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Mar 15, 2010 9:47:02 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
    SEVERE: Dispatcher initialization failed
    Unable to load configuration. - file:/C:/jeewebworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/GalileoStruts2Example/WEB-INF/classes/struts.xml:3:9
    	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
    	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
    	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
    	at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
    	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
    	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
    	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3666)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4258)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Caused by: Unable to load file:/C:/jeewebworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/GalileoStruts2Example/WEB-INF/classes/struts.xml - file:/C:/jeewebworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/GalileoStruts2Example/WEB-INF/classes/struts.xml:3:9
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:898)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:143)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:110)
    	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:168)
    	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    	... 21 more
    Caused by: Document root element "struts", must match DOCTYPE root "unspecified". - file:/C:/jeewebworkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/GalileoStruts2Example/WEB-INF/classes/struts.xml:3:9
    	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:115)
    	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:893)
    	... 25 more
    Caused by: org.xml.sax.SAXParseException: Document root element "struts", must match DOCTYPE root "unspecified".
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    	at javax.xml.parsers.SAXParser.parse(Unknown Source)
    	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:113)
    	... 26 more
    My struts.xml file is in Web-inf/classes folder.I have included the jar file in the web-inf/lib folder.The list of jar files are

    1.commons-fileupload-1.2.1.jar
    2.commons-io-1.3.2.jar
    3.commons-logging-1.0.4.jar
    4.freemarker-2.3.15.jar
    5.ognl-2.7.3.jar
    6.struts2-core-2.1.8.1.jar
    7.xwork-core-2.1.6.jar

    Can someone help me,to work this tutorial out.I want to learn struts2 and I'm just stuck with this tutorial

  2. #2
    Ms.Ranjan is offline Member
    Join Date
    Jun 2008
    Posts
    85
    Rep Power
    0

    Default

    The problem is solved.I had a problem in my struts.xml file.By doctype was not proper.

    Thanks all.

  3. #3
    yeahlean is offline Member
    Join Date
    Aug 2010
    Posts
    1
    Rep Power
    0

    Default

    I'm very new to strut. I'm getting the same error when I tried to run a simple HelloWorld application. Could you please be more explicit about the change you made in your strut.xml (before and after the change would help)?
    Last edited by yeahlean; 08-11-2010 at 05:39 PM. Reason: typo

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    yeahlean, since this is your own new problem, please start your own thread for this rather than re-animate a dead thread. You may link to this if you wish. I'm locking this thread.

Similar Threads

  1. Replies: 5
    Last Post: 03-17-2011, 02:26 PM
  2. java.lang.ClassNotFoundException
    By ravian in forum New To Java
    Replies: 1
    Last Post: 01-07-2008, 10:31 AM
  3. web.xml for ActionServlet (Struts)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-27-2007, 09:54 AM
  4. Replies: 1
    Last Post: 07-23-2007, 11:54 PM
  5. Replies: 1
    Last Post: 06-27-2007, 05:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •