java.lang.IndexOutOfBoundsException: only START_TAG can have attributes TEXT 
seen
---------------------------------------------------------------------------------

                 Key: JIBX-198
                 URL: http://jira.codehaus.org/browse/JIBX-198
             Project: JiBX
          Issue Type: Bug
    Affects Versions: JiBX 1.1.5
         Environment: Windows XP SP 2, JDK 1.4.2
            Reporter: Günther Wieser
         Attachments: JBUsageOptReq.zip

we found a problem with using nillable="true" and optional="true" on
the very same value tag.

think about the following example binding:
<?xml version="1.0" encoding="ISO-8859-2"?>
<binding>
        <mapping name="Data" class="usageoptreq.UsageOptReqData" 
ordered="false" flexible="true">
                <value name="optional1" field="optional1" nillable="true" 
usage="optional"/>
                <value name="optional2" field="optional2" nillable="true" 
usage="optional"/>
                <value name="optional3" field="optional3" nillable="true" 
usage="optional"/>
                <value name="optional4" field="optional4" nillable="true" 
usage="optional"/>
        </mapping>
</binding>


we get the following error during runtime (compilation works fine):

java.lang.IndexOutOfBoundsException: only START_TAG can have attributes TEXT 
seen ...<optional1>OO Optional1<... @6:26
        at org.xmlpull.mxp1.MXParser.getAttributeValue(MXParser.java:927)
        at 
org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.getAttributeValue(XMLPullReaderFactory.java:395)
        at 
org.jibx.runtime.impl.UnmarshallingContext.getAttributeValue(UnmarshallingContext.java:356)
        at 
org.jibx.runtime.impl.UnmarshallingContext.attributeBoolean(UnmarshallingContext.java:1881)
        at 
usageoptreq.UsageOptReqData.JiBX_binding_unmarshal_1_2(UsageOptReqData.java)
        at usageoptreq.JiBX_bindingUsageOptReqData_access.unmarshal()
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2537)
        at 
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2680)
        at 
usageoptreq.UsageOptReqTest.testCompileAndTransform(UsageOptReqTest.java:34)
        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:324)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at 
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

so far the only workaround we found is either not to use
nillable="true" or not to use optional="true". you can guess that this
is not what we wanted ;-)

Explanantion for the attached zip archive:
run the ant build file in srcipts/, then call the unit test. this produces the 
error.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs

Reply via email to