Re: How to build a model programmatically ?
Martin Matula <[email protected]> Thu, 16 Oct 2003 13:25:10 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.mdr.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, thanks for resending the e-mail - it was necessary (at least for me :)) - I did miss it. The problem seems to be that one of the references (or association ends, or associations) in your metamodel is not public. All model elements need to be public. Otherwise the behavior is undefined and may cause exceptions like this. Regards, Martin Arnaud Cuccuru wrote: > Hi, > I've just seen that the message I posted yesterday had a little problem > of date (send in 2002...). > I don't know if you received it, so I post it once again. Sorry if it > was not necessary.... > > > > Hi everybody, > thanks a lot for your advice. Now I can handle my metaconcepts as I > wanted to do. > But I still have a problem... When I try to write it in an xmi file (I > just do the same thing as in the java code example posted by Antony), I > get the following exceptions : > > > > javax.jmi.reflect.InvalidCallException > at > org.netbeans.mdr.handlers.InstanceHandler.refGetValue(InstanceHandler.java:376) > > at > org.netbeans.lib.jmi.xmi.WriterBase.writeReference(WriterBase.java:1044) > at > org.netbeans.lib.jmi.xmi.WriterBase.writeInstance(WriterBase.java:741) > at org.netbeans.lib.jmi.xmi.WriterBase.writePackage(WriterBase.java:638) > at org.netbeans.lib.jmi.xmi.WriterBase.writePackage(WriterBase.java:654) > at > org.netbeans.lib.jmi.xmi.WriterBase.writeDocument(WriterBase.java:551) > at org.netbeans.lib.jmi.xmi.WriterBase.write(WriterBase.java:224) > at org.netbeans.lib.jmi.xmi.WriterBase.write(WriterBase.java:195) > at > org.netbeans.lib.jmi.xmi.DelegatingWriter.write(DelegatingWriter.java:45) > at org.netbeans.api.xmi.XMIWriter.write(XMIWriter.java:77) > at MDRTest.main(MDRTest.java:84) > > > > In the JMI specification, I can read that InvalidCallException are > "Thrown by reflection methods when client tries to call them > incorrectly. (e.g. when refSetValue is called for attribute which is not > changeable)" (?!?!) > Is this problem frequent ? Do you have an idea ? > > > > Regards, and thank you again for your advice. >