• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Error in struts validator plug in  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i am doing a sample application in struts with struts validator plug in. it throwing a error while the application loading...
ct 15, 2007 5:49:03 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.5.0_06\bin\..\jre\bin\client;C:\Program Files\Java\jdk1.5.0_06\bin\..\jre\bin;D:\oracle\product\10.1.0\Db_1\bin;C:\Program Files\Java\jdk1.5.0_06\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.5.0_06\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Common Files\Teleca Shared;D:\oracle\product\10.1.0\Db_1\orb\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin;C:\Program Files\Java\jdk1.5.0_06\bin;.;
Oct 15, 2007 5:49:03 PM org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Oct 15, 2007 5:49:03 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1110 ms
Oct 15, 2007 5:49:04 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 15, 2007 5:49:04 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.25
Oct 15, 2007 5:49:04 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Oct 15, 2007 5:49:05 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'
Oct 15, 2007 5:49:05 PM org.apache.struts.validator.ValidatorPlugIn initResources
INFO: Loading validation rules file from '/WEB-INF/validation.xml'
Oct 15, 2007 5:49:05 PM org.apache.struts.validator.ValidatorPlugIn init
SEVERE: 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:168)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Oct 15, 2007 5:49:05 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Oct 15, 2007 5:49:05 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /AddressBook 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:168)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
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:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Oct 15, 2007 5:49:05 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Oct 15, 2007 5:49:05 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 15, 2007 5:49:05 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=null
Oct 15, 2007 5:49:05 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Oct 15, 2007 5:49:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2000 ms


My struts-config.xml

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>

<form-beans>
<form-bean name="loginform" type="LoginForm"/>
</form-beans>
<action-mappings>
<!-- Action Mapping for Login -->

<action path="/Login" type="LoginAction" name="loginform" validate="true" scope="request" input="/index.jsp">
<forward name="success" path="/jsp/Home.jsp"/>
<forward name="failure" path="/jsp/failure.jsp"/>
</action>
</action-mapping>
<message-resources parameter="org.properties"/>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
</struts-config>

i have my validation.xml and validation-rules.cml under WEB-INF dir

Validation.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!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">

<form-validation>

<!--
This is a minimal Validator form file with a couple of examples.
-->
<global>

<!-- An example global constant
<constant>
<constant-name>maskCode</constant-name>
<constant-value>^[a-zA-Z]{1}[a-zA-Z0-9_]*$</constant-value>
</constant>
end example-->
</global>
<formset>
<!-- An example form -->
<form name="loginform">
<field property="login" depends="required,minlength,maxlength,mask">
<msg name="mask"
key="loginform.usernamemask"/>
<arg0 key="loginform.username"/>
<arg1 key="${var:minlength}" name="minlength" resource="false"/>
<arg1 key="${var:maxlength}" name="maxlength" resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>5</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>9</var-value>
</var>
<var>
<var-name>mask</var-name>
<var-value>^[a-zA-Z]{1}[a-zA-Z0-9_]*$</var-value>
</var>
</field>
<field
property="password" depends="required,minlength,maxlength">
<arg0 key="loginform.password"/>
<arg1 key="${var:minlength}"
name="minlength"
resource="false"/>
<arg1 key="${var:maxlength}"
name="maxlength"
resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>5</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>9</var-value>
</var>
</field>
</form>

<!-- An example form -->
<!-- An example form -->
</formset>
<!-- An example formset for another locale -->
<formset language="fr">
<constant>
<constant-name>postalCode</constant-name>
<constant-value>^[0-9a-zA-Z]*$</constant-value>
</constant>
<!-- An example form -->
<form name="logonForm">
<field
property="username" depends="required">
<arg key="loginform.username"/>
</field>
<field
property="password" depends="required,mask">
<arg key="loginform.password"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z]*$</var-value>
</var>
</field>
</form>

</formset>

</form-validation>

i cant solve this problem
help me please

Thanks in advance
Giridaran.R
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also getting the same problem like this

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_06\bin;.;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.5.0_06/bin/client;C:/Program Files/Java/jre1.5.0_06/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Toshiba\Bluetooth Toshiba Stack\sys\

But here problem is not in our application, i think problem in Tomcat path configuration.
 
On top of spaghetti all covered in cheese, there was this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!