4 Replies Latest reply on Apr 6, 2009 7:53 AM by Alexey Loubyansky

    Updating Kernel to XB 2.0.1.Beta3 leads to weird mvn issues

    Ales Justin Master

      More mvn weirdness. :-)

      If I update MC/Kernel to use XB 2.0.1.Beta3 I get test failures.
      But if I run a single test (which failed before) or inside IDEA, the test runs fine.

      Can someone try this out?

        • 1. Re: Updating Kernel to XB 2.0.1.Beta3 leads to weird mvn iss
          jaikiran pai Master

           

          "alesj" wrote:


          Can someone try this out?


          Fails for me too (with 2.1.0.Beta3 of JBossXB). But the tests fail even when they are run as a single test, on my system.

          Here's the error logs, which show that it's a SecurityManager exception originating from JBossXB:

          -------------------------------------------------------------------------------
          Test set: org.jboss.test.kernel.config.test.ElementXMLTestCase
          -------------------------------------------------------------------------------
          Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.808 sec <<< FAILURE!
          testElement(org.jboss.test.kernel.config.test.ElementXMLTestCase) Time elapsed: 0.694 sec <<< ERROR!
          org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/NotBackedUp/jpai/business/jboss/wc/jbossas/projects/microcontainer/trunk/kernel/target/test-classes/xml-test/org/jboss/test/kernel/config/test/testElement.xml@5,49
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177)
           at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:147)
           at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:147)
           at org.jboss.test.kernel.config.support.XMLUtil.<init>(XMLUtil.java:76)
           at org.jboss.test.kernel.config.test.AbstractKernelConfigTest.bootstrapXML(AbstractKernelConfigTest.java:74)
           at org.jboss.test.kernel.config.test.ElementXMLTestCase.instantiateElement(ElementXMLTestCase.java:53)
           at org.jboss.test.kernel.config.test.ElementTestCase.testElement(ElementTestCase.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 java.lang.reflect.Method.invoke(Method.java:585)
           at junit.framework.TestCase.runTest(TestCase.java:168)
           at junit.framework.TestCase.runBare(TestCase.java:134)
           at junit.framework.TestResult$1.protect(TestResult.java:110)
           at junit.framework.TestResult.runProtected(TestResult.java:128)
           at junit.framework.TestResult.run(TestResult.java:113)
           at junit.framework.TestCase.run(TestCase.java:124)
           at junit.framework.TestSuite.runTest(TestSuite.java:232)
           at junit.framework.TestSuite.run(TestSuite.java:227)
           at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
           at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
           at junit.framework.TestResult.runProtected(TestResult.java:128)
           at junit.extensions.TestSetup.run(TestSetup.java:27)
           at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
           at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
           at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
           at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
           at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
           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:585)
           at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
           at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
          Caused by: java.lang.ExceptionInInitializerError
           at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(AbstractMutableSchemaResolver.java:261)
           at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:307)
           at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
           at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
           at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
           at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
           at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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:173)
           ... 33 more
          Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission xb.builder.useUnorderedSequence read)
           at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
           at java.security.AccessController.checkPermission(AccessController.java:427)
           at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
           at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
           at java.lang.System.getProperty(System.java:628)
           at org.jboss.xb.builder.JBossXBBuilder.<clinit>(JBossXBBuilder.java:87)
           ... 48 more
          
          


          • 2. Re: Updating Kernel to XB 2.0.1.Beta3 leads to weird mvn iss
            Ales Justin Master

            Looks like Alexey forgot to read System props in a privileged block. :-)

            • 3. Re: Updating Kernel to XB 2.0.1.Beta3 leads to weird mvn iss
              Ales Justin Master

              OK, I'm now able to build it with XB 2.0.1.Beta3.
              I had to fix some of the xml and falling back to MutableSchemaResolver interface.

              And due to that security bug, I temporarily
              turned off security for AbstractKernelTest sub classes.

               public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
               {
               AbstractTestDelegate delegate = new AbstractTestDelegate(clazz);
               delegate.enableSecurity = false; // FIXME!! Once XB is fixed.
               return delegate;
               }
              

              So, Alexey, please change it back to true once you
              update MC/Kernel to use fixed XB.