You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Kapish Aggarwal <sc...@gmail.com> on 2009/02/25 17:33:08 UTC

EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
am having problems debugging the issue since any actions I take to
gather further information seems to resolve the problem (connecting a
debugger, attempting to produce more detailed logs from execution).
The following is the relevant stack trace I am hitting. My guess,
since I can't reliably recreate the problem, is that there is a timing
issue with multiple threads using the same stack, but can't seem to
verify it. Does anyone familiar with the code have some thoughts?

Kapish Aggarwal

java.util.EmptyStackException
	at java.util.Stack.pop(Stack.java:80)
	at org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
	at org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
	at org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
	at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
	at org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
	at org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
	at org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
	at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
	at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
	at org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
	at org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
	at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
	at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
	at org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)

Re: EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Feb 25, 2009 at 4:33 PM, Kapish Aggarwal <sc...@gmail.com>wrote:

> I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
> am having problems debugging the issue since any actions I take to
> gather further information seems to resolve the problem (connecting a
> debugger, attempting to produce more detailed logs from execution).
> The following is the relevant stack trace I am hitting. My guess,
> since I can't reliably recreate the problem, is that there is a timing
> issue with multiple threads using the same stack, but can't seem to
> verify it. Does anyone familiar with the code have some thoughts?
>
> Kapish Aggarwal
>
> java.util.EmptyStackException
>        at java.util.Stack.pop(Stack.java:80)
>        at
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
>        at
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
>        at
> org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
>        at
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
>        at
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
>        at
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
>        at
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
>        at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
>        at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
>        at
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)
>

Hi Kapish

Are there any particular environmental conditions in play here. Does it
always happen for you regardless of which test you run? Is it dependent on
the composite that's being read?

Simon

Re: EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

Posted by Kapish Aggarwal <sc...@gmail.com>.
The fix worked! I couldn't trace the call of next() from a nextTag()
method, but sure enough, your fixed eliminated the problem and
removing your fix brings the problem back. Thanks!

Kapish Aggarwal

On Wed, Feb 25, 2009 at 6:56 PM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> I checked in a possible fix under r747972. Please verify.
>
> Thanks,
> Raymond
>
> --------------------------------------------------
> From: "Kapish Aggarwal" <sc...@gmail.com>
> Sent: Wednesday, February 25, 2009 12:44 PM
> To: <de...@tuscany.apache.org>
> Subject: Re: EmptyStackException in
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader
>
>> As far as I can tell, nextTag isn't calling next. I have embedded
>> Tuscany into a server environment (WebSphere) and only hit the error
>> trying to start composites during the server startup. If the server is
>> already running, composites can start/stop without error. I've been
>> able to reproduce it with some frequency with one or two apps, but it
>> does not happen every time, which is making it difficult to debug. As
>> far as I can tell, it is not dependent on the composite being read.
>>
>> Kapish Aggarwal
>>
>> On Wed, Feb 25, 2009 at 1:37 PM, Raymond Feng <en...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> We push the namespace declarations for the current element on to the
>>> stack
>>> when next() or nextTag() is called. And then pop them out of the stack
>>> when
>>> the reader leaves an element. It might go out of sequence in this case.
>>> Maybe you can check if nextTag() calls next() in your case.
>>>
>>> Thanks,
>>> Raymond
>>> --------------------------------------------------
>>> From: "Kapish Aggarwal" <sc...@gmail.com>
>>> Sent: Wednesday, February 25, 2009 8:33 AM
>>> To: <de...@tuscany.apache.org>
>>> Subject: EmptyStackException in
>>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader
>>>
>>>> I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
>>>> am having problems debugging the issue since any actions I take to
>>>> gather further information seems to resolve the problem (connecting a
>>>> debugger, attempting to produce more detailed logs from execution).
>>>> The following is the relevant stack trace I am hitting. My guess,
>>>> since I can't reliably recreate the problem, is that there is a timing
>>>> issue with multiple threads using the same stack, but can't seem to
>>>> verify it. Does anyone familiar with the code have some thoughts?
>>>>
>>>> Kapish Aggarwal
>>>>
>>>> java.util.EmptyStackException
>>>> at java.util.Stack.pop(Stack.java:80)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
>>>> at
>>>>
>>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)
>>>
>>>
>

Re: EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I checked in a possible fix under r747972. Please verify.

Thanks,
Raymond

--------------------------------------------------
From: "Kapish Aggarwal" <sc...@gmail.com>
Sent: Wednesday, February 25, 2009 12:44 PM
To: <de...@tuscany.apache.org>
Subject: Re: EmptyStackException in 
org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

> As far as I can tell, nextTag isn't calling next. I have embedded
> Tuscany into a server environment (WebSphere) and only hit the error
> trying to start composites during the server startup. If the server is
> already running, composites can start/stop without error. I've been
> able to reproduce it with some frequency with one or two apps, but it
> does not happen every time, which is making it difficult to debug. As
> far as I can tell, it is not dependent on the composite being read.
>
> Kapish Aggarwal
>
> On Wed, Feb 25, 2009 at 1:37 PM, Raymond Feng <en...@gmail.com> wrote:
>> Hi,
>>
>> We push the namespace declarations for the current element on to the 
>> stack
>> when next() or nextTag() is called. And then pop them out of the stack 
>> when
>> the reader leaves an element. It might go out of sequence in this case.
>> Maybe you can check if nextTag() calls next() in your case.
>>
>> Thanks,
>> Raymond
>> --------------------------------------------------
>> From: "Kapish Aggarwal" <sc...@gmail.com>
>> Sent: Wednesday, February 25, 2009 8:33 AM
>> To: <de...@tuscany.apache.org>
>> Subject: EmptyStackException in
>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader
>>
>>> I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
>>> am having problems debugging the issue since any actions I take to
>>> gather further information seems to resolve the problem (connecting a
>>> debugger, attempting to produce more detailed logs from execution).
>>> The following is the relevant stack trace I am hitting. My guess,
>>> since I can't reliably recreate the problem, is that there is a timing
>>> issue with multiple threads using the same stack, but can't seem to
>>> verify it. Does anyone familiar with the code have some thoughts?
>>>
>>> Kapish Aggarwal
>>>
>>> java.util.EmptyStackException
>>> at java.util.Stack.pop(Stack.java:80)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
>>> at
>>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
>>> at
>>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
>>> at
>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
>>> at
>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
>>> at
>>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
>>> at
>>> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
>>> at
>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
>>> at
>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
>>> at
>>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)
>>
>> 

Re: EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

Posted by Kapish Aggarwal <sc...@gmail.com>.
As far as I can tell, nextTag isn't calling next. I have embedded
Tuscany into a server environment (WebSphere) and only hit the error
trying to start composites during the server startup. If the server is
already running, composites can start/stop without error. I've been
able to reproduce it with some frequency with one or two apps, but it
does not happen every time, which is making it difficult to debug. As
far as I can tell, it is not dependent on the composite being read.

Kapish Aggarwal

On Wed, Feb 25, 2009 at 1:37 PM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> We push the namespace declarations for the current element on to the stack
> when next() or nextTag() is called. And then pop them out of the stack when
> the reader leaves an element. It might go out of sequence in this case.
> Maybe you can check if nextTag() calls next() in your case.
>
> Thanks,
> Raymond
> --------------------------------------------------
> From: "Kapish Aggarwal" <sc...@gmail.com>
> Sent: Wednesday, February 25, 2009 8:33 AM
> To: <de...@tuscany.apache.org>
> Subject: EmptyStackException in
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader
>
>> I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
>> am having problems debugging the issue since any actions I take to
>> gather further information seems to resolve the problem (connecting a
>> debugger, attempting to produce more detailed logs from execution).
>> The following is the relevant stack trace I am hitting. My guess,
>> since I can't reliably recreate the problem, is that there is a timing
>> issue with multiple threads using the same stack, but can't seem to
>> verify it. Does anyone familiar with the code have some thoughts?
>>
>> Kapish Aggarwal
>>
>> java.util.EmptyStackException
>> at java.util.Stack.pop(Stack.java:80)
>> at
>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
>> at
>> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
>> at
>> org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
>> at
>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
>> at
>> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
>> at
>> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
>> at
>> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
>> at
>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
>> at
>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
>> at
>> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
>> at
>> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
>> at
>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
>> at
>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
>> at
>> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)
>
>

Re: EmptyStackException in org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

Posted by Raymond Feng <en...@gmail.com>.
Hi,

We push the namespace declarations for the current element on to the stack 
when next() or nextTag() is called. And then pop them out of the stack when 
the reader leaves an element. It might go out of sequence in this case. 
Maybe you can check if nextTag() calls next() in your case.

Thanks,
Raymond
--------------------------------------------------
From: "Kapish Aggarwal" <sc...@gmail.com>
Sent: Wednesday, February 25, 2009 8:33 AM
To: <de...@tuscany.apache.org>
Subject: EmptyStackException in 
org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader

> I have hit an unusual EmptyStackException in TuscanyXMLStreamReader. I
> am having problems debugging the issue since any actions I take to
> gather further information seems to resolve the problem (connecting a
> debugger, attempting to produce more detailed logs from execution).
> The following is the relevant stack trace I am hitting. My guess,
> since I can't reliably recreate the problem, is that there is a timing
> issue with multiple threads using the same stack, but can't seem to
> verify it. Does anyone familiar with the code have some thoughts?
>
> Kapish Aggarwal
>
> java.util.EmptyStackException
> at java.util.Stack.pop(Stack.java:80)
> at 
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.popContext(TuscanyXMLStreamReader.java:73)
> at 
> org.apache.tuscany.sca.contribution.processor.TuscanyXMLStreamReader.next(TuscanyXMLStreamReader.java:85)
> at 
> org.apache.tuscany.sca.contribution.processor.ValidatingXMLStreamReader.next(ValidatingXMLStreamReader.java:148)
> at 
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:598)
> at 
> org.apache.tuscany.sca.assembly.xml.CompositeProcessor.read(CompositeProcessor.java:91)
> at 
> org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint$LazyStAXArtifactProcessor.read(DefaultStAXArtifactProcessorExtensionPoint.java:360)
> at 
> org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor.read(ExtensibleStAXArtifactProcessor.java:152)
> at 
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:151)
> at 
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:118)
> at 
> org.apache.tuscany.sca.assembly.xml.CompositeDocumentProcessor.read(CompositeDocumentProcessor.java:57)
> at 
> org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor.read(ExtensibleURLArtifactProcessor.java:96)
> at 
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.processReadPhase(ContributionServiceImpl.java:536)
> at 
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.addContribution(ContributionServiceImpl.java:387)
> at 
> org.apache.tuscany.sca.contribution.service.impl.ContributionServiceImpl.contribute(ContributionServiceImpl.java:189)