HI All,
 
Please give me some clues for the below problem. Thanks in advance. 
 
I am using XML Mapping. And about to complete the mapping work. All mapping works fine before making validations on.
I am validating the XML against the schema. And setting following properties in catsor.properties file.
 
castor.properties:
org.exolab.castor.parser.validation=true
org.exolab.castor.parser.namespaces=true
org.exolab.castor.sax.features=http://apache.org/xml/features/validation/schema
 
But when I set above properties I am getting below error during unmarshlling, but this was working before validations,
 
unable to find FieldDescriptor for 'logger' in ClassDescriptor of logging{file:
[not available]; line: 6; column: 96}
 
my XML:
1: <?xml version="1.0"?>
2: <tmsettings xmlns="http://www.ne.jp/method"
3:     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4:     xsi:schemaLocation="http://www.ne.jp/method settings.xsd">
5: <logging>  
6:    <logger name="tmcompiler" boundrylevel="10"/>
7:    <logger name="tmclient" boundrylevel="10"/>
8:    <logger name="tmwebapp" boundrylevel="10"/>
9:  </logging>  
10:</tmsettings>
-------------------------------------------------------------------------------------------------------------------------------------------------
my mapping.xml:
<?xml version="1.0"?>
<mapping  xmlns="http://castor.exolab.org/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://castor.exolab.org/ mapping.xsd">
 <class name="TMSettings">
  <map-to xml="tmsettings" />
  <field name="loggerList" collection="map" get-method="getLoggerList"
   set-method="addLogger" type="TMLogger">
   <bind-xml name="logger" location="logging"/>
  </field>
 </class>
 
 <class name="TMLogger">
  <field name="name" type="string">
   <bind-xml name="name" node="attribute"/>
    </field>
  <field name="boundryLevel" type="string">
   <bind-xml name="boundrylevel" node="attribute"/>
    </field>
 </class>
</mapping>
-------------------------------------------------------------------------------------------------------------------------------------------------
And classes are as below,
public class TMSettings {
 //Code for <logging.../> element
 private Map loggerList = new HashMap();
 public void addLogger( TMLogger logger ) {
  loggerList.put( logger.getName(), logger );
  }
 public Map getLoggerList() { return loggerList; }
}
 
public class TMLogger {
 
     private String name;
     private String boundryLevel;
    
     public void setName(String name) { this.name = name;}
     public String getName() { return name;}
 
     public void setBoundryLevel(String level) { boundryLevel = level;}
     public String getBoundryLevel() { return boundryLevel;}
}
-------------------------------------------------------------------------------------------------------------------------------------------------
 
Thanks and Regards,
JItesh

Reply via email to