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 56060 - CompositionViolationException when creating JUnit tests
Summary: CompositionViolationException when creating JUnit tests
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marian Petras
URL:
Keywords:
: 56154 56294 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-07 14:43 UTC by John Jullion-ceccarelli
Modified: 2006-03-24 13:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
error (4.42 KB, text/plain)
2005-03-07 14:44 UTC, John Jullion-ceccarelli
Details
information exception thrown before CompositionViolationException (2.04 KB, text/plain)
2005-03-11 13:43 UTC, Marian Petras
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Jullion-ceccarelli 2005-03-07 14:43:05 UTC
when generating a JUnit test in an EJB Module
project, I get the attached error.
Comment 1 John Jullion-ceccarelli 2005-03-07 14:44:03 UTC
Created attachment 20716 [details]
error
Comment 2 John Jullion-ceccarelli 2005-03-07 14:46:10 UTC
See also Issue 56061
Comment 3 Martin Matula 2005-03-07 17:18:25 UTC
This is a bug in junit module (TestCreator class). It passes an
Identifier used by other import into a new import. duplicate() method
should be used to create a copy of that identifier. Even better you
could use duplicate() on the whole import.
Comment 4 Martin Matula 2005-03-10 12:38:02 UTC
*** Issue 56154 has been marked as a duplicate of this issue. ***
Comment 5 ehucka 2005-03-10 12:39:54 UTC
i think it is p2
Comment 6 zikmund 2005-03-11 12:26:44 UTC
Same thing happens in WebApps.
Comment 7 Marian Petras 2005-03-11 13:26:24 UTC
It works in WebApps with a plain class.
Comment 8 Marian Petras 2005-03-11 13:32:29 UTC
Confirmed, accepted.
Comment 9 Marian Petras 2005-03-11 13:33:02 UTC
The bug is reproducible with a Servlet class, not with a plain Java class.
Comment 10 Marian Petras 2005-03-11 13:40:20 UTC
Immediately before the exception is thrown, an informational exception is
printed to the console (in the dev. build).

Top few lines of the exception:

  [org.netbeans.javacore]
     INFORMATIONAL ***** Exception occurred ***** at 2:30 PM on Mar 11, 2005
  [catch]java.lang.Exception: rollback!!!
      at o.n.m.javacore.ExclusiveMutex.leave(ExclusiveMutex.java:348)
      at o.n.mdr.NBMDRepositoryImpl.endTrans(NBMDRepositoryImpl.java:248)
      at o.n.mdr.handlers.BaseObjectHandler._unlock(BaseObjectHandler.java:225)
      at o.n.mdr.handlers.ClassProxyHandler._postCreate(ClassProxyHandler:101)
      at o.n.jmi.javamodel.ImportClass$Impl.createImport(Unknown Source)
      ...
Comment 11 Marian Petras 2005-03-11 13:43:44 UTC
Created attachment 20784 [details]
information exception thrown before CompositionViolationException
Comment 12 Marian Petras 2005-03-11 15:22:36 UTC
Fixed in the trunk.

Modified file:

    junit/src/org/netbeans/modules/junit/TestCreator.java   (1.42)

Diff:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/TestCreator.java?r1=1.41&r2=1.42&diff_format=u


Thanks Martin Matula for a (yet another) hint on how to fix it.
Comment 13 Marian Petras 2005-03-12 17:10:56 UTC
Fixed also in branch QBE200503101100.

Modified file:

    junit/src/org/netbeans/modules/junit/TestCreator.java   (1.41.2.1)

Diff:
http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/TestCreator.java?r1=1.41&r2=1.41.2.1&diff_format=u
Comment 14 zikmund 2005-03-14 07:20:19 UTC
*** Issue 56294 has been marked as a duplicate of this issue. ***
Comment 15 zikmund 2005-03-14 11:17:18 UTC
Verified in 200503131900.
Comment 16 John Jullion-ceccarelli 2005-03-14 11:29:20 UTC
confirmed this is fixed.
Comment 17 Jaroslav Pospisil 2005-03-14 13:49:26 UTC
Now waiting for commit to qbuild branch.
Comment 18 Jaroslav Pospisil 2005-03-14 13:53:07 UTC
q-build branch QBE200503101100.
Comment 19 zikmund 2005-03-14 13:53:54 UTC
It has been already merged to Q-build branch -- see previous comment from Marian.