Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

plz solve this problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am struggling with the problem in struts config file.my class files are login/getDataForm,login/getDataAction.tomcat console displays this errors:

SEVERE: Parse Fatal Error at line 17 column 11: Element type "action" must be fllowed by either attribute specifications, ">" or "/>".
org.xml.sax.SAXParseException: Element type "action" must be followed by either attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSA
ParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalErr
r(ErrorHandlerWrapper.java:215)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
XMLErrorReporter.java:386)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(
MLScanner.java:1438)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.sca
StartElement(XMLNSDocumentScannerImpl.java:218)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerIm
l$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerIm
l.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(
ML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(
ML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser
java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(A
stractSAXParser.java:1242)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionS
rvlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServle
.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper
java:1053)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:8
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardConte
t.java:3817)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:
079)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas
.java:755)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:7
9)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.ja
a:886)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.
ava:849)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:47
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.jav
:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011

at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:43
)
at org.apache.catalina.core.StandardService.start(StandardService.java:
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:20
0)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Jul 17, 2006 3:58:07 PM org.apache.struts.action.ActionServlet handleConfigExce
tion
SEVERE: Parsing error processing resource path /WEB-INF/struts-config.xml
org.xml.sax.SAXParseException: Element type "action" must be followed by either
attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(A
stractSAXParser.java:1269)
at org.apache.commons.digester.Digester.parse(Digester.java:1572)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionS
rvlet.java:738)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServle
.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper
java:1053)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:8
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardConte
t.java:3817)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:
079)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas
.java:755)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:7
9)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.ja
a:886)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.
ava:849)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:47
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.jav
:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011

at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:43
)
at org.apache.catalina.core.StandardService.start(StandardService.java:
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:20
0)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
Jul 17, 2006 3:58:07 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Jul 17, 2006 3:58:07 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet /register threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource path /WEB
INF/struts-config.xml
at org.apache.struts.action.ActionServlet.handleConfigException(ActionS
rvlet.java:769)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionS
rvlet.java:745)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServle
.java:687)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper
java:1053)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:8
6)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardConte
t.java:3817)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:
079)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas
.java:755)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:7
9)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.ja
a:886)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.
ava:849)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:47
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.jav
:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
eSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011

at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:43
)
at org.apache.catalina.core.StandardService.start(StandardService.java:
50)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:20
0)
at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)

web.xml format is :
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

my struts-config.xml is:
<struts-config>
<form-beans>
<form-bean name="getdataform"
type="login.getDataForm"/>
</form-beans>
<global-exceptions/>
<global-forwards>
<forward name="register"
path="/register.jsp"/>
</global-forwards>
<action-mappings>
<action path="/Register"
name="getdataform"
scope="request"
input="/register.jsp"
validate="false"
type="login.getDataAction">
<forward name="success"
path="/success.jsp"/>
</action>
</action-mappings>
</struts-config>

i don't know what was the problem?plz heilp me?
thanks
sreejith
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The error is pretty specific:

Element type "action" must be followed by either attribute specifications, ">" or "/>".

It looks like the "action" element in your config file is not configured properly. Compare it to other (valid) config files to see where it differs. If you can't figure it out, post it here, and I'm sure someone can point to the problem.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sreejith gopalakrishnan
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular, please see UseAMeaningfulSubjectLine.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the Struts forum where the Struts gurus reside.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic