Re: [mdr-users] MDR storage federation - Read first

Jaroslav Drazan <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Martin,
I got it, so please ignore the previous email. My mistake was, that I loaded UML metamodel each time when I wanted to instantiate UML metamodel, so if I changed the main file, it couldn't  find the UML interfaces.

Your advise with permanent UUID is useful for me altough it wasn't my problem.

Thank you very much:-)
Jarda


================= Původní zpráva =================
Od (From): "Jaroslav Drazan" <[email protected]>
Komu (To): [email protected]
Kopie (Cc): 
Předmět (Subject): Re: [mdr-users] MDR storage federation
Datum (Date): 2. 5. 2005 20:13
==================================================

> Hi Martin,
> thank you for advise but I'm afraid it doesn't work or I use it in a wrong way.
> 
> I tried this scenario:
> 1) create main storage file with MOF extent
> 2) shutdown it and backup it.
> 3) run main storage file
> 4) create new federative storage with UML extent and import some UML XMI into it
> 5) unmount the federative storage + shutdown main storage
> 6) replace main storage with backup from the step 2
> 7) mount federative storage and read UML
> 8) I got exception:
> 
> java.lang.NullPointerException
> 	at org.netbeans.mdr.handlers.MDRClassLoader.resolveInterface(MDRClassLoader.java:98)
> 	at org.netbeans.mdr.handlers.BaseObjectHandler.resolveClass(BaseObjectHandler.java:147)
> 	at org.netbeans.mdr.NBMDRepositoryImpl.getHandler(NBMDRepositoryImpl.java:612)
> 	at org.netbeans.mdr.NBMDRepositoryImpl.getExtent(NBMDRepositoryImpl.java:314)
> 
> 
> I used this code for main storage creation (it shows only relevant things):
> 
> //I tried both possibilities
> private final static String MAIN_STORAGE_UUID_PROPERTY = /*BtreeFactory.STORAGE_UUID;*/
> "MDRStorageProperty.org.netbeans.mdr.persistence.btreeimpl.uuid";
> 
> private final static String MAIN_STORAGE_UUID_VALUE = "9AD71E66-B2FC-11D9-B578-D0907E18AA77";
> 
> 
> Map<Object,Object> properties = new HashMap<Object,Object>();
>         properties.put(STORAGE_PROPERTY,FILE_STORAGE_FACTORY);//use BTree files
>         properties.put(FILE_STORAGE_NAME_PROPERTY,aMofStorageDir + File.separatorChar + MOF_METAMODEL_STORAGE);
>         properties.put(MAIN_STORAGE_UUID_PROPERTY,MAIN_STORAGE_UUID_VALUE);        
>         
>         NBMDRepositoryImpl lmdRepository = new NBMDRepositoryImpl(properties);
> 
> 
> Does MDR generates new Storage ID when I open new storage (use new NBMDRepositoryImpl(properties);), or does it create it just once when the storage doesn't exist so it is created? In the second case I'm afraid setting Storage ID can't help me, because I create the storage just once (but many copies can be used concurrently and I want to open partitions created in some copy in any of them).
> 
> I noticed that during time the main storage file is bigger and bigger (After few tests it had 10MB but partitions had just about 1,6 MB) and it's changed after every application run. 
> 
> I don't understand, why the main file is changed - does it references the created UML extends?
> 
> Regards
> Jarda
> 
> > What you want is possible, but you  need to set the storageID for the 
> > main storage explicitly (using a property).
> > Its because the storageID is by default generated randomly (UUID) thus 
> > each main storage has different UUID and the partitions that were 
> > created with one storage do not work with other main storage because 
> > they reference the storage using its UUID.
> > To specify UUID explicitly, you need to set 
> > MDRStorageProperty.org.netbeans.mdr.persistence.btreeimpl.uuid system 
> > property to some UUID (same format as in MOFID without the increment at 
> > the end).
> > Regards,
> > Martin
> > 
> > Jaroslav Drazan wrote:
> > 
> > > Hello,
> > > I created the main storage file with MOF metamodel (and I backed up 
> > > it) and I mounted and imported some XMI in and umounted some partition 
> > > storage files with UML metamodel and UML models. This worked fine 
> > > until I didn't changed the main storage to the initial version (to the 
> > > backup).
> > >
> > > I got following exception:
> > >
> > > java.lang.NullPointerException
> > >     at 
> > > org.netbeans.mdr.handlers.MDRClassLoader.resolveInterface(MDRClassLoader.java:98) 
> > >
> > >     at 
> > > org.netbeans.mdr.handlers.BaseObjectHandler.resolveClass(BaseObjectHandler.java:147) 
> > >
> > >     at 
> > > org.netbeans.mdr.NBMDRepositoryImpl.getHandler(NBMDRepositoryImpl.java:612) 
> > >
> > >     at 
> > > org.netbeans.mdr.NBMDRepositoryImpl.getExtent(NBMDRepositoryImpl.java:314) 
> > >
> > >
> > > I want to ask if it is possible to share the main storage file in more 
> > > locations and to transport the partitions files among these location 
> > > (the partition can be changed in some location).
> > >
> > > I thaugt that the main file kept just MOF metamodel and was not 
> > > changed after mounting some partition and importing XMI into it but It 
> > > seems it changes and I don't understant why.
> > >
> > > Can somebody help me?
> > >
> > > Best Regards
> > > Jarda
> > > ____________________________________________________________
> > > http://www.seznam.cz - e-mailová schránka 2000 MB
> > > ____________________________________________________________
> > > http://www.seznam.cz - e-mailová schránka 2000 MB
> > 
> > 
> 
> ____________________________________________________________
> http://www.seznam.cz - e-mailová schránka 2000 MB

____________________________________________________________
http://www.seznam.cz - e-mailová schránka 2000 MB
____________________________________________________________
http://www.seznam.cz - e-mailová schránka 2000 MB
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.