Newsgroup: it.comp.java
Titolo: urgente! Errore Validator di Struts

ciao,
ho un problema: facendo un'applicazione banale con Struts, ho voluto provare 
ad usare anche il tool Validator.
Purtroppo non riesco a farlo partire, sembra che Tomcat non riesca a trovare 
i file validator-rules.xml e validation.xml, che invece sono in 
tomcat/webapps/miaApp/WEB-INF.
Premetto che tutto funziona se non importo il plugin.
Il log di Tomcat è il seguente:
13-apr-2005 1.48.36 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
13-apr-2005 1.48.36 org.apache.struts.validator.ValidatorPlugIn 
initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
13-apr-2005 1.48.36 org.apache.struts.validator.ValidatorPlugIn 
initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
13-apr-2005 1.48.36 org.apache.struts.validator.ValidatorPlugIn init
GRAVE: null
java.lang.NullPointerException
 at 
org.apache.commons.validator.ValidatorResources.internalProcessForms(ValidatorResources.java:464)
 at 
org.apache.commons.validator.ValidatorResources.process(ValidatorResources.java:415)
 at 
org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:162)
 at 
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:233)
 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:211)
 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900)
 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823)
 at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4087)
 at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
 at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
 at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
 at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
13-apr-2005 1.48.36 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
13-apr-2005 1.48.36 org.apache.catalina.core.ApplicationContext log
GRAVE: Servlet /struts-prod threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from 
'/WEB-INF/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:211)
 at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1068)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:900)
 at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3823)
 at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4087)
 at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
 at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:909)
 at 
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:872)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1106)
 at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
 at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1019)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:440)
 at org.apache.catalina.core.StandardService.start(StandardService.java:450)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
13-apr-2005 1.48.37 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
13-apr-2005 1.48.37 org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /
0.0.0.0:8009
13-apr-2005 1.48.37 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/20  config=null
13-apr-2005 1.48.37 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
13-apr-2005 1.48.37 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1893 ms
Lo struts-config.xml ovviamente contiene:
    <message-resources parameter="MessageResources"/>
  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" 
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
  </plug-in>
Boh sinceramente non ho idea ...
grazie a tutti per il contributo !
Alessandro 

 ad usare anche il tool Validator.
_cut
I files vengono trovati. Possibile invece che ci sia un errore di sintassi in
validator-rules.xml o in validation.xml?
daniele