Hi all,
I have solved this problem but am still confused.
Basically the problem was with the type attribute in my field mappings.
I was using the identifier 'int' instead of 'integer' as follows:
<field name="appStatusCode" type="int" required="false"
direct="false" transient="false">
<bind-xml name="appStatusCode" node="element" reference="false"/>
</field>
When I made the replacement:
<field name="appStatusCode" type="integer" required="false"
direct="false" transient="false">
<bind-xml name="appStatusCode" node="element" reference="false"/>
</field>
everything worked fine. I can only assume that this 'integer' type maps to both an int primitive and an Integer object.
My question is, why does the original configuration work as a stand alone test?
Regards
Rob
| Robert Butera <[EMAIL PROTECTED]>
01/07/2005 05:01 PM
|
|
Hi all,
I am recieving the following exception when attempting to set my mapping file:
org.exolab.castor.mapping.MappingException: Nested error: org.exolab.castor.mapping.MappingException: Could not find the class int
This error only occurs when running as a deployed packagage inside jboss 3.2.3. It works fine when I run a stand alone test outside the applications server.
I am creating the mapping object as follows:
Mapping ordersMapping = new Mapping(this.getClass().getClassLoader());
URL url = "">
ordersMapping.loadMapping(url);
I assume this is a classloader problem but am thrown by the fact that it is a primitive it's having problems with.
The classes that the mapping file is trying to load is packaged in a seperate jar inside the jar where the above code is being executed which is packaged in an ear file. So it's a jar inside a jar inside an ear. All the other code can see these classes I'm not sure why the castor mapper is having so much trouble.
I have copied a portion of the mapping file below (the complete file exceeds the max allowable size by the mailing list). Any help on this would be greatly appreciated.
Regards
Rob
<?xml version="1.0" encoding="UTF-8"?>
<mapping>
<description>Castor generated mapping file</description>
<class name="com.erggroup.mass.fs.common.OpAp" auto-complete="false">
<description>Default mapping for class com.erggroup.mass.fs.common.OpAp</description>
<map-to xml="opAp"/>
<field name="testCard" type="boolean" required="false"
direct="false" transient="false">
<bind-xml name="testCard" node="element" reference="false"/>
</field>
<field name="appStatusCode" type="int" required="false"
direct="false" transient="false">
<bind-xml name="appStatusCode" node="element" reference="false"/>
</field>
<field name="participantID" type="int" required="false"
direct="false" transient="false">
<bind-xml name="participantID" node="element" reference="false"/>
</field>
<field name="operatorStaffID" type="java.lang.String"
required="false" direct="false" transient="false">
<bind-xml name="operatorStaffID" node="element" reference="false"/>
</field>
<!--field name="applicationExpiryDate" type="java.util.Date"
required="false" direct="false" transient="false">
<bind-xml name="applicationExpiryDate" node="element" reference="false"/>
</field-->
<field name="applicationExpiryDate" type="string" handler="com.erggroup.mass.fs.clientadapter.persistence.dao.impl.DateHandler">
<bind-xml name="applicationExpiryDate" node="element" reference="false"/>
</field>
</class>
<class name="com.erggroup.mass.fs.common.RegistrationID" auto-complete="false">
<description>Default mapping for class com.erggroup.mass.fs.common.RegistrationID</description>
<map-to xml="registrationID"/>
<field name="cardHolderIssuer" type="int" required="false"
direct="false" transient="false">
<bind-xml name="cardHolderIssuer" node="element" reference="false"/>
</field>
<field name="cardHolderNumber" type="int" required="false"
direct="false" transient="false">
<bind-xml name="cardHolderNumber" node="element" reference="false"/>
</field>
</class>
....
</mapping>

