commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lafredo, Stephen" <stephen_lafr...@merck.com>
Subject RE: Digester: Cannot get <call-param-rule> to parse?
Date Mon, 24 Mar 2003 14:53:10 GMT
Hi,

I have the following configured w/in my rules file...

...
  <pattern value="Context/ResourceParams">

    <object-create-rule
classname="com.merck.common.rcpool.deploy.ResourceParams"
                         attrname="resourcesParameters"/>

    <!-- map the element's XML attributes to the bean properties -->
    <set-properties-rule>
      <alias attr-name="name" prop-name="name" />
    </set-properties-rule>

    <call-method-rule methodname="addParameter" paramcount="2" />
    <call-param-rule paramnumber="0" attrname="name" />
    <call-param-rule paramnumber="1" attrname="value"  />

  </pattern>
...

This is the portion of the xml file I am parsing...

  <ResourceParams name="jdbc/db2" value="foo">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
  </ResourceParams>

When the rules file is configured as described above the "ResourceParams"
ATTRIBUTES and not the contained "parameter" ELEMENTS are being parsed!

This is the sample output...

ResourceParams[name=jdbc/db2, parameters={jdbc/db2=foo}]

What I am expecting is...

ResourceParams[name=jdbc/db2,
parameters={factory=org.apache.commons.dbcp.BasicDataSourceFactory}]

Am I misunderstanding the functionality of call-method-rule?

Thank you.

Stephen Lafredo


-----Original Message-----

Hi,

I have corrected the rules file as described below but I am still getting an
error when I try to specify a method w/parameters?

Mar 24, 2003 9:03:29 AM org.apache.commons.digester.Digester peekParams
WARNING: Empty stack (returning null) 
Mar 24, 2003 9:03:29 AM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw exception java.lang.NullPointerException
 	at
org.apache.commons.digester.CallParamRule.begin(CallParamRule.java:232)
 	at org.apache.commons.digester.Rule.begin(Rule.java:200) 

...

java.lang.NullPointerException
 	at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2383)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2409)
at org.apache.commons.digester.Digester.startElement(Digester.java:1271) 

The release notes suggests that this functionality has been implemented but
is it?

Any suggestions?

Thank you.

Stephen Lafredo


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck
& Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary
copyrighted and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message.  If you are not the intended recipient, and have received
this message in error, please immediately return this by e-mail and then delete it.

==============================================================================


Mime
View raw message