commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sloan Seaman" <sl...@sgi.net>
Subject Digester
Date Wed, 11 Jun 2003 13:57:54 GMT
I'm having trouble getting the Digester to properly populate some java object and I was wondering
if someone could help me out.

It keeps trying to call setConnection() on my JDOPlugIn object when I want it to call setConnection()
on my JDOConfig object.

Help?


Here is my XML:
<jdo-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <jdo-providers>
  <jdo id="ANALYSIS" provider="org.xorm.InterfaceManagerFactory" default="true">
   <connection
    driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url="jdbc:microsoft:sqlserver://xx.xx.xx.xx:1433;DatabaseName=OMS;SelectMethod=cursor"

    username="x"
    password="x"
    minPool="2"
    maxPool="10"
    />
   <providerSpecific>
    <property name="org.xorm.datastore.database" 
     value="/com/symbol/mc/oms/jdo/xorm-db.xml"/>
    <property name="org.xorm.ModelMappingFile"
     value="/com/symbol/mc/oms/jdo/bean.jdo"/>
    <property name="org.xorm.option.ValidateXML"
     value="false"/>
   </providerSpecific>
  </jdo>
 </jdo-providers>
</jdo-config>

And here is my code:
private void process(InputStream _is) 
  throws IllegalAccessException, IOException, SAXException
 {
  Digester digester = new Digester();
  digester.push(this);
  addRuleInstances(digester);
  digester.parse(_is);
 }
 
 private void addRuleInstances(Digester _digester) {
  _digester.addSetProperties(
   "jdo-config/jdo-providers");
  _digester.addSetNext(
   "jdo-config/jdo-providers",
   "addJDOConfig",
   "com.symbol.mc.struts.plugin.jdo.JDOConfig");
  
  _digester.addObjectCreate(
   "jdo-config/jdo-providers/jdo",
   "com.symbol.mc.struts.plugin.jdo.JDOConfig");
  _digester.addSetProperties(
   "jdo-config/jdo-providers/jdo");
  _digester.addSetNext(
   "jdo-config/jdo-providers/jdo/connection",
   "setConnection",
   "com.symbol.mc.struts.plugin.common.ConnectionConfig");
  _digester.addSetNext(
   "jdo-config/jdo-providers/jdo/providerSpecific",
   "setProviderSpecific",
   "com.symbol.mc.struts.plugin.common.ProviderSpecificConfig");
  
  _digester.addObjectCreate(
   "jdo-config/jdo-providers/jdo/connection",
   "com.symbol.mc.struts.plugin.common.ConnectionConfig");
  _digester.addSetProperties(
   "jdo-config/jdo-providers/jdo/connection");

  _digester.addObjectCreate(
   "jdo-config/jdo-providers/jdo/providerSpecific",
   "com.symbol.mc.struts.plugin.common.ProviderSpecificConfig");
  _digester.addCallMethod(
   "jdo-config/jdo-providers/jdo/providerSpecific/property",
   "addProperty", 2);
  _digester.addCallParam(
   "jdo-config/jdo-providers/jdo/providerSpecific/property",
   0,
   "name");
  _digester.addCallParam(
   "jdo-config/jdo-providers/jdo/providerSpecific/property",
   1,
   "value");
 }


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message