This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 57114 - org.netbeans.mdr.util.DebugException
Summary: org.netbeans.mdr.util.DebugException
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker with 1 vote (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 11:54 UTC by jardapb
Modified: 2006-03-24 12:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test case and bug stack trace (1.14 MB, application/octet-stream)
2005-03-29 11:57 UTC, jardapb
Details
test UML model (53.34 KB, text/xml)
2005-03-29 18:48 UTC, jardapb
Details
test UML model (53.34 KB, text/xml)
2005-03-29 18:49 UTC, jardapb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jardapb 2005-03-29 11:54:26 UTC
Following exception is thrown in this case:

      repository = getRepository("c:/test");
      extent = initUMLPackage();
      
      repository.beginTrans(true);
      RepositoryUtils.importAllFromXMI(extent,"c:/uc.xmi");
      repository.endTrans();
      
      //The key step - if I exclude restart (shutdown + creating new instance) 
of repository,
      // no exception is thrown
      repository.shutdown();
      System.out.println("Shutting down");
      
      repository = getRepository("c:/test");
      extent = initUMLPackage();
      
      
      repository.beginTrans(true);
      
      Set<RefObject> originalObjects = new HashSet<RefObject>();
      for(RefClass refClass:RepositoryUtils.getAllRefClasses(extent)) {
          originalObjects.addAll(refClass.refAllOfClass());
      }
      
      repository.endTrans();
      repository.shutdown();

I have used Java 1.5 and standalone MDR with build number: 200503232205.

The testCase and required.xmi will be attached

[org.netbeans.mdr.Logger] INFORMATIONAL *********** Exception occurred 
************ at Tue Mar 29 12:55:45 CEST 2005
org.netbeans.mdr.util.DebugException
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:497)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:415)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:305)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:506)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:415)
	at org.netbeans.mdr.storagemodel.AttrCollection.read
(AttrCollection.java:110)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:487)
	at org.netbeans.mdr.util.IOUtils.read(IOUtils.java:415)
	at org.netbeans.mdr.storagemodel.StorableObject.read
(StorableObject.java:418)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.readStreamable
(BtreeDatabase.java:911)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.getRecord
(BtreeDatabase.java:979)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.getIfExists
(BtreeDatabase.java:728)
	at org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.get
(BtreeDatabase.java:749)
	at org.netbeans.mdr.storagemodel.MdrStorage.resolve
(MdrStorage.java:1662)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeStorage.resolveObject
(BtreeStorage.java:536)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.MOFIDInfo.objectFromBuffer
(MOFIDInfo.java:126)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreeListByKey$BtreeListByKeyI
terator.getCurrentItem(BtreeListByKey.java:246)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreeListByKey$BtreeListByKeyI
terator.next(BtreeListByKey.java:168)
	at org.netbeans.mdr.storagemodel.IndexImmutSet$IndexImmutIterator.next
(IndexImmutSet.java:165)
	at org.netbeans.mdr.handlers.IndexSetWrapper$IndexIteratorWrapper.next
(IndexSetWrapper.java:228)
	at java.util.AbstractCollection.addAll(AbstractCollection.java:318)
	at test.Main.main(Main.java:97)
[org.netbeans.mdr.Logger] INFORMATIONAL *********** Exception occurred 
************ at Tue Mar 29 12:55:45 CEST 2005
org.netbeans.mdr.util.DebugException
	at org.netbeans.mdr.storagemodel.StorableObject.read
(StorableObject.java:423)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.readStreamable
(BtreeDatabase.java:911)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.getRecord
(BtreeDatabase.java:979)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.getIfExists
(BtreeDatabase.java:728)
	at org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeDatabase.get
(BtreeDatabase.java:749)
	at org.netbeans.mdr.storagemodel.MdrStorage.resolve
(MdrStorage.java:1662)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreestorage.BtreeStorage.resolveObject
(BtreeStorage.java:536)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.MOFIDInfo.objectFromBuffer
(MOFIDInfo.java:126)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreeListByKey$BtreeListByKeyI
terator.getCurrentItem(BtreeListByKey.java:246)
	at 
org.netbeans.mdr.persistence.btreeimpl.btreeindex.BtreeListByKey$BtreeListByKeyI
terator.next(BtreeListByKey.java:168)
	at org.netbeans.mdr.storagemodel.IndexImmutSet$IndexImmutIterator.next
(IndexImmutSet.java:165)
	at org.netbeans.mdr.handlers.IndexSetWrapper$IndexIteratorWrapper.next
(IndexSetWrapper.java:228)
	at java.util.AbstractCollection.addAll(AbstractCollection.java:318)
	at test.Main.main(Main.java:97)
Comment 1 jardapb 2005-03-29 11:57:18 UTC
Created attachment 21189 [details]
test case and bug stack trace
Comment 2 Martin Matula 2005-03-29 12:44:57 UTC
uc.xml is missing. Please provide it or advise how to proceed without it.
Comment 3 jardapb 2005-03-29 18:48:41 UTC
Created attachment 21204 [details]
test UML model
Comment 4 jardapb 2005-03-29 18:49:08 UTC
Created attachment 21205 [details]
test UML model
Comment 5 Martin Matula 2005-03-30 12:48:13 UTC
The problem is that you shut down the repository and then try to access it
again. This is not possible.
In your original e-mail you wrote you end the transaction and then start a new
one. However shutdown() does not end the transaction - it shuts down the
repository. To end the transaction use endTrans(). You should use the following
pattern to work with trasactions:

boolean fail = true;
rep.beginTrans(true);
try {
  // do something
  // ....
  fail = false;
} finally {
  rep.endTrans(fail);
}
Comment 6 Martin Matula 2005-03-30 15:38:26 UTC
I've found the bug that is the primary cause of the exceptions.
Comment 7 jardapb 2005-04-21 09:50:31 UTC
Any news regarding this issue?
Comment 8 Martin Matula 2005-04-21 15:49:49 UTC
Fixed.

Checking in src/org/netbeans/mdr/util/IOUtils.java;
/cvs/mdr/src/org/netbeans/mdr/util/IOUtils.java,v  <--  IOUtils.java
new revision: 1.34; previous revision: 1.33
done
Comment 9 jardapb 2005-04-22 08:09:42 UTC
It works:-), thank you very much.