Re: [mdr-users] CreationgFailedException while creating an extent...

Martin Matula <[email protected]> Tue, 11 Oct 2005 18:01:36 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Dimitrios,
the problem is that the "aggregation" attribute is missing on the first 
association end.
Another problem I see (which is not fatal) is that the tag at the top of 
your document should be contained by the DATA package since according to 
a MOF constraints, everything but a package needs to be contained by 
some element.
Martin

Dimitrios Kolovos wrote:
> Hi,
> 
> I have written a very simple meta-model in XMI. When I try to create an 
> extent in the repository , I get the following CreationFailedException.
> 
> org.netbeans.api.mdr.CreationFailedException: Cannot instantiate package 
> because of unexpected exception: java.lang.NullPointerException
>    at 
> org.netbeans.mdr.NBMDRepositoryImpl.createExtent(NBMDRepositoryImpl.java:484) 
> 
>    at 
> org.netbeans.mdr.NBMDRepositoryImpl.createExtent(NBMDRepositoryImpl.java:287) 
> 
>    at 
> org.netbeans.mdr.NBMDRepositoryImpl.createExtent(NBMDRepositoryImpl.java:275) 
> 
>    at org.xol.models.mdr.MdrModel.loadImpl(MdrModel.java:97)
> 
> My meta-model is attached. It is just 4kbs and contains 2 classes, 2 
> packages and 1 association. I have not been able to find what its defect 
> is...
> 
> Cheers,
> Dimitrios
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version = '1.0' encoding = 'windows-1252' ?>
> <XMI xmi.version = '1.2' xmlns:Model = 'org.omg.xmi.namespace.Model' timestamp = 'Wed Oct 05 13:10:28 BST 2005'>
>   <XMI.header>
>     <XMI.documentation>
>       <XMI.exporter>Netbeans XMI Writer</XMI.exporter>
>       <XMI.exporterVersion>1.0</XMI.exporterVersion>
>     </XMI.documentation>
>   </XMI.header>
>   <XMI.content>
>     <Model:Tag xmi.id = 'a1' name = 'javax.jmi.packagePrefix' annotation = ''
>       tagId = 'javax.jmi.packagePrefix'>
>       <Model:Tag.values>org</Model:Tag.values>
>       <Model:Tag.elements>
>         <Model:Package xmi.idref = 'a2'/>
>       </Model:Tag.elements>
>     </Model:Tag>
>     <Model:Package xmi.id = 'a2' name = 'DATA' annotation = '' isRoot = 'false'
>       isLeaf = 'false' isAbstract = 'false' visibility = 'public_vis'>
>       <Model:Namespace.contents>
>         <Model:Class xmi.id = 'a4' name = 'Database' annotation = '' isRoot = 'false'
>           isLeaf = 'false' isAbstract = 'false' visibility = 'public_vis' isSingleton = 'false'/>
>         <Model:Class xmi.id = 'a5' name = 'Table' annotation = '' isRoot = 'false'
>           isLeaf = 'false' isAbstract = 'false' visibility = 'public_vis' isSingleton = 'false'/>
>         <Model:Association xmi.id = 'a6' name = 'DatabaseToTables' annotation = ''
>           isRoot = 'false' isLeaf = 'false' isAbstract = 'false' visibility = 'public_vis'
>           isDerived = 'false'>
>           <Model:Namespace.contents>
>             <Model:AssociationEnd xmi.id = 'a7' name = 'database' annotation = '' isNavigable = 'true'
>               isChangeable = 'false'>
>               <Model:AssociationEnd.multiplicity>
>                 <XMI.field>0</XMI.field>
>                 <XMI.field>1</XMI.field>
>                 <XMI.field>false</XMI.field>
>                 <XMI.field>false</XMI.field>
>               </Model:AssociationEnd.multiplicity>
>               <Model:TypedElement.type>
>                 <Model:Class xmi.idref = 'a4'/>
>               </Model:TypedElement.type>
>             </Model:AssociationEnd>
>             <Model:AssociationEnd xmi.id = 'a8' name = 'tables' annotation = '' isNavigable = 'true'
>               aggregation = 'none' isChangeable = 'false'>
>               <Model:AssociationEnd.multiplicity>
>                 <XMI.field>0</XMI.field>
>                 <XMI.field>-1</XMI.field>
>                 <XMI.field>false</XMI.field>
>                 <XMI.field>false</XMI.field>
>               </Model:AssociationEnd.multiplicity>
>               <Model:TypedElement.type>
>                 <Model:Class xmi.idref = 'a5'/>
>               </Model:TypedElement.type>
>             </Model:AssociationEnd>
>           </Model:Namespace.contents>
>         </Model:Association>
>         <Model:Import xmi.id = 'a9' name = 'ImportPrimitiveTypes' visibility = 'public_vis'
>           isClustered = 'true'>
>           <Model:Import.importedNamespace>
>             <Model:Package xmi.idref = 'a3'/>
>           </Model:Import.importedNamespace>
>         </Model:Import>
>       </Model:Namespace.contents>
>     </Model:Package>
>     <Model:Package xmi.id = 'a3' name = 'PrimitiveTypes' annotation = '' isRoot = 'false'
>       isLeaf = 'false' isAbstract = 'false' visibility = 'public_vis'/>
>   </XMI.content>
> </XMI>