You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Zarar Siddiqi <za...@gmail.com> on 2007/12/14 17:23:47 UTC

IllegalStateException: Current state not START_ELEMENT when using LocalTransportFactory for testing and supplying multiple parameters

When using AbstractCXFTest and using a LocalTransportFactory to run tests,
one gets an IllegalStateException thrown from
com.ctc.wstx.sr.BasicStreamReader Line 641:

    public String getAttributeValue(String nsURI, String localName) {
        if (mCurrToken != START_ELEMENT) {
            throw new
IllegalStateException(ErrorConsts.ERR_STATE_NOT_STELEM);
        }
        return mAttrCollector.getValue(nsURI, localName);
    }

All the web service methods with a single argument are working fine but if
you have multiple arguments (in my case 2), then the if condition
(mCurrToken != START_ELEMENT)  is evaluated to false with the value of
mCurrToken being 4 and START_ELEMENT being 1 (this is probably specific to
my service method but maybe it happens every time you have two arguments, i
don't know).  The same service runs fine when deployed inside a container
(i.e.: not using LocalTransportFactory).

I was about to create a JIRA for this but thought I'd let the user list look
at it first.

Thanks,
Zarar Siddiqi
-- 
View this message in context: http://www.nabble.com/IllegalStateException%3A-Current-state-not-START_ELEMENT-when-using-LocalTransportFactory-for-testing-and-supplying-multiple-parameters-tp14338780p14338780.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: IllegalStateException: Current state not START_ELEMENT when using LocalTransportFactory for testing and supplying multiple parameters

Posted by Daniel Kulp <dk...@apache.org>.
No idea.   Any chance you could send a test case?   I just updated our 
test case (DirectDispatchClientTest) to invoke a 2 param method and it 
was fine.

That said, there have been a couple fixes to the LocalTransport on trunk.

Dan


On Friday 14 December 2007, Zarar Siddiqi wrote:
> When using AbstractCXFTest and using a LocalTransportFactory to run
> tests, one gets an IllegalStateException thrown from
> com.ctc.wstx.sr.BasicStreamReader Line 641:
>
>     public String getAttributeValue(String nsURI, String localName) {
>         if (mCurrToken != START_ELEMENT) {
>             throw new
> IllegalStateException(ErrorConsts.ERR_STATE_NOT_STELEM);
>         }
>         return mAttrCollector.getValue(nsURI, localName);
>     }
>
> All the web service methods with a single argument are working fine
> but if you have multiple arguments (in my case 2), then the if
> condition (mCurrToken != START_ELEMENT)  is evaluated to false with
> the value of mCurrToken being 4 and START_ELEMENT being 1 (this is
> probably specific to my service method but maybe it happens every time
> you have two arguments, i don't know).  The same service runs fine
> when deployed inside a container (i.e.: not using
> LocalTransportFactory).
>
> I was about to create a JIRA for this but thought I'd let the user
> list look at it first.
>
> Thanks,
> Zarar Siddiqi



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog