Issue Details (XML | Word | Printable)

Key: GLASSFISH-16816
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: marina vatkina
Reporter: christopherrued
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

static creation of exception hides actual call location in

Created: 07/Jun/11 02:19 PM   Updated: 02/Dec/11 07:23 PM   Resolved: 08/Jun/11 10:58 AM
Component/s: jts
Affects Version/s: 3.1.1_b06
Fix Version/s: 3.1.1_b07 , 4.0

Time Tracking:
Not Specified

File Attachments: 1. Text File (3 kB) 07/Jun/11 02:43 PM - christopherrued


Windows Server 2003, JDK 1.6

Tags: 3_1_1-approved
Participants: christopherrued, marina vatkina and scatari

 Description  « Hide

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/ (revision 47353) :

488.private static org.omg.CORBA.NO_IMPLEMENT no_implement = org.omg.CORBA.NO_IMPLEMENT("This is a locally constrained object.");
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>(
at com.sun.jts.jta.TransactionState.startAssociation(
at com.sun.jts.jta.TransactionImpl.enlistResource(
at com.sun.enterprise.transaction.JavaEETransactionImpl.enlistResource(
at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.enlistXAResource(
at com.sun.enterprise.transaction.JavaEETransactionManagerSimplified.enlistResource(
at com.sun.enterprise.resource.rm.SystemResourceManagerImpl.enlistResource(
at com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(

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.

christopherrued added a comment - 07/Jun/11 02:43 PM

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

marina vatkina added a comment - 07/Jun/11 02:48 PM

Fixed on trunk with

Sending src/main/java/com/sun/jts/CosTransactions/
Sending src/main/java/com/sun/jts/CosTransactions/
Sending src/main/java/com/sun/jts/jta/
Sending src/main/java/com/sun/jts/jtsxa/
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

marina vatkina added a comment - 07/Jun/11 02:49 PM

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

scatari added a comment - 07/Jun/11 03:46 PM

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

marina vatkina added a comment - 08/Jun/11 10:58 AM

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