Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Validation framework error

 
Ashok Sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i am using struts validation framework, to achive this i have made following changes.
1. Validation plag-in definition is added in struts-config.xml


2. validation.xml and validator-rules.xml is added in the WEB-INF folder, struts-config.xml is also available in the same folder.
3. Extend forms from ValidatorForm instead of ActionForm

But when i start resin i get following error message.

By looking at the error message it seams system is not able to locate validation XMLs but these XMLs are already available in the path specified. So i am not able to identified the cause of the problem.

Please help.


[17:47:33.187] Loading validation rules file from '/WEB-INF/validator-rules.xml'
[17:47:33.203] Loading validation rules file from '/WEB-INF/validation.xml'
[17:47:33.437] null
[17:47:33.437] java.lang.NullPointerException
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.internalProcessForms(ValidatorResources.java:464)
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.process(ValidatorResources.java:415)
[17:47:33.437] at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:162)
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)
[17:47:33.437] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.437] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.437] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.437] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.437] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.437] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.437] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.437] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.437] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.437] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.437] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.437] at com.caucho.server.resin.Resin.main(Resin.java:1343)
[17:47:33.437] javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
[17:47:33.437] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
[17:47:33.437] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.437] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.437] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.437] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.437] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.437] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.437] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.437] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.437] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.437] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.437] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.437] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.437] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.437] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.437] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.437] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.437] at com.caucho.server.resin.Resin.main(Resin.java:1343)
[17:47:33.453] javax.servlet.UnavailableException: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
[17:47:33.453] at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:172)
[17:47:33.453] at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
[17:47:33.453] at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
[17:47:33.453] at javax.servlet.GenericServlet.init(GenericServlet.java:70)
[17:47:33.453] at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:776)
[17:47:33.453] at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:707)
[17:47:33.453] at com.caucho.server.dispatch.ServletManager.init(ServletManager.java:150)
[17:47:33.453] at com.caucho.server.webapp.WebApp.start(WebApp.java:1726)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.453] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.453] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.453] at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:671)
[17:47:33.453] at com.caucho.server.host.Host.start(Host.java:437)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:623)
[17:47:33.453] at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
[17:47:33.453] at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:505)
[17:47:33.453] at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:155)
[17:47:33.453] at com.caucho.server.host.HostContainer.start(HostContainer.java:473)
[17:47:33.453] at com.caucho.server.cluster.Server.start(Server.java:1092)
[17:47:33.453] at com.caucho.server.cluster.Cluster.startServer(Cluster.java:689)
[17:47:33.453] at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:431)
[17:47:33.453] at com.caucho.server.resin.Resin.start(Resin.java:710)
[17:47:33.453] at com.caucho.server.resin.Resin.initMain(Resin.java:1146)
[17:47:33.453] at com.caucho.server.resin.Resin.main(Resin.java:1343)
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you deployed a war file into a resins, can you see those validation xml files in WEB-INF directory?
 
Ashok Sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i can see the files in WEB-INF directory.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm, the problem, at first, seems with the incorrect xml files path, but as you said the files are there, so that problem is zeroed. Now its my wild guess, Just look at the validness and well formed ness of both validation xml.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic