Default and Propeties based on a Prefix supplied with ant command
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ashutosh_khandelwal
Posted On:   Tuesday, August 31, 2004 11:24 AM

Hi, I am not able to use validator framework with eclipse. everything looks fine. I get this error on weblogic server,although on browser it seems that it is skipping the validation. THe error is //***************** INFO: Loading validation rules file from '/WEB-INF/validations.xml' Jan 16, 2006 10:14:32 PM org.apache.commons.digester.Digester endElement SEVERE: End event threw exception java.lang.NoSuchMethodException: No such accessible method: put() on object: org .apache.commons.validator.ValidatorResources at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav a:250) at org.apache.commons.digester.SetNextR   More>>

Hi,

I am not able to use validator framework with eclipse.
everything looks fine.

I get this error on weblogic server,although on browser it seems that it is skipping the validation.

THe error is

//*****************


INFO: Loading validation rules file from '/WEB-INF/validations.xml'
Jan 16, 2006 10:14:32 PM org.apache.commons.digester.Digester endElement
SEVERE: End event threw exception
java.lang.NoSuchMethodException: No such accessible method: put() on object: org
.apache.commons.validator.ValidatorResources
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.jav
a:250)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractS
AXParser.java:585)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNa
mespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespac
eBinder.java:644)
at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLD
TDValidator.java:1937)
at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDVali
dator.java:851)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndEle
ment(XMLDocumentFragmentScannerImpl.java:1008)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCo
ntentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume
nt(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar
ser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)

at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.commons.validator.ValidatorResourcesInitializer.initialize
(ValidatorResourcesInitializer.java:259)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:222)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:161)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1028)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:904)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:883)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:822)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3333)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3278)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3259)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5949)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:862)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2168)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.
activateContainer(SlaveDeployer.java:2503)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(
SlaveDeployer.java:2421)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeplo
yer.java:2138)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(S
laveDeployer.java:2237)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDepl
oyer.java:2132)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(S
laveDeployer.java:2384)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sla
veDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDepl
oyer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDep
loyer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHan
dler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Jan 16, 2006 10:14:32 PM org.apache.commons.validator.ValidatorResourcesInitiali
zer initialize
SEVERE: Error at (24, 11: No such accessible method: put() on object: org.apache
.commons.validator.ValidatorResources
java.lang.NoSuchMethodException: No such accessible method: put() on object: org
.apache.commons.validator.ValidatorResources
at org.apache.commons.digester.Digester.createSAXException(Digester.java
:2540)
at org.apache.commons.digester.Digester.createSAXException(Digester.java
:2566)
at org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractS
AXParser.java:585)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNa
mespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespac
eBinder.java:644)
at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLD
TDValidator.java:1937)
at weblogic.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDVali
dator.java:851)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndEle
ment(XMLDocumentFragmentScannerImpl.java:1008)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentCo
ntentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocume
nt(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguratio
n.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXPar
ser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)

at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)

at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.commons.validator.ValidatorResourcesInitializer.initialize
(ValidatorResourcesInitializer.java:259)
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
ugIn.java:222)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
:161)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
t.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(Servl
etStubImpl.java:1028)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
121)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
pl.java:904)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
Impl.java:883)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
mpl.java:822)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppS
ervletContext.java:3333)
at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebApp
ServletContext.java:3278)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAp
pServletContext.java:3259)
at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServl
etContext.java:5949)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:862)
at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer
.java:2127)
at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContai
ner.java:2168)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.
activateContainer(SlaveDeployer.java:2503)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(
SlaveDeployer.java:2421)
at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeplo
yer.java:2138)
at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(S
laveDeployer.java:2237)
at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDepl
oyer.java:2132)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(S
laveDeployer.java:2384)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(Sla
veDeployer.java:866)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDepl
oyer.java:594)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDep
loyer.java:508)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHan
dler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Jan 16, 2006 10:14:51 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', return
Null=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.actions.LocalStrings', returnNull=
true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', return
Null=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:52 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=tru
e
Jan 16, 2006 10:14:53 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:53 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:53 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:53 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnN
ull=true
Jan 16, 2006 10:14:54 PM org.apache.struts.util.PropertyMessageResources
INFO: Initializing, config='org.apache.struts.taglib.bean.LocalStrings', returnN
ull=true
//***************************

I hv included all the required jar files in /WEB-INF/lib folder,

my validations.xml is

//**********************
<?xml version="1.0" encoding="ISO-8859-1" ?>

"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">





depends="required">



depends="required">





depends="required">








//******************

& validation-rules.xml is perfect.



Can u plz. advice.

thanks
Ashu


I would like to use some default properties such as



host.name = hostName

host.number = 8802

host.ipaddress = 111.11.11.11



In addition, I would also like to use some properties defined on the basis of prefix, such as




local.host.name = localhost

local.host.number = 7001





I would like use these properties in such a way that default (without prefix) values are used if the specific (prefixed) properties are not found.





Any ideas about how I can do this without writing my own Ant Task.

Thanks,

   <<Less

Re: Default and Propeties based on a Prefix supplied with ant command

Posted By:   ashutosh_khandelwal  
Posted On:   Tuesday, September 21, 2004 12:40 PM

I think your answer solves the exactly the opposite problem .





I would like to be able to specify env.id as part of ant command, and retreive the properties with the env.id prefix (if available) otherwise use default properties values as defined in the properties file:




For example,



Here is the proprty file build.properties





# start of properties file




hostName=local

hostNumber=7001




ext.hostNumber=8008




# end of properties file




Here is the target I would like to execute:




ant -Denv.id=ext use
















Should result in


host name:local


host number:8008







I could do this by writin an ant atrger that removes the prefixes and sets the property. Is there any way to avoid writing an additional nat task.

Re: Default and Propeties based on a Prefix supplied with ant command

Posted By:   Anonymous  
Posted On:   Tuesday, August 31, 2004 10:18 PM

The special/default-value problem can be resolved via properties immutability:



host name: ${local.host.name}


If you set the local.host.name before invokation of use, the statement will be ignored and your value will be used. Otherwise the local.host.name will be set to the default value.
About | Sitemap | Contact