JDK-6179378 : An object could be constructed and returned without proper initializing fields in the constructor.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.4.2_05
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: x86
  • Submitted: 2004-10-14
  • Updated: 2011-12-15
  • Resolved: 2004-11-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2_05Resolved
Related Reports
Duplicate :  
Description
We found the bug in the application server MDB environment:

platform           solaris9 x86
Application server 8.1ee b32
mq                 FCS-6
jdk                1.4.2_05

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Server VM (build 1.4.2_05-b04, mixed mode)

Code snippet and the exception stack trace are provided below.  Related java classes are attached.  

We believe that private variable "queue" in SessionQueue object cannot be null in a healthy JVM.

QA were able to reproduce this bug three times during app server MDB stress tests.  Please see "see also" for detail description for the related bugs.

<SessionImpl>
    public SessionImpl (ConnectionImpl connection, boolean isTransacted, int
           acknowledgeMode, boolean allowJMSExtension, ManagedConnection mc)
           throws JMSException {

        sessionQueue = new SessionQueue();//line #291
        sessionQueue.validateQueue(); //line #292
    }
</SessionImpl>

<SessionQueue>
    
    private MessageQueue queue = null;

    public SessionQueue() {
            queue = new PriorityQueue();
    }

    protected synchronized void validateQueue() {
        if ( queue == null ) {
            throw new java.lang.Error  //line #91 
            ("JVM Error. Message Queue is null.");
        }
    }

</SessionQueue>


The following is the stack trace when the error occurred (from bug 6177455).

==============================================================================

[#|2004-10-13T05:13:00.740+0530|INFO|sun-appserver-ee8.1|javax.enterprise.system.container.ejb.mdb|_ThreadID=43;|MDB00037: [XATStress:XAT
StressMDB2]: Message-driven bean invocation exception: [javax.ejb.EJBException]|#]

[#|2004-10-13T05:13:00.741+0530|INFO|sun-appserver-ee8.1|javax.enterprise.system.container.ejb.mdb|_ThreadID=43;|javax.ejb.EJBException
javax.ejb.EJBException
        at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:2800)
        at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:2706)
        at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:2514)
        at com.sun.ejb.containers.MessageBeanContainer.afterMessageDeliveryInternal(MessageBeanContainer.java:1071)
        at com.sun.ejb.containers.MessageBeanContainer.afterMessageDelivery(MessageBeanContainer.java:1042)
        at com.sun.ejb.containers.MessageBeanListenerImpl.afterMessageDelivery(MessageBeanListenerImpl.java:46)
        at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:105)
        at $Proxy17.afterDelivery(Unknown Source)
        at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:228)
        at com.sun.enterprise.connectors.work.OneWork.doWork(OneWork.java:45)
        at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:398)
Caused by: java.lang.Error: JVM Error. Message Queue is null. Create time: 1097624580268 duration: 0
        at com.sun.messaging.jmq.jmsclient.SessionQueue.validateQueue(SessionQueue.java:91)
        at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:292)
        at com.sun.messaging.jmq.jmsclient.SessionImpl.<init>(SessionImpl.java:271)
        at com.sun.messaging.jmq.jmsclient.UnifiedSessionImpl.<init>(UnifiedSessionImpl.java:45)
        at com.sun.messaging.jmq.jmsclient.XASessionImpl.<init>(XASessionImpl.java:65)
        at com.sun.messaging.jmq.jmsclient.XATopicSessionImpl.<init>(XATopicSessionImpl.java:61)
        at com.sun.messaging.jmq.jmsclient.XAConnectionImpl.createTopicSession(XAConnectionImpl.java:154)
        at com.sun.messaging.jms.ra.ConnectionAdapter.createTopicSession(ConnectionAdapter.java:398)
        at XATStressMDB2.onMessage(XATStressMDB2.java:166)
        at sun.reflect.GeneratedMethodAccessor87.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:149)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:950)
        at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:154)
        at com.sun.ejb.containers.MessageBeanContainer.deliverMessage(MessageBeanContainer.java:956)
        at com.sun.ejb.containers.MessageBeanListenerImpl.deliverMessage(MessageBeanListenerImpl.java:42)
        at com.sun.enterprise.connectors.inflow.MessageEndpointInvocationHandler.invoke(MessageEndpointInvocationHandler.java:130)
        at $Proxy17.onMessage(Unknown Source)
        at com.sun.messaging.jms.ra.OnMessageRunner.run(OnMessageRunner.java:173)
        ... 2 more
-----------------------------------------------------------------------
###@###.### 10/14/04 19:58 GMT


Correction:  The VM option used was client VM, not server VM:

java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)
###@###.### 10/19/04 05:46 GMT

Comments
EVALUATION This appears to be addressed in 1.5.0 JDK.. If this needs to be addressed in older releases then an internal escalation needs to be filed.. Will be closing shortly unless I hear differently.. ###@###.### 10/19/04 12:06 GMT ###@###.### 11/1/04 15:38 GMT
19-10-2004