-
30. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 6, 2008 10:52 AM (in response to kabirkhan)"adrian@jboss.org" wrote:
"kabir.khan@jboss.com" wrote:
Reading this thread http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134204#4134204 I came back to this. Regarding 3) What would this xsd:refine map to in jaxb annotations? My understanding was that using jaxb it generates a schema from the annotations?
It doesn't map to anything .
The xsd:redefine, just specifies what is the default behaviour the JBossXBBuilder
which is to include types reachable from your hierarchy in your namespace
(absent any explicit namepace= in the annotations).
You've confused me :-) Is this doable now, or is this a feature that needs adding to JBossXB? I know how to use xsd:redefine if there is a schema, but seeing as jbossxb doesn't use that musn't there be an annotation to set this up? If it is doable now, what do I need to do to make it happen? -
31. Re: Implementing JAXB style parsing for aop-mc-int
adrian.brock Mar 6, 2008 3:21 PM (in response to kabirkhan)"kabir.khan@jboss.com" wrote:
You've confused me :-) Is this doable now, or is this a feature that needs adding to JBossXB? I know how to use xsd:redefine if there is a schema, but seeing as jbossxb doesn't use that musn't there be an annotation to set this up?
I'll repeat again. xsd:redefine is the default behaviour of the jbossxb builder from
annotations.
If it is doable now, what do I need to do to make it happen?
Create a schema you can xsd:redefine.
The schema document is still required for a validating xml parser
or modifying the xml in some tools. -
32. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 7, 2008 8:11 AM (in response to kabirkhan)I'm trying to decide which types and groups to put into mc-common_1_0.xsd. The easy way is to put everything apart from:
deploymentType
beanType
beanFactoryType
lazyType
Does that sound about right, or do you think I should get rid of some more types? -
33. Re: Implementing JAXB style parsing for aop-mc-int
adrian.brock Mar 7, 2008 8:27 AM (in response to kabirkhan)Correct. Everything except the top level elements.
I'd actually call the schema something like:
jboss-beans-common-2.0.xsd
You probably want to sync with Ales since he has a similar requirement for the policy xsd. -
34. Re: Implementing JAXB style parsing for aop-mc-int
adrian.brock Mar 7, 2008 8:31 AM (in response to kabirkhan)"kabir.khan@jboss.com" wrote:
Does that sound about right, or do you think I should get rid of some more types?
Only if you think it causes you a problem. It is the elements that are the important thing
since when you xsd:redefine they will become entry points into your schema
so you don't want them in the common schema. -
36. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 10, 2008 3:38 PM (in response to kabirkhan)As mentioned here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=131367 I have implemented the xsd:refine stuff for bean-deployer_2_0.xsd.
This schema reuses the jboss-beans-common_2_0.xsd as follows (bean-deployer_2_0.xsd and jboss-beans-common_2_0.xsd live in the same folder):<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:bean-deployer:2.0" xmlns="urn:jboss:bean-deployer:2.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"> <xsd:redefine schemaLocation="jboss-beans-common_2_0.xsd"> <xsd:complexType name="beanType"> <xsd:complexContent> <xsd:extension base="beanType"/> </xsd:complexContent> </xsd:complexType> ... </xsd:redefine> <xsd:element name="deployment" type="deploymentType"> ... </xsd:element> <xsd:complexType name="deploymentType"> ... <xsd:choice minOccurs="0" maxOccurs="unbounded"> ... </xsd:choice> <xsd:attribute name="name" type="xsd:string" use="optional"/> <xsd:attribute name="scoped" type="xsd:boolean" use="optional"/> <xsd:attribute name="mode" type="controllerModeType" use="optional"/> </xsd:complexType> <xsd:element name="bean" type="beanType"/> <xsd:element name="beanfactory" type="beanfactoryType"/> <xsd:element name="lazy" type="lazyType"/> </xsd:schema>
This seems to work, all the kernel tests are passing.
Now when I try to do the same thing from my aop-beans_1_0.xsd I get an error:org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/target/tests-classes/org/jboss/test/microcontainer/beans/test/AspectSimpleAopTestCase.xml@9,99 at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177) at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:139) at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:147) at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.deploy(MicrocontainerTestDelegate.java:294) at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.deploy(MicrocontainerTestDelegate.java:438) at org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate.deploy(AOPMicrocontainerTestDelegate.java:76) at org.jboss.test.kernel.junit.MicrocontainerTestDelegate.setUp(MicrocontainerTestDelegate.java:83) at org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate.setUp(AOPMicrocontainerTestDelegate.java:60) at org.jboss.test.AbstractTestSetup.setUp(AbstractTestSetup.java:63) at junit.extensions.TestSetup$1.protect(TestSetup.java:18) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) 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) Caused by: java.lang.StackOverflowError at java.lang.String.indexOf(String.java:1352) at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:127) at sun.net.www.protocol.file.Handler.parseURL(Handler.java:50) at java.net.URL.<init>(URL.java:596) at java.net.URL.<init>(URL.java:464) at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:881) at sun.misc.URLClassPath$FileLoader.findResource(URLClassPath.java:871) at sun.misc.URLClassPath.findResource(URLClassPath.java:142) at java.net.URLClassLoader$2.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findResource(URLClassLoader.java:359) at java.lang.ClassLoader.getResource(ClassLoader.java:977) at org.jboss.util.xml.JBossEntityResolver.loadClasspathResource(JBossEntityResolver.java:521) at org.jboss.util.xml.JBossEntityResolver.resolvePublicID(JBossEntityResolver.java:329) at org.jboss.util.xml.JBossEntityResolver.resolveEntity(JBossEntityResolver.java:259) at org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.getInputSource(DefaultSchemaResolver.java:443) at org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver.resolveAsLSInput(DefaultSchemaResolver.java:419) at org.jboss.xb.binding.Util$1.resolveResource(Util.java:468) at org.apache.xerces.util.DOMEntityResolverWrapper.resolveEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager.resolveEntity(Unknown Source) at org.apache.xerces.impl.xs.XMLSchemaLoader.resolveDocument(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.resolveSchema(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(Unknown Source)
The trigger for this seems to be the inclusion of something in the aop-beans.xsd. In other words, if I uncomment either the xsd:import or the xsd:redefine it falls over with the error seen. If left commented out it passes this stage, but since I've got rid of most elements from the schema to isolate this error it fails when it comes to doing the parsing.<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:aop-beans:1.0" xmlns="urn:jboss:aop-beans:1.0" xmlns:mc="urn:jboss:bean-deployer:2.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" > <!-- xsd:import namespace="urn:jboss:bean-deployer:2.0"/--> <!-- xsd:redefine schemaLocation="jboss-beans-common_2_0.xsd"> <xsd:simpleType name="classNameType"/> </xsd:redefine --> ...
-
37. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 11, 2008 1:11 PM (in response to kabirkhan)To complete my previous stack trace, if I turn on the redefine part, the entry point into the infinite recursion is
... XSDHandler.constructTrees(Element, String, XSDDescription) line: not available XSDHandler.constructTrees(Element, String, XSDDescription) line: not available XSDHandler.parseSchema(XMLInputSource, XSDDescription, Hashtable) line: not available XMLSchemaLoader.loadSchema(XSDDescription, XMLInputSource, Hashtable) line: not available XMLSchemaLoader.loadGrammar(XMLInputSource) line: not available XSLoaderImpl.load(LSInput) line: not available Util.loadSchema(InputStream, String, SchemaBindingResolver) line: 395 XsdBinder.bind(InputStream, String, SchemaBindingResolver, boolean) line: 175 XsdBinder.bind(InputStream, String, String, boolean) line: 146 DefaultSchemaResolver.resolve(String, String, String) line: 330 WildcardBinding.getElement(QName, Attributes) line: 174 SequenceBinding$1.startElement(QName, Attributes, Set, List, boolean) line: 307 SequenceBinding$1.startElement(QName, Attributes, Set, List, boolean) line: 254 SequenceBinding$1(ModelGroupBinding$Cursor).startElement(QName, Attributes) line: 185 SundayContentHandler.startElement(String, String, String, Attributes, XSTypeDefinition) line: 447 SaxJBossXBParser$DelegatingContentHandler.startElement(String, String, String, Attributes) line: 407 SAXParserImpl$JAXPSAXParser(AbstractSAXParser).startElement(QName, XMLAttributes, Augmentations) line: not available XIncludeHandler.startElement(QName, XMLAttributes, Augmentations) line: not available XMLNSDocumentScannerImpl.scanStartElement() line: not available XMLNSDocumentScannerImpl$NSContentDispatcher(XMLDocumentFragmentScannerImpl$FragmentContentDispatcher).dispatch(boolean) line: not available XMLNSDocumentScannerImpl(XMLDocumentFragmentScannerImpl).scanDocument(boolean) line: not available XIncludeAwareParserConfiguration(XML11Configuration).parse(boolean) line: not available XIncludeAwareParserConfiguration(XML11Configuration).parse(XMLInputSource) line: not available SAXParserImpl$JAXPSAXParser(XMLParser).parse(XMLInputSource) line: not available SAXParserImpl$JAXPSAXParser(AbstractSAXParser).parse(String) line: not available SAXParserImpl$JAXPSAXParser.parse(String) line: not available SaxJBossXBParser.parse(String, JBossXBParser$ContentHandler) line: 173 UnmarshallerImpl.unmarshal(String, SchemaBindingResolver) line: 139 BasicXMLDeployer.deploy(URL) line: 147 AOPMicrocontainerTestDelegate(MicrocontainerTestDelegate).deploy(URL) line: 297 AOPMicrocontainerTestDelegate(MicrocontainerTestDelegate).deploy() line: 441 AOPMicrocontainerTestDelegate.deploy() line: 76 AOPMicrocontainerTestDelegate(MicrocontainerTestDelegate).setUp() line: 86 AOPMicrocontainerTestDelegate.setUp() line: 60
Also, my jboss-beans-common_2_0.xsd header looks like<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:jboss:beans-common:2.0" xmlns="urn:jboss:beans-common:2.0" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"> ...
I will try removing the namespace from that, and see if that breaks it -
38. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 11, 2008 1:56 PM (in response to kabirkhan)The input to
org.jboss.util.xml.JBossEntityResolver.resolveEntity(JBossEntityResolver.java:259)
is:
nsURI "urn:jboss:aop-beans:1.0"
baseURI null
schemaLocation "jboss-beans-common_2_0.xsd"
If I modify the xsd:refefine to<xsd:redefine schemaLocation="jboss-beans-common_2_0.xsd"> <xsd:simpleType name="classNameType"/> </xsd:redefine>
This input becomes:
nsURI "urn:jboss:aop-beans:1.0"
baseURI null
schemaLocation "jboss-beans-common_2_0.xsd"
It makes no difference, the call to resolveEntity() always seems to use the nsURI, which is always urn:jboss:aop-beans:1.0, and so always returns aop-beans_1_0.xsd.
I have turned on trace logging:0 DEBUG [AspectSimpleAopTestCase] ==== setUp org.jboss.test.microcontainer.beans.test.AspectSimpleAopTestCase ==== XXXX turn off enabling trace!!!! 15 DEBUG [KernelFactory] Starting JBoss Kernel construction... 468 DEBUG [KernelFactory] Completed JBoss Kernel construction. Duration: 437 milliseconds 547 TRACE [SingletonSchemaResolverFactory] Mapped initializer 'urn:jboss:aop-beans:1.0' to 'org.jboss.aop.microcontainer.beans.xml.AOPBeansS chemaInitializer' 547 TRACE [SingletonSchemaResolverFactory] Parse annotations 'urn:jboss:aop-beans:1.0' set to 'false' 547 TRACE [SingletonSchemaResolverFactory] Ignored: 593 TRACE [SingletonSchemaResolverFactory] Mapped 'urn:jboss:bean-deployer' to 'org.jboss.kernel.plugins.deployment.AbstractKernelDeployment 10' 593 TRACE [SingletonSchemaResolverFactory] Mapped 'urn:jboss:bean-deployer:2.0' to 'org.jboss.kernel.plugins.deployment.AbstractKernelDeploy ment' 609 TRACE [SingletonSchemaResolverFactory] Mapped 'urn:jboss:javabean:1.0' to 'org.jboss.javabean.plugins.jaxb.JavaBean10' 609 TRACE [SingletonSchemaResolverFactory] Mapped 'urn:jboss:javabean:2.0' to 'org.jboss.javabean.plugins.jaxb.JavaBean20' 625 TRACE [SingletonSchemaResolverFactory] Mapped 'urn:jboss:policy:1.0' to 'org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData' 640 DEBUG [AspectSimpleAopTestCase] No test specific deployment org/jboss/test/microcontainer/beans/test/AspectSimpleAopTestCase-aop.xml 640 DEBUG [AspectSimpleAopTestCase] Deploying file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/target/tests-classes/org/jb oss/test/microcontainer/beans/test/AspectSimpleAopTestCase.xml 859 DEBUG [SaxJBossXBParser] Created parser: org.apache.xerces.jaxp.SAXParserImpl@4a63d8, isNamespaceAware: true, isValidating: true, isXInc ludeAware: true 875 DEBUG [SaxJBossXBParser] http://xml.org/sax/features/validation set to: true 875 DEBUG [SaxJBossXBParser] http://xml.org/sax/features/namespaces set to: true 875 DEBUG [SaxJBossXBParser] http://apache.org/xml/features/validation/dynamic set to: true 906 DEBUG [SaxJBossXBParser] Created parser: org.apache.xerces.jaxp.SAXParserImpl@4a63d8, isNamespaceAware: true, isValidating: true, isXInc ludeAware: true 953 TRACE [DefaultSchemaResolver] Mapped schemaLocation to filename: deployment 953 TRACE [DefaultSchemaResolver] found bindingClass, nsURI=urn:jboss:bean-deployer:2.0, baseURI=null, schemaLocation=deployment, class=clas s org.jboss.kernel.plugins.deployment.AbstractKernelDeployment 1656 TRACE [DefaultSchemaResolver] resolved schema: org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding@1b60280 1656 TRACE [SundayContentHandler] pushed {urn:jboss:bean-deployer:2.0}deployment=org.jboss.xb.spi.DefaultBeanAdapter@15093f1, binding=org.jb oss.xb.binding.sunday.unmarshalling.ElementBinding@120bf2c({urn:jboss:bean-deployer:2.0}deployment, type={urn:jboss:bean-deployer:2.0}deploy mentType) 1687 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}bean in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@e6f 7d2, 9: sequence {urn:jboss:bean-deployer:2.0}classloader sequence {urn:jboss:bean-deployer:2.0}create {urn:jboss:bean-deployer:2.0}start {u rn:jboss:bean-deployer:2.0}stop {urn:jboss:bean-deployer:2.0}destroy sequence sequence ] 1687 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}bean in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@198 36ed, 1: {urn:jboss:bean-deployer:2.0}annotation ] 1687 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}bean in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@394 43f, 1: choice ] 1687 TRACE [ChoiceBinding] startElement {urn:jboss:bean-deployer:2.0}bean in org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45 , 3: {urn:jboss:bean-deployer:2.0}bean {urn:jboss:bean-deployer:2.0}beanfactory {urn:jboss:bean-deployer:2.0}lazy ] 1687 TRACE [ChoiceBinding] found {urn:jboss:bean-deployer:2.0}bean in org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45 1687 TRACE [ChoiceBinding] leaving org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45 i=0, pos=0 1687 TRACE [SundayContentHandler] pushed cursor org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1@3e0ebb, o=org.jboss.xb.spi.Defau ltBeanAdapter@15093f1 1687 TRACE [SundayContentHandler] start repeatable (2): org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@39443f 1687 TRACE [SundayContentHandler] pushed cursor org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1@da4b71, o=org.jboss.xb.spi.Defau ltBeanAdapter@15093f1 1687 TRACE [SundayContentHandler] pushed cursor org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding$1@18f1d7e, o=org.jboss.xb.spi.Defaul tBeanAdapter@15093f1 1687 TRACE [SundayContentHandler] start repeatable (4): org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@d9660d({urn:jboss:bean-dep loyer:2.0}bean, type={urn:jboss:bean-deployer:2.0}beanType) 1703 TRACE [SundayContentHandler] pushed {urn:jboss:bean-deployer:2.0}bean=org.jboss.xb.spi.DefaultBeanAdapter@153f67e, binding=org.jboss.xb .binding.sunday.unmarshalling.ElementBinding@d9660d({urn:jboss:bean-deployer:2.0}bean, type={urn:jboss:bean-deployer:2.0}beanType) 1703 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}constructor in org.jboss.xb.binding.sunday.unmarshalling.SequenceBind ing@15bdc50, 16: sequence sequence {urn:jboss:bean-deployer:2.0}classloader {urn:jboss:bean-deployer:2.0}constructor sequence {urn:jboss:bea n-deployer:2.0}create {urn:jboss:bean-deployer:2.0}start {urn:jboss:bean-deployer:2.0}stop {urn:jboss:bean-deployer:2.0}destroy sequence seq uence sequence sequence sequence sequence sequence ] 1703 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}constructor in org.jboss.xb.binding.sunday.unmarshalling.SequenceBind ing@1dd3812, 1: {urn:jboss:bean-deployer:2.0}alias ] 1703 TRACE [SequenceBinding] startElement {urn:jboss:bean-deployer:2.0}constructor in org.jboss.xb.binding.sunday.unmarshalling.SequenceBind ing@9e5c73, 1: {urn:jboss:bean-deployer:2.0}annotation ] 1703 TRACE [SequenceBinding] found {urn:jboss:bean-deployer:2.0}constructor in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@15b dc50 1703 TRACE [SundayContentHandler] pushed cursor org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding$1@8c436b, o=org.jboss.xb.spi.Defau ltBeanAdapter@153f67e 1703 TRACE [SundayContentHandler] pushed {urn:jboss:bean-deployer:2.0}constructor=org.jboss.xb.spi.DefaultBeanAdapter@1b15692, binding=org.j boss.xb.binding.sunday.unmarshalling.ElementBinding@1aa9f99({urn:jboss:bean-deployer:2.0}constructor, type={urn:jboss:bean-deployer:2.0}cons tructorType) 1703 TRACE [SundayContentHandler] poped {urn:jboss:bean-deployer:2.0}constructor=[org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1 aa9f99({urn:jboss:bean-deployer:2.0}constructor, type={urn:jboss:bean-deployer:2.0}constructorType), minOccurs=0, maxOccurs=1] 1703 TRACE [SundayContentHandler] poped org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1aa9f99({urn:jboss:bean-deployer:2.0}constr uctor, type={urn:jboss:bean-deployer:2.0}constructorType) 1703 TRACE [SundayContentHandler] poped {urn:jboss:bean-deployer:2.0}bean=[org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@d9660d({ urn:jboss:bean-deployer:2.0}bean, type={urn:jboss:bean-deployer:2.0}beanType), minOccurs=0, maxOccurs=unbounded] 1703 TRACE [SundayContentHandler] end repeatable (4): org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@d9660d({urn:jboss:bean-deplo yer:2.0}bean, type={urn:jboss:bean-deployer:2.0}beanType) 1718 TRACE [SundayContentHandler] poped org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@d9660d({urn:jboss:bean-deployer:2.0}bean, t ype={urn:jboss:bean-deployer:2.0}beanType) 1718 TRACE [SequenceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@39443 f, 1: choice ] 1718 TRACE [SundayContentHandler] poped org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45 1718 TRACE [SequenceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@e6f7d 2, 9: sequence {urn:jboss:bean-deployer:2.0}classloader sequence {urn:jboss:bean-deployer:2.0}create {urn:jboss:bean-deployer:2.0}start {urn :jboss:bean-deployer:2.0}stop {urn:jboss:bean-deployer:2.0}destroy sequence sequence ] 1718 TRACE [SequenceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@39443 f, 1: choice ] 1718 TRACE [ChoiceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45, 3: {urn:jboss:bean-deployer:2.0}bean {urn:jboss:bean-deployer:2.0}beanfactory {urn:jboss:bean-deployer:2.0}lazy ] 1718 TRACE [ChoiceBinding] leaving org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding@1afae45 i=2, pos=-1 1718 TRACE [SequenceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@7f4ec , 1: {urn:jboss:bean-deployer:2.0}alias ] 1718 TRACE [SequenceBinding] startElement {urn:jboss:aop-beans:1.0}aspect in org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding@60e12 8, 1: ] 1718 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=null 1718 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 1718 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 1718 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 1718 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId 1718 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=null, is=org.xml.sax.InputSou rce@5e1077 1718 TRACE [DefaultSchemaResolver] found schema InputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=null 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0 2172 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 2172 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 2172 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 2172 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0, i s=org.xml.sax.InputSource@1f82982 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0 2172 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 2172 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 2172 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 2172 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0, i s=org.xml.sax.InputSource@154864a 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0 2172 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 2172 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 2172 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 2172 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0, i s=org.xml.sax.InputSource@1742700 2172 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0 2172 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 2172 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 2187 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 2203 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId 2203 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0, i s=org.xml.sax.InputSource@17431b9 2203 TRACE [DefaultSchemaResolver] getInputSource, nsURI=urn:jboss:aop-beans:1.0, baseURI=null, schemaLocation=urn:jboss:beans-common:2.0 2203 TRACE [JBossEntityResolver] resolvePublicID, publicId=urn:jboss:aop-beans:1.0 2203 TRACE [JBossEntityResolver] Found entity from publicId=urn:jboss:aop-beans:1.0 fileName=aop-beans_1_0.xsd 2203 TRACE [JBossEntityResolver] schema/aop-beans_1_0.xsd maps to URL: file:/C:/cygwin/home/Kabir/sourcecontrol/microcontainer/aop-mc-int/ta rget/classes/schema/aop-beans_1_0.xsd 2203 TRACE [DefaultSchemaResolver] Resolved schema using namespace as publicId and schemaLocation as systemId
BTW I did not register urn:jboss:beans-common:2.0 anywhere yet, it returns the wrong thing before it gets that far -
39. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 11, 2008 2:04 PM (in response to kabirkhan)Maybe the way I did redefine in bean-deployer_2_0.xsd is wrong as well? Having set breakpoints similar to the ones in shown stack trace they do not get called, so I guess no validation is done of the schema when using jaxb?
-
40. Re: Implementing JAXB style parsing for aop-mc-int
adrian.brock Mar 12, 2008 9:29 AM (in response to kabirkhan)"kabir.khan@jboss.com" wrote:
Maybe the way I did redefine in bean-deployer_2_0.xsd is wrong as well? Having set breakpoints similar to the ones in shown stack trace they do not get called, so I guess no validation is done of the schema when using jaxb?
Not unless you enable schema validation.
For the rest, you need to speak to Alex about what the ScheamResolver is doing
(i.e. caching by namespace uri instead of the schema location when it is available).
There's already a thread on a similar issue from about a year ago. -
41. Re: Implementing JAXB style parsing for aop-mc-int
aloubyansky Mar 13, 2008 10:08 AM (in response to kabirkhan)There is a bug in the DefaultSchemaResolver that I am going to fix. But there is another issue you are going to run into after that. I.e. redefine can only be used with schemas with the same targetNamespace or with no targetNamespace. So, in your example you'll get an error like
org.jboss.xb.binding.JBossXBRuntimeException: -1:-1 10:18 src-redefine.3.1: The targetNamespace of the referenced schema, currently 'urn:jboss:beans-common:2.0', must be identical to that of the redefining schema, currently 'urn:jboss:aop-beans:1.0'. at org.jboss.xb.binding.sunday.unmarshalling.XsdBinderTerminatingErrorHandler.handleError(XsdBinderTerminatingErrorHandler.java:40) at org.apache.xerces.impl.xs.XMLSchemaLoader.reportDOMFatalError(Unknown Source) at org.apache.xerces.impl.xs.XSLoaderImpl.loadURI(Unknown Source) at org.jboss.xb.binding.Util.loadSchema(Util.java:367)
PS: I saw you also tried the namespace as the schemaLocation, it should be the filename. -
42. Re: Implementing JAXB style parsing for aop-mc-int
adrian.brock Mar 13, 2008 10:12 AM (in response to kabirkhan)jboss-beans-common shouldn't have a namespace
I've said that every time I've mentioned this schema :-(
Anyway, I've reverted the xsd:redefine until the problem is fixed. -
43. Re: Implementing JAXB style parsing for aop-mc-int
aloubyansky Mar 17, 2008 11:01 AM (in response to kabirkhan)I've fixed JBossEntityResolver in common-core. Issue http://jira.jboss.com/jira/browse/JBCOMMON-43 I left it open for now in case someone has concerns with the fix.
Do you need a release of the common[-core] now? Or do you have a workaround with the custom resolver and can wait?
In fact, to fix the issue you only need the updated common-core. There have been no related change in XB (except the testcase). -
44. Re: Implementing JAXB style parsing for aop-mc-int
kabirkhan Mar 17, 2008 6:06 PM (in response to kabirkhan)Thanks, I will try with a local snapshot of common-core.