[jboss-dev-forums] [Design of AOP on JBoss (Aspects/JBoss)] - Re: Implementing JAXB style parsing for aop-mc-int

kabir.khan@jboss.com do-not-reply at jboss.com
Mon Mar 10 15:38:20 EDT 2008


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 at 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 -->
  | 
  |    ...
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135451#4135451

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135451



More information about the jboss-dev-forums mailing list