Re: Getting a null pointer exception while commiting

Martin Matula <[email protected]> Wed, 03 Sep 2003 23:51:54 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.devel
Message-ID <[email protected]>
Hi Olivier,
it is strange that you are able to read the attached model. When I tried 
to import it, XMI reader complained about the format of the XMI file 
(empty <XMI.field> tags are not supported - you have them in the 
multiplicity). After I replaced all <XMI.field/> by 
<XMI.field>1</XMI.field>, I successfully imported the metamodel and 
instantiated it without any exception.
Regards,
Martin

Olivier RICHAUD wrote:
> I'm trying to instanciate the model (see attachment) and when I commit
> the surrounding Read/Write transaction, I get the following exception:
> 
> org.netbeans.mdr.persistence.StorageTransientDataException:
> java.lang.NullPointerException: null
>         at
> org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.writeS
> treamable(BtreeDatabase.java:877)
>         at
> org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.addRec
> ord(BtreeDatabase.java:916)
>         at
> org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.save(B
> treeDatabase.java:502)
>         at
> org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.commit
> Changes(BtreeDatabase.java:418)
>         at
> org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeStorage.commitC
> hanges(BtreeStorage.java:313)
>         at
> org.netbeans.mdr.storagemodel.MdrStorage.save(MdrStorage.java:532)
>         at
> org.netbeans.mdr.storagemodel.MdrStorage.commit(MdrStorage.java:503)
>         at
> org.netbeans.mdr.util.TransactionMutex.leave(TransactionMutex.java:183)
>         at
> org.netbeans.mdr.NBMDRepositoryImpl.endTrans(NBMDRepositoryImpl.java:202
> )
>         ...
> 
> 
> 
> When importing my model, I perform some checks to ensure the model can
> be correctly instantiated.
> 
> Before committing, I dont't have any problem creating  a new extent. I
> can see a valid MOF ID for my nex extent. But as soon as I commit, this
> exception is raised and, of course, when I try to find the extent, a
> null reference is returned, indicating no such extent exist.
> 
> Nevertheless, this may be linked to my model because I can correctly
> instanciate another model. But I don't understand.
> 
> The MDR build number is : 200307311024 (MDR Standalone).
>  
> Thanks for your help.
> 
> Regards.
> 
> Olivier.