This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts Validation framework error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validation framework error" Watch "Struts Validation framework error" New topic
Author

Struts Validation framework error

Ashok Sharma
Greenhorn

Joined: Dec 08, 2008
Posts: 12
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

When you deployed a war file into a resins, can you see those validation xml files in WEB-INF directory?


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Ashok Sharma
Greenhorn

Joined: Dec 08, 2008
Posts: 12
Yes, i can see the files in WEB-INF directory.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Validation framework error