aspose file tools*
The moose likes Struts and the fly likes Problem with validation in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with validation in struts" Watch "Problem with validation in struts" New topic
Author

Problem with validation in struts

Ashu Munjal
Greenhorn

Joined: Aug 15, 2005
Posts: 1
Hi
I am trying to use validation framework with struts.
everything is in on its place.(validator-rules.xml & validations.xml etc.)
but i am getting this error on weblogic server

/**************************************
org.xml.sax.SAXParseException: The markup in the document following the root ele
ment must be well-formed.
at weblogic.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExcepti
on(ErrorHandlerWrapper.java:232)
at weblogic.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandl
erWrapper.java:213)
at weblogic.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorRepo
rter.java:375)
at weblogic.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorRepo
rter.java:305)
at weblogic.apache.xerces.impl.XMLScanner.reportFatalError(XMLScanner.ja
va:1269)
at weblogic.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispat
cher.dispatch(XMLDocumentScannerImpl.java:1047)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume
nt(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar
ser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)

at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSe
rvlet.java:1006)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet
.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1028)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:904)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:883)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:822)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3333)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3278)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3259)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5949)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:862)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2168)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2115)
at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivat
ion(SlaveDeployer.java:3082)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForA
llApplications(SlaveDeployer.java:1751)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
ava:359)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
e(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
Jan 16, 2006 11:46:33 PM org.apache.struts.action.ActionServlet handleConfigExce
ption
SEVERE: Parsing error processing resource path
org.xml.sax.SAXParseException: The markup in the document following the root ele
ment must be well-formed.
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar
ser.java:1189)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)

at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSe
rvlet.java:1006)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet
.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1028)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:904)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:883)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:822)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3333)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3278)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3259)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5949)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:862)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2168)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2115)
at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivat
ion(SlaveDeployer.java:3082)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForA
llApplications(SlaveDeployer.java:1751)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
ava:359)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
e(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
<Jan 16, 2006 11:46:33 PM EST> <Error> <HTTP> <BEA-101216> <Servlet: "action" fa
iled to preload on startup in Web application: "mygudness".
javax.servlet.UnavailableException: Parsing error processing resource path
at org.apache.struts.action.ActionServlet.handleConfigException(ActionSe
rvlet.java:1035)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionSe
rvlet.java:1014)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet
.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:470)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1028)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:904)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:883)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:822)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3333)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3278)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3259)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5949)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:862)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2168)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2115)
at weblogic.management.deploy.slave.SlaveDeployer$Application.setActivat
ion(SlaveDeployer.java:3082)
at weblogic.management.deploy.slave.SlaveDeployer.setActivationStateForA
llApplications(SlaveDeployer.java:1751)
at weblogic.management.deploy.slave.SlaveDeployer.resume(SlaveDeployer.j
ava:359)
at weblogic.management.deploy.DeploymentManagerServerLifeCycleImpl.resum
e(DeploymentManagerServerLifeCycleImpl.java:229)
at weblogic.t3.srvr.SubsystemManager.resume(SubsystemManager.java:131)
at weblogic.t3.srvr.T3Srvr.resume(T3Srvr.java:966)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:32)
>
register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'zip
:C:/bea/user_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_
register_register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resou
rces/struts-config_1_0.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'zip:C:/bea/u
ser_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_register_
register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resources/web-
app_2_2.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'zip:C:/bea/u
ser_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_register_
register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resources/web-
app_2_3.dtd'
resolveEntity('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN',
'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
Resolving to alternate DTD 'zip:C:/bea/user_projects/domains/tiaadomain/myserve
r/.wlnotdelete/extract/myserver_register_register/jarfiles/WEB-INF/lib/struts_1_
0_2.jar!/org/apache/struts/resources/struts-config_1_0.dtd'
New org.apache.struts.action.ActionFormBean
Set org.apache.struts.action.ActionFormBean properties
Call org.apache.struts.action.ActionServlet.addFormBean(ActionFormBean[registerF
orm])
Pop org.apache.struts.action.ActionFormBean
New org.apache.struts.action.ActionMapping
Set org.apache.struts.action.ActionMapping properties
New org.apache.struts.action.ActionForward
Set org.apache.struts.action.ActionForward properties
Call org.apache.struts.action.ActionMapping.addForward(ActionForward[])
Pop org.apache.struts.action.ActionForward
New org.apache.struts.action.ActionForward
Set org.apache.struts.action.ActionForward properties
Call org.apache.struts.action.ActionMapping.addForward(ActionForward[])
Pop org.apache.struts.action.ActionForward
Call org.apache.struts.action.ActionServlet.addMapping(ActionMapping[path=, type
=])
Pop org.apache.struts.action.ActionMapping
register('-//Apache Software Foundation//DTD Struts Configuration 1.0//EN', 'zip
:C:/bea/user_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_
register_register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resou
rces/struts-config_1_0.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'zip:C:/bea/u
ser_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_register_
register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resources/web-
app_2_2.dtd'
register('-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN', 'zip:C:/bea/u
ser_projects/domains/tiaadomain/myserver/.wlnotdelete/extract/myserver_register_
register/jarfiles/WEB-INF/lib/struts_1_0_2.jar!/org/apache/struts/resources/web-
app_2_3.dtd'
resolveEntity('-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN', 'http://
java.sun.com/j2ee/dtds/web-app_2_2.dtd')
Resolving to alternate DTD 'zip:C:/bea/user_projects/domains/tiaadomain/myserve
r/.wlnotdelete/extract/myserver_register_register/jarfiles/WEB-INF/lib/struts_1_
0_2.jar!/org/apache/struts/resources/web-app_2_2.dtd'
Call org.apache.struts.action.ActionServlet.addServletMapping(action/java.lang.S
tring,*.do/java.lang.String)
<Jan 16, 2006 11:46:34 PM EST> <Notice> <WebLogicServer> <BEA-000331> <Started W
ebLogic Admin Server "myserver" for domain "tiaadomain" running in Development M
ode>
<Jan 16, 2006 11:46:34 PM EST> <Notice> <WebLogicServer> <BEA-000360> <Server st
arted in RUNNING mode>
<Jan 16, 2006 11:46:34 PM EST> <Notice> <WebLogicServer> <BEA-000355> <Thread "L
istenThread.Default" listening on port 7001, ip address *.*>
Jan 16, 2006 11:48:39 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
e
Jan 16, 2006 11:48:39 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNul
l=true
Jan 16, 2006 11:48:40 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='resources.application', returnNull=true
Jan 16, 2006 11:48:40 PM org.apache.struts.validator.ValidatorPlugIn initResourc
es
INFO: Loading validation rules file from '/WEB-INF/validation-rules.xml'
Jan 16, 2006 11:48:40 PM org.apache.struts.validator.ValidatorPlugIn initResourc
es
INFO: Loading validation rules file from '/WEB-INF/validations.xml'
Jan 16, 2006 11:48:40 PM org.apache.struts.validator.ValidatorPlugIn initResourc
es
SEVERE: Skipping validation rules file from '/WEB-INF/validations.xml'. No stre
am could be opened.
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', return
Null=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.actions.LocalStrings', returnNull=
true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', return
Null=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:45 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
e
Jan 16, 2006 11:48:55 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:55 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:55 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:55 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 11:48:57 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnN


*******************************
code in validations.xml is as follows




<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/validation_1_1.dtd">


<form-validation>
<formset>
<form name="logonForm">
<field property="username"
depends="required">
<arg key="error.username.required"/>
</field>
<field property="password"
depends="required">
<arg key="error.password.required"/>
</field>


<field property="emailAddress"
depends="required">
<arg key="logonForm.emailAddress"/>
</field>
</form>
</formset>

</form-validation>
//**************

please help.
Ashu
Amit Kumar Kaushik
Greenhorn

Joined: Jan 12, 2006
Posts: 11
I like to ask you few question?

1. Which version of Struts, you are working on?
2. When are you getting this error? (i mean when you run the application, loading on jsp, validating form)
3. Server and jdk version you are using.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with validation in struts