Re: [mdr-users] Problems instantiating my own metamodel

Martin Matula <[email protected]> Sun, 23 Oct 2005 17:27:13 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Please use ErrorManager.getDefault().notify(e) to print the exception 
(instead of e.printStackTrace()) - this will print out also the cause of 
the DebugException. Otherwise we are not able to identify the cause 
correctly.
Thanks,
Martin

María Catalina Acero Rozo wrote:
> Hello,
> 
> I'm using mdr-standalone and I have a problem instantiating my M2 level model,
> which is not UML but my own metamodel.
> 
> rulesPackage is instance of MofPackage named "EAIRules" which is the
> root package of the model. The thrown exception holds no more information.
> 
> org.netbeans.api.mdr.CreationFailedException: Cannot instantiate package because
> of unexpected exception: org.netbeans.mdr.util.DebugException
>         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
> co.edu.uniandes.eairules.mdr.processor.EAIRulesPackageHelper.createExtend(EAIRulesPackageHelper.java:205)
>         at
> co.edu.uniandes.eairules.mdr.processor.EAIRulesPackageHelper.loadEAIRulesModel(EAIRulesPackageHelper.java:230)
>         at co.edu.uniandes.eairules.main.Main.main(Main.java:39)
> 
> This  is my code:
> 
>       rulesPackage = ( EairulesPackage ) repository.getExtent(name);
> 
>       if(rulesPackage == null)
>       {
>          rulesPackage = ( EairulesPackage ) repository.createExtent( name,
> getRulesPackage() );
>              }
> 
> The method getRulesPackage() return the "EAIRules" package. The topmost package
> of EAIRules metamodel.
> 
> Please, can you help me ?
>