This is not a known to me issue.
I tried to reproduce it with a smaller testcase but it didn't fail. I
committed it anyway though:
package org.jboss.test.xml;
public class MinOccurs0UnitTestCase
public void testMBeanUnmarshalling() throws Exception
Scott M Stark wrote:
In working on setting up a testcase for a custom
JavaBeanSchemaInitializer, I'm seeing an incorrect validation exception:
[code]
org.jboss.xb.binding.JBossXBException: Failed to parse source:
file:/C:/cvs/JBossHead/jboss-head/testsuite/output/resources/xml/mbeanserver/testXMBean2.xml
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:125)
at
org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:128)
at
org.jboss.test.xml.XMBean2UnitTestCase.testMbeanService(XMBean2UnitTestCase.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
Caused by: org.jboss.xb.binding.JBossXBRuntimeException: Requested
element {urn:jboss-test:xmbean:2.0}descriptors is not allowed in this
position in the sequence. The next element should be
{urn:jboss-test:xmbean:2.0}description
at
org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1.startElement(SequenceBinding.java:214)
at
org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding$Cursor.startElement(ModelGroupBinding.java:151)
at
org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:189)
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:269)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at
org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:121)
... 20 more
[/code]
The relevant schema is:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!--
The JBossXMBeanXB schema.
@version $Id: jboss_xmbean_1_2.dtd,v 1.3 2006/01/03 17:45:30 dimitris
Exp $
@author [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
@author Dimitris Andreadis
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
targetNamespace="urn:jboss-test:xmbean:2.0"
xmlns:xmbean="urn:jboss-test:xmbean:2.0"
xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
>
<xs:annotation>
<xs:documentation>The global jbossxb binding
information</xs:documentation>
<xs:appinfo>
<jbxb:schemaBindings>
<jbxb:ignoreUnresolvedFieldOrClass>false</jbxb:ignoreUnresolvedFieldOrClass>
<jbxb:replacePropertyRefs>true</jbxb:replacePropertyRefs>
</jbxb:schemaBindings>
</xs:appinfo>
</xs:annotation>
<xs:element name="mbean">
<xs:annotation>
<xs:documentation>
<![CDATA[
The mbean element is the root element of the XMBean
container descriptor.
<xmbean:mbean xmlns:xmbean="urn:jboss-test:xmbean:2.0">
...
</xmbean:mbean>
]]>
</xs:documentation>
<xs:appinfo>
<jbxb:class
impl="org.jboss.mx.metadata.xb.ModelMBeanInfoSupportWrapper"/>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="xmbean:description"/>
<xs:element minOccurs="0" ref="xmbean:descriptors"/>
<xs:element minOccurs="0" ref="xmbean:class"/>
<xs:element minOccurs="0" maxOccurs="unbounded"
ref="xmbean:constructor"/>
<xs:element minOccurs="0" maxOccurs="unbounded"
ref="xmbean:attribute"/>
<xs:element minOccurs="0" maxOccurs="unbounded"
ref="xmbean:operation"/>
<xs:element minOccurs="0" maxOccurs="unbounded"
ref="xmbean:notification"/>
</xs:sequence>
</xs:complexType>
</xs:element>
...
<xs:element name="description" type="xs:string">
<xs:annotation>
<xs:documentation>The description element provides human
readable descriptive text for constructors,
attributes, operations, paramters, notifications,
etc.</xs:documentation>
</xs:annotation>
</xs:element>
[/code]
The document I'm testing with:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<mbean xmlns="urn:jboss-test:xmbean:2.0"
code="org.jboss.naming.JNDIBindingService"
name="jboss.tests:service=JNDIBindingService">
<descriptors>
<interceptors>
<custom1:javabean xlmns:custom1="urn:jboss:simplejavabean:1.0"
code="org.jboss.test.jmx.interceptors.JNDISecurity"
attr1="some-text1" attr2="some-text2" />
<custom1:interceptor xlmns:custom1="urn:jboss:simplejavabean:1.0"
code="org.jboss.naming.interceptors.ProxyFactoryInterceptor"
proxyName="some-name" />
<interceptor
code="org.jboss.mx.interceptor.PersistenceInterceptor2" />
<interceptor
code="org.jboss.mx.interceptor.ModelMBeanInterceptor" />
<interceptor
code="org.jboss.mx.interceptor.ObjectReferenceInterceptor" />
</interceptors>
</descriptors>
</mbean>
[/code]
I don't see an existing jira issue for something like this. Is this a
known issue?
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development