glassfish
  1. glassfish
  2. GLASSFISH-19579

java.xml.validation.SchemaFactory.newInstance() does not work under OSGi

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.0_b70
    • Fix Version/s: None
    • Component/s: classloader, OSGi
    • Labels:
      None
    • Environment:

      Glassfish 4.0 b72

      Description

      This same OSGi bundle works under JBoss 7.1.1 without issue.
      JBoss OSGi issue: https://issues.jboss.org/browse/AS7-1424

      This is a third-party library I do not have access to modify it's behavioral. Below is an extract from the third-party source code.

          public ClusterMapper() {
              try {
                  SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
                  Source source = new StreamSource(ClusterMapper.class.getResourceAsStream("cluster.xsd"));
                  this.schema = factory.newSchema(source);
              } catch(SAXException e) {
                  throw new MappingException(e);
              }
          }
      

      Stack trace:

      [#|2013-01-23T17:38:43.512-0500|INFO|glassfish 4.0|javax.enterprise.logging.stdout|_ThreadID=123;_ThreadName=EclipseGeminiBlueprintExtenderThread-16;_TimeMillis=1358980723512;_LevelValue=800;|17:38:43.512 [EclipseGeminiBlueprintExtenderThread-16] ERROR o.e.g.b.e.i.d.s.DependencyWaiterApplicationContextExecutor - Unable to create application context for [com.mm.gateway.messaging.correlation-service-impl], unsatisfied dependencies: none
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voldemortMessageCorrelationService' defined in URL [bundle://354.1:0/META-INF/spring/context.xml]: Cannot resolve reference to bean 'storeClient' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'socketStoreClientFactory' defined in URL [bundle://354.1:0/META-INF/spring/context.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1486) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[na:na]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[na:na]
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607) ~[na:na]
      	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[na:na]
      	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60) ~[na:na]
      	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325) ~[na:na]
      	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) ~[na:na]
      	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290) ~[na:na]
      	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137) ~[na:na]
      	at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09]
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voldemortMessageCorrelationService' defined in URL [bundle://354.1:0/META-INF/spring/context.xml]: Cannot resolve reference to bean 'storeClient' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'socketStoreClientFactory' defined in URL [bundle://354.1:0/META-INF/spring/context.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:329) ~[na:na]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) ~[na:na]
      	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:629) ~[na:na]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[na:na]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[na:na]
      	at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:880) ~[na:na]
      	at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:842) ~[na:na]
      	at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:521) ~[na:na]
      	at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483) ~[na:na]
      	... 14 common frames omitted
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'socketStoreClientFactory' defined in URL [bundle://354.1:0/META-INF/spring/context.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:288) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[na:na]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[na:na]
      	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1029) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:925) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) ~[na:na]
      	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) ~[na:na]
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) ~[na:na]
      	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ~[na:na]
      	... 31 common frames omitted
      Caused by: java.lang.ExceptionInInitializerError: null
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_09]
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_09]
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_09]
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:525) ~[na:1.7.0_09]
      	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) ~[na:na]
      	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121) ~[na:na]
      	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) ~[na:na]
      	... 49 common frames omitted
      Caused by: java.lang.IllegalArgumentException: No SchemaFactory that implements the schema language specified by: http://www.w3.org/2001/XMLSchema could be loaded
      	at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:204) ~[na:1.7.0_09]
      	at voldemort.xml.ClusterMapper.<init>(ClusterMapper.java:75) ~[na:na]
      	at voldemort.client.AbstractStoreClientFactory.<clinit>(AbstractStoreClientFactory.java:85) ~[na:na]
      	... 56 common frames omitted
      

        Activity

        Hide
        aaronjwhiteside added a comment -

        Turning JAXP debug:

        [#|2013-01-23T18:04:59.518-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299518;_LevelValue=1000;|JAXP: using thread context class loader (BundleDelegatingClassLoader for [Correlation Service Implementation (com.mm.gateway.messaging.correlation-service-impl)]) for search|#]
        
        [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema'|#]
        
        [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: The property is undefined.|#]
        
        [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: found null in $java.home/jaxp.properties|#]
        
        [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: no META-INF/services/javax.xml.validation.SchemaFactory file was found|#]
        
        [#|2013-01-23T18:04:59.520-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299520;_LevelValue=1000;|JAXP: attempting to use the platform default XML Schema validator|#]
        
        [#|2013-01-23T18:04:59.520-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299520;_LevelValue=1000;|JAXP: createInstance(com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory)|#]
        
        [#|2013-01-23T18:04:59.521-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299521;_LevelValue=1000;|java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory not found from bundle [com.mm.gateway.messaging.correlation-service-impl]
        	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:101)
        	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:155)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        	at javax.xml.validation.SchemaFactoryFinder.createClass(SchemaFactoryFinder.java:276)
        	at javax.xml.validation.SchemaFactoryFinder.createInstance(SchemaFactoryFinder.java:307)
        	at javax.xml.validation.SchemaFactoryFinder._newFactory(SchemaFactoryFinder.java:258)
        	at javax.xml.validation.SchemaFactoryFinder.newFactory(SchemaFactoryFinder.java:143)
        	at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:202)
        	at voldemort.xml.ClusterMapper.<init>(ClusterMapper.java:75)
        	at voldemort.client.AbstractStoreClientFactory.<clinit>(AbstractStoreClientFactory.java:85)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
        	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
        	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121)
        	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1029)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:925)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323)
        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)
        	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:629)
        	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        	at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:880)
        	at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:842)
        	at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:521)
        	at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
        	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607)
        	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60)
        	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325)
        	at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        	at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290)
        	at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137)
        	at java.lang.Thread.run(Thread.java:722)
        Caused by: java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory not found by com.mm.gateway.messaging.correlation-service-impl [354]
        	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
        	at org.apache.felix.framework.BundleWiringImpl.access$400(Bundl|#]
        
        [#|2013-01-23T18:04:59.522-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299522;_LevelValue=1000;|eWiringImpl.java:72)
        	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723)
        	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926)
        	at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:97)
        	... 65 more
        |#]
        
        Show
        aaronjwhiteside added a comment - Turning JAXP debug: [#|2013-01-23T18:04:59.518-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299518;_LevelValue=1000;|JAXP: using thread context class loader (BundleDelegatingClassLoader for [Correlation Service Implementation (com.mm.gateway.messaging.correlation-service-impl)]) for search|#] [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http: //www.w3.org/2001/XMLSchema'|#] [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: The property is undefined.|#] [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: found null in $java.home/jaxp.properties|#] [#|2013-01-23T18:04:59.519-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299519;_LevelValue=1000;|JAXP: no META-INF/services/javax.xml.validation.SchemaFactory file was found|#] [#|2013-01-23T18:04:59.520-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299520;_LevelValue=1000;|JAXP: attempting to use the platform default XML Schema validator|#] [#|2013-01-23T18:04:59.520-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299520;_LevelValue=1000;|JAXP: createInstance(com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory)|#] [#|2013-01-23T18:04:59.521-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299521;_LevelValue=1000;|java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory not found from bundle [com.mm.gateway.messaging.correlation-service-impl] at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:101) at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:155) at java.lang. ClassLoader .loadClass( ClassLoader .java:356) at javax.xml.validation.SchemaFactoryFinder.createClass(SchemaFactoryFinder.java:276) at javax.xml.validation.SchemaFactoryFinder.createInstance(SchemaFactoryFinder.java:307) at javax.xml.validation.SchemaFactoryFinder._newFactory(SchemaFactoryFinder.java:258) at javax.xml.validation.SchemaFactoryFinder.newFactory(SchemaFactoryFinder.java:143) at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:202) at voldemort.xml.ClusterMapper.<init>(ClusterMapper.java:75) at voldemort.client.AbstractStoreClientFactory.<clinit>(AbstractStoreClientFactory.java:85) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:121) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:280) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1029) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:925) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:629) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1049) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:953) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:490) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:880) at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:842) at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:521) at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:413) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:607) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:60) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:325) at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:290) at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:137) at java.lang. Thread .run( Thread .java:722) Caused by: java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory not found by com.mm.gateway.messaging.correlation-service-impl [354] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460) at org.apache.felix.framework.BundleWiringImpl.access$400(Bundl|#] [#|2013-01-23T18:04:59.522-0500|SEVERE|glassfish 4.0|javax.enterprise.logging.stderr|_ThreadID=94;_ThreadName=EclipseGeminiBlueprintExtenderThread-12;_TimeMillis=1358982299522;_LevelValue=1000;|eWiringImpl.java:72) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843) at java.lang. ClassLoader .loadClass( ClassLoader .java:356) at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1723) at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:926) at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:97) ... 65 more |#]
        Hide
        aaronjwhiteside added a comment -

        A work around seems to be specifying the com.sun.org.apache.xerces package in osgi.properties for boot delegation.

        org.osgi.framework.bootdelegation=${eclipselink.bootdelegation}, \
                                          com.sun.btrace, com.sun.btrace.*, \
                                          org.netbeans.lib.profiler, org.netbeans.lib.profiler.*, \
                                          com.sun.org.apache.xerces.*
        
        

        Please don't close this bug because there is a workaround, the solution should be permanent and turned on by default in glassfish.

        Show
        aaronjwhiteside added a comment - A work around seems to be specifying the com.sun.org.apache.xerces package in osgi.properties for boot delegation. org.osgi.framework.bootdelegation=${eclipselink.bootdelegation}, \ com.sun.btrace, com.sun.btrace.*, \ org.netbeans.lib.profiler, org.netbeans.lib.profiler.*, \ com.sun.org.apache.xerces.* Please don't close this bug because there is a workaround, the solution should be permanent and turned on by default in glassfish.
        Hide
        TangYong added a comment -

        Hi aaronjwhiteside
        CC Sahoo,

        Although I have not run aries blueprint sample under gf, from aaronjwhiteside's work around, a point has reminded me:

        Package com.sun.org.apache.xerces.* is in jaxp-ri, and JAXP is a standard component in the Java platform. An implementation of the JAXP 1.3
        is included in J2SE 5.0 and an implementation of JAXP 1.4.x is in Java SE 6.0 and Java SE 7.

        So, while an bundle requires features from JAXP, we can not include jaxp-ri dependency, instead, we must use framework's bootdelegation
        or System Package Export.

        For me, the aaronjwhiteside's work around looks fine.

        Please listen sahoo's comments.

        Thanks.
        --Tang

        Show
        TangYong added a comment - Hi aaronjwhiteside CC Sahoo, Although I have not run aries blueprint sample under gf, from aaronjwhiteside's work around, a point has reminded me: Package com.sun.org.apache.xerces.* is in jaxp-ri, and JAXP is a standard component in the Java platform. An implementation of the JAXP 1.3 is included in J2SE 5.0 and an implementation of JAXP 1.4.x is in Java SE 6.0 and Java SE 7. So, while an bundle requires features from JAXP, we can not include jaxp-ri dependency, instead, we must use framework's bootdelegation or System Package Export. For me, the aaronjwhiteside's work around looks fine. Please listen sahoo's comments. Thanks. --Tang
        Hide
        Sanjeeb Sahoo added a comment -

        Thanks for the excellent debugging you have already done and reporting various logs so meticulously.

        The issue here is two folds:

        a) Problem with JAXP. It is looking up "platform default SchemaFactory" using
        thread's context class loader. I consider that a bug, because it need not rely on
        caller's context to locate a default class that caller has no idea of. So,
        JAXP should use getClass().getClassLoader() to load the platform default factory.

        My experience with these problems is that even if we convince them to fix this problem, the
        fix does not typically arrive in time. So, we need to work around in our layers.
        I will file a bug against them anyway. We have had some success with changing JAXB in the past, so
        I will try with JAXP as well.

        b) The second problem is with the context class loader that's being used here. If
        I see it is org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader
        That class loader seems to be simply delegating to OSGi bundle[354] to load class.
        Since bundle [354] does not depend on any JAXP provider bundle, it can't load that class.
        I don't know who sets this class loader as the Thread's context class loader.
        Since you say ClusterMapper belongs to a third-party bundle, that basically means
        you don't have an interception point to set the context class loader to something like
        "system class loader or boot loader" which would have worked.

        c) Since the thread is started by gemini blue-print,
        is there a configuration provided by it to set the context class loader to something like system?
        If yes, you may like to explore that.

        d) By adding the package to bootdelegation, it will work, but you see our comment
        about why we dislike bootdelegation. It creates problems when you move into an
        embedded world where you are no longer in control of framework configuration.
        So, we prefer system bundle fragments to export additional packages via system bundle
        as described in [1]. You can deploy a system-bundle-fragment to export the additional packages
        and then attach a fragment to bundle [354]. Let this second fragment import the package.
        That way, you don't have to modify the third-party bundle.

        Sahoo

        [1] http://weblogs.java.net/blog/ss141213/archive/2009/05/29/use-framework-extension-bundles-glassfish-v3

        Show
        Sanjeeb Sahoo added a comment - Thanks for the excellent debugging you have already done and reporting various logs so meticulously. The issue here is two folds: a) Problem with JAXP. It is looking up "platform default SchemaFactory" using thread's context class loader. I consider that a bug, because it need not rely on caller's context to locate a default class that caller has no idea of. So, JAXP should use getClass().getClassLoader() to load the platform default factory. My experience with these problems is that even if we convince them to fix this problem, the fix does not typically arrive in time. So, we need to work around in our layers. I will file a bug against them anyway. We have had some success with changing JAXB in the past, so I will try with JAXP as well. b) The second problem is with the context class loader that's being used here. If I see it is org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader That class loader seems to be simply delegating to OSGi bundle [354] to load class. Since bundle [354] does not depend on any JAXP provider bundle, it can't load that class. I don't know who sets this class loader as the Thread's context class loader. Since you say ClusterMapper belongs to a third-party bundle, that basically means you don't have an interception point to set the context class loader to something like "system class loader or boot loader" which would have worked. c) Since the thread is started by gemini blue-print, is there a configuration provided by it to set the context class loader to something like system? If yes, you may like to explore that. d) By adding the package to bootdelegation, it will work, but you see our comment about why we dislike bootdelegation. It creates problems when you move into an embedded world where you are no longer in control of framework configuration. So, we prefer system bundle fragments to export additional packages via system bundle as described in [1] . You can deploy a system-bundle-fragment to export the additional packages and then attach a fragment to bundle [354] . Let this second fragment import the package. That way, you don't have to modify the third-party bundle. Sahoo [1] http://weblogs.java.net/blog/ss141213/archive/2009/05/29/use-framework-extension-bundles-glassfish-v3
        Hide
        Sanjeeb Sahoo added a comment -

        I doubt we will get a fix from JAXP for this, so closing this bug.

        Show
        Sanjeeb Sahoo added a comment - I doubt we will get a fix from JAXP for this, so closing this bug.
        Hide
        aaronjwhiteside added a comment -

        What about including the workaround in Glassfish? Does it break anything else?

        Show
        aaronjwhiteside added a comment - What about including the workaround in Glassfish? Does it break anything else?
        Hide
        Sanjeeb Sahoo added a comment -

        We don't rely on bootdelegation property, because they are not in our control in embedded mode.

        Show
        Sanjeeb Sahoo added a comment - We don't rely on bootdelegation property, because they are not in our control in embedded mode.
        Hide
        aaronjwhiteside added a comment -

        Okay, that makes sense but how is JBoss able to solve this issue without modifying JAXP but Glassfish cannot?

        Show
        aaronjwhiteside added a comment - Okay, that makes sense but how is JBoss able to solve this issue without modifying JAXP but Glassfish cannot?
        Hide
        Sanjeeb Sahoo added a comment -

        May be JBOSS is using a different JAXP implementation than what's included in JDK. I don't know.

        Show
        Sanjeeb Sahoo added a comment - May be JBOSS is using a different JAXP implementation than what's included in JDK. I don't know.

          People

          • Assignee:
            Sanjeeb Sahoo
            Reporter:
            aaronjwhiteside
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: