[prev in list] [next in list] [prev in thread] [next in thread]
List: castor-dev
Subject: [castor-dev] help requested about exception: object is not constructable -- it does not contain a d
From: "Sagi Schlisser" <sagis () idit ! co ! il>
Date: 2003-06-26 15:25:30
[Download RAW message or body]
Hello,
I created java classes out of a schema, the schema included a simple
element with enumeration:
<xsd:element name="FE_STRPARM">
<xsd:annotation>
<xsd:documentation>Stuurparameter kennisregelset</xsd:documentation>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="STDRD"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
I got for it a class with a Type extension: FE_STRPARMType which has
private c'tor and no public c'tor.
for each value in the enumeration (in this example he has one) it
creates a static member which calls the private c'tor with the good
data:
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* The STDRD type
*/
public static final int STDRD_TYPE = 0;
/**
* The instance of the STDRD type
*/
public static final FE_STRPARMType STDRD = new
FE_STRPARMType(STDRD_TYPE, "STDRD");
//----------------/
//- Constructors -/
//----------------/
private FE_STRPARMType(int type, java.lang.String value) {
super();
this.type = type;
this.stringValue = value;
} //--
com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType(int,
java.lang.String)
now I created a mapping xml which looked ok:
<class
cst:name="com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType
">
<description>Default mapping for class
com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType</descript
ion>
<map-to cst:xml="FE_STRPARMType"/>
</class>
<class cst:name="com.idit.PD.ABZIntegration.svmmQuestionVO.FE">
<description>Default mapping for class
com.idit.PD.ABZIntegration.svmmQuestionVO.FE</description>
<map-to cst:xml="FE"/>
<field cst:name="FE_PEILDAT" cst:type="java.lang.String"
cst:required="true">
<bind-xml name="FE_PEILDAT" node="element"/>
</field>
<field cst:name="FE_STRPARM"
cst:type="com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType
" cst:required="true">
<bind-xml name="FE_STRPARM" node="element"/>
</field>
</class>
when I try to run the folowing code:
Mapping map = new Mapping();
map.loadMapping(ABZConstants.MAPPING_FILE_NAME);
map.setAllowRedefinitions(false);
FileWriter out = new FileWriter(ABZConstants.OUT_FILE_NAME);
Marshaller marshal = new Marshaller(out);
marshal.setMarshalExtendedType(true);
marshal.setMapping(map);
I get :
org.exolab.castor.mapping.MappingException: The Java class
com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType is not
constructable -- it does not contain a default public constructor
at
org.exolab.castor.mapping.loader.ClassDescriptorImpl.<init>(ClassDescrip
torImpl.java:152)
at
org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingL
oader.java:502)
at
org.exolab.castor.xml.XMLMappingLoader.createDescriptor(XMLMappingLoader
.java:192)
at
org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader
.java:233)
at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:291)
at org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:246)
at org.exolab.castor.xml.Marshaller.setMapping(Marshaller.java:512)
at com.idit.PD.ABZIntegration.ABZManager.checkABZ(ABZManager.java:212)
at com.idit.PD.ABZIntegration.ABZManager.main(ABZManager.java:319)
since untill this point I used castor all the way I can't understand why
I get this exception.
can anyone help please.
10X
sagi schliesser
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG>Hello,</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>I created
java classes out of a schema, the schema included a simple element with
enumeration:</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><xsd:element
name="FE_STRPARM"><BR> <xsd:annotation><BR> <xsd:documentation>Stuurparameter \
kennisregelset</xsd:documentation><BR> </xsd:annotation><BR> <xsd:simpleType><BR> <xsd:restriction \
base="xsd:string"><BR> <xsd:enumeration
value="STDRD"/><BR> </xsd:restriction><BR> </xsd:simpleType><BR> </xsd:element></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>I got for it
a class with a Type extension: FE_STRPARMType which has private c'tor and no
public c'tor.</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>for each
value in the enumeration (in this example he has one) it creates a
static member which calls the private c'tor with the good
data:</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003>
//--------------------------/<BR> //- Class/Member
Variables -/<BR>
//--------------------------/</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003>
/**<BR> * The STDRD type<BR>
*/<BR> public static final int STDRD_TYPE =
0;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003>
/**<BR> * The instance of the STDRD
type<BR> */<BR> public static final
FE_STRPARMType STDRD = new FE_STRPARMType(STDRD_TYPE,
"STDRD");<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003>
//----------------/<BR> //- Constructors
-/<BR> //----------------/</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003>
private FE_STRPARMType(int type, java.lang.String value)
{<BR>
super();<BR> this.type =
type;<BR> this.stringValue =
value;<BR> } //--
com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType(int,
java.lang.String)<BR></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>now I
created a mapping xml which looked ok:</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003> <class
cst:name="com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType"><BR> \
<description>Default mapping for class
com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType</description><BR> \
<map-to cst:xml="FE_STRPARMType"/><BR>
</class></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><class
cst:name="com.idit.PD.ABZIntegration.svmmQuestionVO.FE"><BR> \
<description>Default mapping for class
com.idit.PD.ABZIntegration.svmmQuestionVO.FE</description><BR> \
<map-to cst:xml="FE"/><BR>
<field cst:name="FE_PEILDAT" cst:type="java.lang.String"
cst:required="true"><BR> \
<bind-xml name="FE_PEILDAT"
node="element"/><BR>
</field><BR> <field
cst:name="FE_STRPARM"
cst:type="com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType"
cst:required="true"><BR> \
<bind-xml name="FE_STRPARM"
node="element"/><BR>
</field><BR> </class></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>when I try
to run the folowing code:</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003> \
Mapping map = new
Mapping();<BR>
map.loadMapping(ABZConstants.MAPPING_FILE_NAME);<BR> \
map.setAllowRedefinitions(false);<BR> \
FileWriter out = new
FileWriter(ABZConstants.OUT_FILE_NAME);<BR> \
Marshaller marshal = new
Marshaller(out);<BR> \
marshal.setMarshalExtendedType(true);<BR> \
marshal.setMapping(map);<BR> </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>I get
> </STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003>org.exolab.castor.mapping.MappingException: The Java
class com.idit.PD.ABZIntegration.svmmQuestionVO.types.FE_STRPARMType is not
constructable -- it does not contain a default public constructor<BR> at
org.exolab.castor.mapping.loader.ClassDescriptorImpl.<init>(ClassDescriptorImpl.java:152)<BR> at \
org.exolab.castor.mapping.loader.MappingLoader.createDescriptor(MappingLoader.java:502)<BR> at \
org.exolab.castor.xml.XMLMappingLoader.createDescriptor(XMLMappingLoader.java:192)<BR> at \
org.exolab.castor.mapping.loader.MappingLoader.loadMapping(MappingLoader.java:233)<BR> at \
org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:291)<BR> at
org.exolab.castor.mapping.Mapping.getResolver(Mapping.java:246)<BR> at
org.exolab.castor.xml.Marshaller.setMapping(Marshaller.java:512)<BR> at
com.idit.PD.ABZIntegration.ABZManager.checkABZ(ABZManager.java:212)<BR> at
com.idit.PD.ABZIntegration.ABZManager.main(ABZManager.java:319)</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>since untill
this point I used castor all the way I can't understand why I get this
exception.</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>can anyone
help please.</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG></STRONG></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=871223012-26062003><STRONG>10X</STRONG></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=871223012-26062003><STRONG>sagi
schliesser</STRONG></SPAN></FONT></DIV></BODY></HTML>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
minimalist@exolab.org with a subject of:
unsubscribe castor-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic