glassfish
  1. glassfish
  2. GLASSFISH-16816

static creation of exception hides actual call location in OTSResourceImpl.java

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1_dev
    • Fix Version/s: 3.1.1_dev, 4.0
    • Component/s: jts
    • Labels:
      None
    • Environment:

      Windows Server 2003, JDK 1.6

      Description

      I encountered a problem that I'm trying to track down, but I'm having some difficulty. Along the way, I noticed the following in transaction/jts/src/main/java/com/sun/jts/jtsxa/OTSResourceImpl.java (revision 47353) :

      488.private static org.omg.CORBA.NO_IMPLEMENT no_implement =
      489.new org.omg.CORBA.NO_IMPLEMENT("This is a locally constrained object.");
      490.
      491.
      492.public org.omg.CORBA.Object _duplicate()

      { 493.throw no_implement; 494.}

      ...

      So the class statically instantiates an Exception and then throws this exception in various unimplemented methods (presumably to avoid the cost of instantiating a new exception?). This makes debugging difficult, though, since the stack trace that results from this exception gives the stack for the instantiation of this exception, not where the exception really occurred:

      org.omg.CORBA.NO_IMPLEMENT: This is a locally constrained object. vmcid: 0x0 minor code: 0 completed: No
      at com.sun.jts.jtsxa.OTSResourceImpl.<clinit>(OTSResourceImpl.java:488)
      at com.sun.jts.jta.TransactionState.startAssociation(TransactionState.java:285)
      at com.sun.jts.jta.TransactionImpl.enlistResource(TransactionImpl.java:212)
      at com.sun.enterprise.transaction.JavaEETransactionImpl.enlistResource(JavaEETransactionImpl.java:641)
      at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.enlistXAResource(JavaEETransactionManagerSimplified.java:1300)
      at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.enlistResource(JavaEETransactionManagerSimplified.java:360)
      at com.sun.enterprise.resource.rm.SystemResourceManagerImpl.enlistResource(SystemResourceManagerImpl.java:103)
      at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManagerImpl.java:208)
      ...
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
      at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

      Granted, this is an internal class that end-user developers needn't know much about, but the stack trace doesn't help provide me with a clue about how the system came to call the method that caused the exception to be thrown.

        Activity

        Hide
        christopherrued added a comment -

        Patch to change all exceptions to be instantiated at the time they are thrown

        Show
        christopherrued added a comment - Patch to change all exceptions to be instantiated at the time they are thrown
        Hide
        marina vatkina added a comment -

        Fixed on trunk with

        Sending src/main/java/com/sun/jts/CosTransactions/ControlImpl.java
        Sending src/main/java/com/sun/jts/CosTransactions/CoordinatorImpl.java
        Sending src/main/java/com/sun/jts/jta/SynchronizationImpl.java
        Sending src/main/java/com/sun/jts/jtsxa/OTSResourceImpl.java
        Transmitting file data ....
        Committed revision 47356.

        Please approve for 3.1.1

        • Why fix this issue in 3.1.1?

        Easy fix. Helps users identify the problem

        • Which is the targeted build of 3.1.1 for this fix?

        3.1.1 b07

        • Do regression tests exist for this issue?

        There is no need to because the fix is this:

        • throw no_implement;
          + throw new org.omg.CORBA.NO_IMPLEMENT("This is a locally constrained object.");
        • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

        Regular regression tests

        Show
        marina vatkina added a comment - Fixed on trunk with Sending src/main/java/com/sun/jts/CosTransactions/ControlImpl.java Sending src/main/java/com/sun/jts/CosTransactions/CoordinatorImpl.java Sending src/main/java/com/sun/jts/jta/SynchronizationImpl.java Sending src/main/java/com/sun/jts/jtsxa/OTSResourceImpl.java Transmitting file data .... Committed revision 47356. Please approve for 3.1.1 Why fix this issue in 3.1.1? Easy fix. Helps users identify the problem Which is the targeted build of 3.1.1 for this fix? 3.1.1 b07 Do regression tests exist for this issue? There is no need to because the fix is this: throw no_implement; + throw new org.omg.CORBA.NO_IMPLEMENT("This is a locally constrained object."); Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Regular regression tests
        Hide
        marina vatkina added a comment -

        Thanks for the patch. There are 4 classes with this problem.

        Show
        marina vatkina added a comment - Thanks for the patch. There are 4 classes with this problem.
        Hide
        scatari added a comment -

        Approved for 3.1.1. Please make sure that you update the "Fix in version" to reflect 3.1.1 b07.

        Show
        scatari added a comment - Approved for 3.1.1. Please make sure that you update the "Fix in version" to reflect 3.1.1 b07.
        Hide
        marina vatkina added a comment -

        Fixed in 3.1.1 with
        Sending jts/src/main/java/com/sun/jts/CosTransactions/ControlImpl.java
        Sending jts/src/main/java/com/sun/jts/CosTransactions/CoordinatorImpl.java
        Sending jts/src/main/java/com/sun/jts/jta/SynchronizationImpl.java
        Sending jts/src/main/java/com/sun/jts/jtsxa/OTSResourceImpl.java
        Transmitting file data ....
        Committed revision 47369.

        Show
        marina vatkina added a comment - Fixed in 3.1.1 with Sending jts/src/main/java/com/sun/jts/CosTransactions/ControlImpl.java Sending jts/src/main/java/com/sun/jts/CosTransactions/CoordinatorImpl.java Sending jts/src/main/java/com/sun/jts/jta/SynchronizationImpl.java Sending jts/src/main/java/com/sun/jts/jtsxa/OTSResourceImpl.java Transmitting file data .... Committed revision 47369.

          People

          • Assignee:
            marina vatkina
            Reporter:
            christopherrued
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: