You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Joseph Campolongo (JIRA)" <xm...@xml.apache.org> on 2007/03/02 22:51:50 UTC
[jira] Created: (XMLBEANS-317) setXXX(null) on a nil element leaves
bean in invalid state
setXXX(null) on a nil element leaves bean in invalid state
----------------------------------------------------------
Key: XMLBEANS-317
URL: https://issues.apache.org/jira/browse/XMLBEANS-317
Project: XMLBeans
Issue Type: Bug
Components: XmlObject
Affects Versions: Version 2.2
Environment: Java_1.5.0_10 on Windows2000
Reporter: Joseph Campolongo
Given the following schema
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element name="TestSet">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="More">
<xs:complexType>
<xs:sequence>
<xs:element name="MoreName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
the following code will fail if assertions are enabled:
TestSetDocument doc = TestSetDocument.Factory.newInstance();
TestSet testSet = doc.addNewTestSet();
testSet.setMore(null);
testSet.setMore(null);
testSet.validate();
while it will succeed if assertions are disabled.
The exception is
at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)
at org.apache.xmlbeans.impl.store.Validate.<init>(Validate.java:39)
at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)
at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.java:343)
I will attach a test case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
RE: [jira] Commented: (XMLBEANS-317) setXXX(null) on a nil element
leaves bean in invalid state
Posted by Cezar Andrei <ce...@oracle.com>.
Kevin,
There is no timeline to resolve all open bugs, the priority is based on importance of the problem and contributor interest.
One way to get it fixed is by investigating it further and increase awareness around it. If you get stuck ask questions, usually people are very goo on answering them.
There is no question about it, we always appreciate contributions.
Cezar
> -----Original Message-----
> From: Kevin Van Dyck (JIRA) [mailto:xmlbeans-dev@xml.apache.org]
> Sent: Tuesday, February 16, 2010 9:41 AM
> To: xmlbeans-dev@xml.apache.org
> Subject: [jira] Commented: (XMLBEANS-317) setXXX(null) on a nil element
> leaves bean in invalid state
>
>
> [ https://issues.apache.org/jira/browse/XMLBEANS-
> 317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-
> tabpanel&focusedCommentId=12834262#action_12834262 ]
>
> Kevin Van Dyck commented on XMLBEANS-317:
> -----------------------------------------
>
> any idea wether this will ever get fixed?
>
> > setXXX(null) on a nil element leaves bean in invalid state
> > ----------------------------------------------------------
> >
> > Key: XMLBEANS-317
> > URL: https://issues.apache.org/jira/browse/XMLBEANS-317
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[jira] Commented: (XMLBEANS-317) setXXX(null) on a nil element
leaves bean in invalid state
Posted by "Matthew Smith (JIRA)" <xm...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XMLBEANS-317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12586866#action_12586866 ]
Matthew Smith commented on XMLBEANS-317:
----------------------------------------
I am having the same issue on xmlbeans 2.3.0 under Java 1.4.2. Turning off assertions does the trick. Will this issue be addressed in a future release?
Nested Exception is java.lang.AssertionError
at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
at org.apache.xmlbeans.impl.store.Saver$DocSaveCur.next(Saver.java:3607)
at org.apache.xmlbeans.impl.store.Saver$PrettySaveCur.next(Saver.java:4097)
at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:326)
at org.apache.xmlbeans.impl.store.Saver.<init>(Saver.java:123)
at org.apache.xmlbeans.impl.store.Saver$TextSaver.<init>(Saver.java:896)
at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)
at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)
at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1455)
at org.apache.xmlbeans.impl.values.XmlObjectBase.toString(XmlObjectBase.java:1440)
> setXXX(null) on a nil element leaves bean in invalid state
> ----------------------------------------------------------
>
> Key: XMLBEANS-317
> URL: https://issues.apache.org/jira/browse/XMLBEANS-317
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 2.2
> Environment: Java_1.5.0_10 on Windows2000
> Reporter: Joseph Campolongo
> Attachments: xmlbeans-317.zip
>
>
> Given the following schema
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> <xs:element name="TestSet">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Name" type="xs:string"/>
> <xs:element name="More">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="MoreName" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> the following code will fail if assertions are enabled:
> TestSetDocument doc = TestSetDocument.Factory.newInstance();
> TestSet testSet = doc.addNewTestSet();
> testSet.setMore(null);
> testSet.setMore(null);
> testSet.validate();
> while it will succeed if assertions are disabled.
> The exception is
> at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
> at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
> at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
> at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)
> at org.apache.xmlbeans.impl.store.Validate.<init>(Validate.java:39)
> at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)
> at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.java:343)
> I will attach a test case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
Re: Namespace prefix problem.
Posted by Serkan Taş <se...@hotmail.com>.
Question 1 or 2 ?
--------------------------------------------------
From: "Cezar Andrei" <ce...@oracle.com>
Sent: Wednesday, June 09, 2010 7:30 PM
To: <de...@xmlbeans.apache.org>; <xm...@xml.apache.org>
Subject: RE: Namespace prefix problem.
> Hi Serkan,
>
> Can paste the code that does the saving? Is it using the save method with
> the xmloptions parameter: XmlObject.save(outputstream|writer|file,
> XmlOptions) ?
>
> Cezar
>
> -----Original Message-----
> From: Serkan Taş [mailto:serkan_tas@hotmail.com]
> Sent: Wednesday, June 09, 2010 2:11 AM
> To: xmlbeans-dev@xml.apache.org
> Subject: Namespace prefix problem.
>
> Hi,
>
> I am facing with a problem of xml namspace prefix definition.
>
> Question 1 :
>
> I have got an xml below :
>
> <xml-fragment>
> <x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:role xsi:nil="true"
> xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
> </xml-fragment>
>
>
> If i use XMLOptions and the methods like setSaveSuggestedPrefixes to
> replace
> the prefixes, nothing changes.
>
>
> Quesiton 2;
>
> If i sent xml bean through Jmx, the resulting xml fragment changes :
>
> On client side before sending :
>
> <xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <x_:name/>
> <x_:surname/>
> <x_:role xsi:nil="true"/>
> <x_:userName/>
> </xml-fragment>
>
>
> On the server side, received xml :
>
> <xml-fragment>
> <x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
> <x_:role xsi:nil="true"
> xmlns:x_="http://www.hostname.com/XML_common_types"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
> <x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
> </xml-fragment>
>
> yours,
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
RE: Namespace prefix problem.
Posted by Cezar Andrei <ce...@oracle.com>.
Hi Serkan,
Can paste the code that does the saving? Is it using the save method with the xmloptions parameter: XmlObject.save(outputstream|writer|file, XmlOptions) ?
Cezar
-----Original Message-----
From: Serkan Taş [mailto:serkan_tas@hotmail.com]
Sent: Wednesday, June 09, 2010 2:11 AM
To: xmlbeans-dev@xml.apache.org
Subject: Namespace prefix problem.
Hi,
I am facing with a problem of xml namspace prefix definition.
Question 1 :
I have got an xml below :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
If i use XMLOptions and the methods like setSaveSuggestedPrefixes to replace
the prefixes, nothing changes.
Quesiton 2;
If i sent xml bean through Jmx, the resulting xml fragment changes :
On client side before sending :
<xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<x_:name/>
<x_:surname/>
<x_:role xsi:nil="true"/>
<x_:userName/>
</xml-fragment>
On the server side, received xml :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
yours,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
Namespace prefix problem.
Posted by Serkan Taş <se...@hotmail.com>.
Hi,
I am facing with a problem of xml namspace prefix definition.
Question 1 :
I have got an xml below :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
If i use XMLOptions and the methods like setSaveSuggestedPrefixes to replace
the prefixes, nothing changes.
Quesiton 2;
If i sent xml bean through Jmx, the resulting xml fragment changes :
On client side before sending :
<xml-fragment xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<x_:name/>
<x_:surname/>
<x_:role xsi:nil="true"/>
<x_:userName/>
</xml-fragment>
On the server side, received xml :
<xml-fragment>
<x_:name xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:surname xmlns:x_="http://www.hostname.com/XML_common_types"/>
<x_:role xsi:nil="true"
xmlns:x_="http://www.hostname.com/XML_common_types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
<x_:userName xmlns:x_="http://www.hostname.com/XML_common_types"/>
</xml-fragment>
yours,
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[jira] Commented: (XMLBEANS-317) setXXX(null) on a nil element
leaves bean in invalid state
Posted by "Kevin Van Dyck (JIRA)" <xm...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XMLBEANS-317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834262#action_12834262 ]
Kevin Van Dyck commented on XMLBEANS-317:
-----------------------------------------
any idea wether this will ever get fixed?
> setXXX(null) on a nil element leaves bean in invalid state
> ----------------------------------------------------------
>
> Key: XMLBEANS-317
> URL: https://issues.apache.org/jira/browse/XMLBEANS-317
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 2.2
> Environment: Java_1.5.0_10 on Windows2000
> Reporter: Joseph Campolongo
> Attachments: xmlbeans-317.zip
>
>
> Given the following schema
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> <xs:element name="TestSet">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Name" type="xs:string"/>
> <xs:element name="More">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="MoreName" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> the following code will fail if assertions are enabled:
> TestSetDocument doc = TestSetDocument.Factory.newInstance();
> TestSet testSet = doc.addNewTestSet();
> testSet.setMore(null);
> testSet.setMore(null);
> testSet.validate();
> while it will succeed if assertions are disabled.
> The exception is
> at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
> at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
> at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
> at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)
> at org.apache.xmlbeans.impl.store.Validate.<init>(Validate.java:39)
> at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)
> at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.java:343)
> I will attach a test case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[jira] Updated: (XMLBEANS-317) setXXX(null) on a nil element leaves
bean in invalid state
Posted by "Joseph Campolongo (JIRA)" <xm...@xml.apache.org>.
[ https://issues.apache.org/jira/browse/XMLBEANS-317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joseph Campolongo updated XMLBEANS-317:
---------------------------------------
Attachment: xmlbeans-317.zip
Drop xmlbean-2.2.0.jar and jsr173_api-1.0.jar in the lib folder and run ant to build.
This is a set of 7 tests, 6 of which all fail at the same place when assertions are enabled (at an assert), but pass when assertions are disabled.
> setXXX(null) on a nil element leaves bean in invalid state
> ----------------------------------------------------------
>
> Key: XMLBEANS-317
> URL: https://issues.apache.org/jira/browse/XMLBEANS-317
> Project: XMLBeans
> Issue Type: Bug
> Components: XmlObject
> Affects Versions: Version 2.2
> Environment: Java_1.5.0_10 on Windows2000
> Reporter: Joseph Campolongo
> Attachments: xmlbeans-317.zip
>
>
> Given the following schema
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> <xs:element name="TestSet">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="Name" type="xs:string"/>
> <xs:element name="More">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="MoreName" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
> the following code will fail if assertions are enabled:
> TestSetDocument doc = TestSetDocument.Factory.newInstance();
> TestSet testSet = doc.addNewTestSet();
> testSet.setMore(null);
> testSet.setMore(null);
> testSet.validate();
> while it will succeed if assertions are disabled.
> The exception is
> at org.apache.xmlbeans.impl.values.XmlObjectBase.build_text(XmlObjectBase.java:837)
> at org.apache.xmlbeans.impl.store.Xobj.ensureOccupancy(Xobj.java:1694)
> at org.apache.xmlbeans.impl.store.Cur.next(Cur.java:1444)
> at org.apache.xmlbeans.impl.store.Validate.process(Validate.java:74)
> at org.apache.xmlbeans.impl.store.Validate.<init>(Validate.java:39)
> at org.apache.xmlbeans.impl.store.Xobj.validate(Xobj.java:1860)
> at org.apache.xmlbeans.impl.values.XmlObjectBase.validate(XmlObjectBase.java:343)
> I will attach a test case.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org