This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Im getting this Error "Skipping validation rules file from 'validator-rules.xml'."

 
akash kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am trying to learn struts validator. I downloaded an example and deployed it but i'm getting the below error . I have both the validator-rules.xml and validation.xml in the WEB-INF folder.

The DOCTYPE in validation.xml is

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.3.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_3_0.dtd">


and in validator-rules.xml is

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">

Can the validator version be the problem??


The Error:

INFO: Loading validation rules file from '/org/apache/struts/validator/validator-rules.xml'
Jan 19, 2010 2:58:57 PM org.apache.struts.validator.ValidatorPlugIn init
SEVERE: Skipping validation rules file from '/org/apache/struts/validator/validator-rules.xml'. No stream could be opened.
javax.servlet.ServletException: Skipping validation rules file from '/org/apache/struts/validator/validator-rules.xml'. No stream could be opened.
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:222)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:164)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jan 19, 2010 2:58:57 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Jan 19, 2010 2:58:57 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /StrutsValidation1 threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from '/org/apache/struts/validator/validator-rules.xml, /WEB-INF/validation.xml'
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Jan 19, 2010 2:58:57 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(F:\anil\WorkSpaceJava\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\TestStruts\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
Jan 19, 2010 2:58:58 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(F:\anil\WorkSpaceJava\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\SDB\WEB-INF\lib\j2ee-1.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 19, 2010 2:58:59 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 19, 2010 2:58:59 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 19, 2010 2:58:59 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/141 config=null
Jan 19, 2010 2:58:59 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6208 ms
 
akash kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. I made correction to struts-config file. The path of validator-rules.xml file was wrong and had to change it to the right path. ie from '/org/apache/struts/validator/validator-rules.xml, /WEB-INF/validation.xml' to '/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml'
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic