Karaf
  1. Karaf
  2. KARAF-1905

ASM4 causes the Proxy/Weaving of Xerces, but that then causes validation factories to fail.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.3.0, 3.0.0
    • Component/s: karaf-core
    • Labels:
      None

      Description

      Since the update to ASM 4, if you do:

      features:chooseurl cxf 2.7.1-SNAPSHOT
      features:install cxf
      features:chooseurl camel 2.10.2-SNAPSHOT
      features:install camel
      

      you get the error:

      Error executing command: Illegal UTF8 string in constant pool in class file org/apache/xerces/impl/xpath/regex/ParserForXMLSchema
      

      The problem is that with ASM, Aries proxy is trying to Weave the xerces classes and somehow generating an invalid class.

      Full stack trace:

        199 | 14 - org.apache.karaf.shell.console - 2.3.0.SNAPSHOT | Exception caught while executing command
      java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file org/apache/xerces/impl/xpath/regex/ParserForXMLSchema
      	at java.lang.ClassLoader.defineClass1(Native Method)[:1.6.0_33]
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)[:1.6.0_33]
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)[:1.6.0_33]
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2128)
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1432)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_33]
      	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets(Unknown Source)
      	at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown Source)
      	at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown Source)
      	at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown Source)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.6.0_33]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)[:1.6.0_33]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)[:1.6.0_33]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)[:1.6.0_33]
      	at java.lang.Class.newInstance0(Class.java:355)[:1.6.0_33]
      	at java.lang.Class.newInstance(Class.java:308)[:1.6.0_33]
      	at org.apache.xerces.impl.dv.ObjectFactory.newInstance(Unknown Source)
      	at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
      	at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
      	at org.apache.xerces.impl.xs.SchemaGrammar$BuiltinSchemaGrammar.<init>(Unknown Source)
      	at org.apache.xerces.impl.xs.SchemaGrammar.<clinit>(Unknown Source)
      	at org.apache.xerces.impl.xs.traversers.XSAttributeChecker.<clinit>(Unknown Source)
      	at org.apache.xerces.impl.xs.traversers.XSDHandler.createTraversers(Unknown Source)
      	at org.apache.xerces.impl.xs.traversers.XSDHandler.prepareForTraverse(Unknown Source)
      	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
      	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
      	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
      	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
      	at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
      	at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)[:2.1.0]
      	at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
      	at org.apache.karaf.features.internal.FeatureValidationUtil.validate(FeatureValidationUtil.java:62)
      	at org.apache.karaf.features.internal.FeaturesServiceImpl.validateRepository(FeaturesServiceImpl.java:204)
      	at org.apache.karaf.features.internal.FeaturesServiceImpl.internalAddRepository(FeaturesServiceImpl.java:245)
      	at org.apache.karaf.features.internal.FeaturesServiceImpl.getFeatures(FeaturesServiceImpl.java:1047)
      	at org.apache.karaf.features.internal.FeaturesServiceImpl.getFeature(FeaturesServiceImpl.java:1005)
      	at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:384)
      	at org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:62)
      	at org.apache.karaf.features.command.FeaturesCommandSupport.doExecute(FeaturesCommandSupport.java:41)
      	at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at org.apache.karaf.shell.console.jline.Console.run(Console.java:175)[14:org.apache.karaf.shell.console:2.3.0.SNAPSHOT]
      	at java.lang.Thread.run(Thread.java:680)[:1.6.0_33]
      
      1. patch.txt
        0.9 kB
        Daniel Kulp

        Activity

        Hide
        Daniel Kulp added a comment -

        A potential workaround would be to add:

        org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.*
        

        to the etc/system.properties.

        Show
        Daniel Kulp added a comment - A potential workaround would be to add: org.apache.aries.proxy.weaving.disabled=org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.* to the etc/system.properties.
        Hide
        Christian Schneider added a comment -

        I committed the workaround to 2.3.x in rev 1396498

        Show
        Christian Schneider added a comment - I committed the workaround to 2.3.x in rev 1396498
        Hide
        Daniel Kulp added a comment -

        After discussing with gnodet on IRC, his suggestion is to disable the weaving by default, but allow the users to opt in for classes where they need it.

        Patch supplied.

        Show
        Daniel Kulp added a comment - After discussing with gnodet on IRC, his suggestion is to disable the weaving by default, but allow the users to opt in for classes where they need it. Patch supplied.
        Show
        Jean-Baptiste Onofré added a comment - Fixed on trunk: http://svn.apache.org/viewvc?view=revision&revision=1396735
        Show
        Jean-Baptiste Onofré added a comment - Fixed on karaf-2.3.x: http://svn.apache.org/viewvc?view=revision&revision=1396746

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Daniel Kulp
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development