Re: Cannot load a validator resource from '/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml'

2007-07-25 Thread Laurie Harper

Vitaliy Selivanov wrote:
 Truncated. see log file for complete stacktrace

Did you look at the log file? Look for the root cause of the 
ServletUnavailable exception.


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'

2004-12-05 Thread David G. Friedman
Ray,

I have two issues with your below files.

1. In your validation.xml, you list arg tags without a position number.
You should be using arg0, arg1, arg2, or arg3.  In future versions (possibly
in 1.2.4 but I'm not positive this early on a Sunday morning) 'arg0' will
become 'arg position=0' with arg1, arg2, and arg3 following similar
patterns of replacing the position's value with the correct number.

2. In the MessageResources.properties file you cut/pasted into this email,
you have spaces before most of the validator key names.  I'm not sure if
that is legal so be warned that it MIGHT cause additional problems.

Additionally, for your struts-config.xml plug-in definition, you might want
to try the stopOnFirstError property.  The behavior might be useful if you
try it out.  Using it would change your plug-in definition to:

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
  value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/
set-property property=stopOnFirstError value=false/
/plug-in

Regards,
David

P.S. Sorry I didn't check my email sooner but, while I've been unable to
sleep more than 20 minutes tonight, I read a book instead of using the
computer. Shame on me, eh? :)


-Original Message-
From: Ray [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 05, 2004 1:18 AM
To: Struts Users Mailing List
Subject: Re: Cannot load a validator resource from
'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'


Yep. Sure. Thanks ... :-)

-- MessageResource.properties -

# Resources file for STRUTS

# Errors
errors.header=font color=red
errors.footer=/font

  # -- validator --
  errors.invalid={0} is invalid.
  errors.maxlength={0} can not be greater than {1} characters.
  errors.minlength={0} can not be less than {1} characters.
  errors.range={0} is not in the range {1} through {2}.
  errors.required={0} is required.
  errors.byte={0} must be an byte.
  errors.date={0} is not a date.
  errors.double={0} must be an double.
  errors.float={0} must be an float.
  errors.integer={0} must be a number.
  errors.long={0} must be an long.
  errors.short={0} must be an short.
  errors.creditcard={0} is not a valid credit card number.
  errors.email={0} is an invalid e-mail address.
  # -- other --
  errors.cancel=Operation cancelled.
  errors.detail={0}
  errors.general=The process did not complete. Details should follow.
  errors.token=Request could not be completed. Operation is not in sequence.


errors.login=br/password is incorrect
errors.name.taken=name already taken

errors.page.not.found=page not found
errors.could.not.send.email= could not send the email
message.br/Please contact the school by telephone
errors.cannot.delete.home.page=You cannot delete the home page!
errors.page.in.use=This page is being used by the page calendar

EditForm.title=title
EditForm.summary=summary
EditForm.orderOfContent=Content order


# mail form
EmailForm.name=Name
EmailForm.address=Address
EmailForm.telephoneNumber=Telephone number
EmailForm.emailAddress=Email address

#Template form
TemplateForm.name=Name



#Content types form
ContentTypesForm.orderOfType=Sequence number
ContentTypesForm.typeOfContent=Content name


-- End of MessageResource.properties -

-- validator-rules.xml --
!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;
!--
   $Header:
C:/cvsrepo/projects/Projects/StarStream/organisation/src/jsp/WEB-INF/validat
or-rules.xml,v
1.1 2004/11/22 06:14:47 raymond Exp $
   $Revision: 1.1 $
   $Date: 2004/11/22 06:14:47 $

This file contains the default Struts Validator pluggable validator
definitions.  It should be placed somewhere under /WEB-INF and
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.

   plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames
value=/WEB-INF/validator-rules.xml,

/WEB-INF/validation.xml/
   /plug-in

These are the default error messages associated with
each validator defined in this file.  They should be
added to your projects ApplicationResources.properties
file or you can associate new ones by modifying the
pluggable validators msg attributes in this file.

# Struts Validator Error Messages
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.

errors.byte={0} must be a byte.
errors.short={0} must be a short.
errors.integer={0} must be an integer.
errors.long={0} must be a long.
errors.float={0} must be a float.
errors.double={0} must be a double.

errors.date={0} is not a date.
errors.range={0} is not in the range {1

Re: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'

2004-12-05 Thread Ray
Well, something there did the trick!  :-D
Thanks very much for your help ... :-)
David G. Friedman wrote:
Ray,
I have two issues with your below files.
1. In your validation.xml, you list arg tags without a position number.
You should be using arg0, arg1, arg2, or arg3.  In future versions (possibly
in 1.2.4 but I'm not positive this early on a Sunday morning) 'arg0' will
become 'arg position=0' with arg1, arg2, and arg3 following similar
patterns of replacing the position's value with the correct number.
2. In the MessageResources.properties file you cut/pasted into this email,
you have spaces before most of the validator key names.  I'm not sure if
that is legal so be warned that it MIGHT cause additional problems.
Additionally, for your struts-config.xml plug-in definition, you might want
to try the stopOnFirstError property.  The behavior might be useful if you
try it out.  Using it would change your plug-in definition to:
plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames
  value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/
set-property property=stopOnFirstError value=false/
/plug-in
Regards,
David
P.S. Sorry I didn't check my email sooner but, while I've been unable to
sleep more than 20 minutes tonight, I read a book instead of using the
computer. Shame on me, eh? :)
-Original Message-
From: Ray [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 05, 2004 1:18 AM
To: Struts Users Mailing List
Subject: Re: Cannot load a validator resource from
'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
Yep. Sure. Thanks ... :-)
-- MessageResource.properties -
# Resources file for STRUTS
# Errors
errors.header=font color=red
errors.footer=/font
  # -- validator --
  errors.invalid={0} is invalid.
  errors.maxlength={0} can not be greater than {1} characters.
  errors.minlength={0} can not be less than {1} characters.
  errors.range={0} is not in the range {1} through {2}.
  errors.required={0} is required.
  errors.byte={0} must be an byte.
  errors.date={0} is not a date.
  errors.double={0} must be an double.
  errors.float={0} must be an float.
  errors.integer={0} must be a number.
  errors.long={0} must be an long.
  errors.short={0} must be an short.
  errors.creditcard={0} is not a valid credit card number.
  errors.email={0} is an invalid e-mail address.
  # -- other --
  errors.cancel=Operation cancelled.
  errors.detail={0}
  errors.general=The process did not complete. Details should follow.
  errors.token=Request could not be completed. Operation is not in sequence.
errors.login=br/password is incorrect
errors.name.taken=name already taken
errors.page.not.found=page not found
errors.could.not.send.email= could not send the email
message.br/Please contact the school by telephone
errors.cannot.delete.home.page=You cannot delete the home page!
errors.page.in.use=This page is being used by the page calendar
EditForm.title=title
EditForm.summary=summary
EditForm.orderOfContent=Content order
# mail form
EmailForm.name=Name
EmailForm.address=Address
EmailForm.telephoneNumber=Telephone number
EmailForm.emailAddress=Email address
#Template form
TemplateForm.name=Name

#Content types form
ContentTypesForm.orderOfType=Sequence number
ContentTypesForm.typeOfContent=Content name
-- End of MessageResource.properties -
-- validator-rules.xml --
!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;
!--
   $Header:
C:/cvsrepo/projects/Projects/StarStream/organisation/src/jsp/WEB-INF/validat
or-rules.xml,v
1.1 2004/11/22 06:14:47 raymond Exp $
   $Revision: 1.1 $
   $Date: 2004/11/22 06:14:47 $
This file contains the default Struts Validator pluggable validator
definitions.  It should be placed somewhere under /WEB-INF and
referenced in the struts-config.xml under the plug-in element
for the ValidatorPlugIn.
   plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property property=pathnames
value=/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml/
   /plug-in
These are the default error messages associated with
each validator defined in this file.  They should be
added to your projects ApplicationResources.properties
file or you can associate new ones by modifying the
pluggable validators msg attributes in this file.
# Struts Validator Error Messages
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.
errors.byte={0} must be a byte.
errors.short={0} must be a short.
errors.integer={0} must be an integer.
errors.long={0} must be a long.
errors.float={0} must be a float.
errors.double={0} must be a double

RE: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'

2004-12-04 Thread David G. Friedman
Ray,

Can you include your validatoin.xml and validator-rules.xml files plus copy
in the application resources from any files it may be using for messages?

regards,
David

-Original Message-
From: Ray [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 04, 2004 5:33 AM
To: [EMAIL PROTECTED]
Subject: Cannot load a validator resource from
'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'


Hi there.

I've been fighting with a weird problem for a while now. The app I'm
running at home, won't load when I deploy it on my ISPs server.

The first problem was that Struts refused to load the struts-config.xml
file. I managed to get round it by stripping the DTD definition from the
start of struts-config.xml. Now though, I have another problem; Struts
won't load the validation files. I get the following error when the
application starts up:

---
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:256)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
5)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3427)
at
org.apache.catalina.core.StandardContext.reload(StandardContext.java:2574)
at
org.apache.catalina.servlets.ManagerServlet.reload(ManagerServlet.java:802)
at
org.apache.catalina.servlets.HTMLManagerServlet.reload(HTMLManagerServlet.ja
va:501)
at
org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServlet.jav
a:151)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilter
Chain.java:98)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:172)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:551)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at

Re: Cannot load a validator resource from '/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'

2004-12-04 Thread Ray
Yep. Sure. Thanks ... :-)
-- MessageResource.properties -
# Resources file for STRUTS
# Errors
errors.header=font color=red
errors.footer=/font
 # -- validator --
 errors.invalid={0} is invalid.
 errors.maxlength={0} can not be greater than {1} characters.
 errors.minlength={0} can not be less than {1} characters.
 errors.range={0} is not in the range {1} through {2}.
 errors.required={0} is required.
 errors.byte={0} must be an byte.
 errors.date={0} is not a date.
 errors.double={0} must be an double.
 errors.float={0} must be an float.
 errors.integer={0} must be a number.
 errors.long={0} must be an long.
 errors.short={0} must be an short.
 errors.creditcard={0} is not a valid credit card number.
 errors.email={0} is an invalid e-mail address.
 # -- other --
 errors.cancel=Operation cancelled.
 errors.detail={0}
 errors.general=The process did not complete. Details should follow.
 errors.token=Request could not be completed. Operation is not in sequence.
errors.login=br/password is incorrect
errors.name.taken=name already taken
errors.page.not.found=page not found
errors.could.not.send.email= could not send the email 
message.br/Please contact the school by telephone
errors.cannot.delete.home.page=You cannot delete the home page!
errors.page.in.use=This page is being used by the page calendar

EditForm.title=title
EditForm.summary=summary
EditForm.orderOfContent=Content order
# mail form
EmailForm.name=Name
EmailForm.address=Address
EmailForm.telephoneNumber=Telephone number
EmailForm.emailAddress=Email address
#Template form
TemplateForm.name=Name

#Content types form
ContentTypesForm.orderOfType=Sequence number
ContentTypesForm.typeOfContent=Content name
-- End of MessageResource.properties -
-- validator-rules.xml --
!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;
!--
  $Header: 
C:/cvsrepo/projects/Projects/StarStream/organisation/src/jsp/WEB-INF/validator-rules.xml,v 
1.1 2004/11/22 06:14:47 raymond Exp $
  $Revision: 1.1 $
  $Date: 2004/11/22 06:14:47 $

   This file contains the default Struts Validator pluggable validator
   definitions.  It should be placed somewhere under /WEB-INF and
   referenced in the struts-config.xml under the plug-in element
   for the ValidatorPlugIn.
  plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames 
value=/WEB-INF/validator-rules.xml,

/WEB-INF/validation.xml/
  /plug-in
   These are the default error messages associated with
   each validator defined in this file.  They should be
   added to your projects ApplicationResources.properties
   file or you can associate new ones by modifying the
   pluggable validators msg attributes in this file.
   # Struts Validator Error Messages
   errors.required={0} is required.
   errors.minlength={0} can not be less than {1} characters.
   errors.maxlength={0} can not be greater than {1} characters.
   errors.invalid={0} is invalid.
   errors.byte={0} must be a byte.
   errors.short={0} must be a short.
   errors.integer={0} must be an integer.
   errors.long={0} must be a long.
   errors.float={0} must be a float.
   errors.double={0} must be a double.
   errors.date={0} is not a date.
   errors.range={0} is not in the range {1} through {2}.
   errors.creditcard={0} is an invalid credit card number.
   errors.email={0} is an invalid e-mail address.
   Note: Starting in Struts 1.2.0 the default javascript definitions have
 been consolidated to commons-validator. The default can be 
overridden
 by supplying a javascript element with a CDATA section, just as
 in struts 1.1.

--
form-validation
   global
  validator name=required
classname=org.apache.struts.validator.FieldChecks
   method=validateRequired
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   javax.servlet.http.HttpServletRequest
  msg=errors.required/
  validator name=requiredif
 classname=org.apache.struts.validator.FieldChecks
 method=validateRequiredIf
 methodParams=java.lang.Object,
org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionMessages,
   org.apache.commons.validator.Validator,
   javax.servlet.http.HttpServletRequest
 msg=errors.required/
  validator name=validwhen
  msg=errors.required
classname=org.apache.struts.validator.validwhen.ValidWhen
 method=validateValidWhen