Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-1058

Class loader issue when deploying an Uberfire-based application packaged as WAR in EAR

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0.0.Final
    • Fix Version/s: None
    • Component/s: Build and Common
    • Labels:
      None
    • Environment:

      WildFly 10.1.0.Final

    • Steps to Reproduce:
      Hide

      Build Dashbuilder, embed it to simple EAR (don't forget to translate jboss-deployment-structure.xml from WAR into corresponding EAR form), try to deploy it to WildFly and see the log.

      Show
      Build Dashbuilder , embed it to simple EAR (don't forget to translate jboss-deployment-structure.xml from WAR into corresponding EAR form), try to deploy it to WildFly and see the log.
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use

      cls = Class.forName(fullyQualifiedName);
      

      instead of

      cls = Class.forName(fullyQualifiedName, false, Thread.currentThread().getContextClassLoader());
      

      at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass

      Show
      Use cls = Class.forName(fullyQualifiedName); instead of cls = Class.forName(fullyQualifiedName, false , Thread.currentThread().getContextClassLoader()); at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass
    • Estimated Difficulty:
      Low

      Description

      Uberfire-based application (e.g. Dashbuilder) being embedded into EAR package cannot be deployed with the following exceptions:

      2017-06-16 10:46:32,079 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."dashbuilder.ear".WeldStartService: org.jboss.msc.service.StartE
      xception in service jboss.deployment.unit."dashbuilder.ear".WeldStartService: Failed to start service
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
      Exception 0 :
      java.lang.RuntimeException: failed to instantiate new type: org.jboss.errai.config.rebind.EnvUtil$EnvironmentConfigCache
              at org.jboss.errai.common.rebind.CacheUtil.getCache(CacheUtil.java:46)
              at org.jboss.errai.config.rebind.EnvUtil.getEnvironmentConfig(EnvUtil.java:377)
              at org.jboss.errai.config.rebind.EnvUtil.isUserPortableType(EnvUtil.java:390)
              at org.jboss.errai.config.rebind.EnvUtil.isPortableType(EnvUtil.java:382)
              at org.jboss.errai.cdi.server.CDIExtensionPoints.processObserverMethod(CDIExtensionPoints.java:259)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
              at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:78)
              at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:129)
              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:309)
              at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
              at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:287)
              at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:265)
              at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:271)
              at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:260)
              at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
              at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
              at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
              at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:42)
              at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
              at org.jboss.weld.bootstrap.AbstractBeanDeployer.deployObserverMethods(AbstractBeanDeployer.java:160)
              at org.jboss.weld.bootstrap.BeanDeployer.deploy(BeanDeployer.java:328)
              at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:267)
              at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:415)
              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
              at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:95)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.RuntimeException: could not find class defined in ErraiApp.properties for serialization: org.dashbuilder.dataprovider.StaticProviderType
              at org.jboss.errai.config.rebind.EnvUtil.addSerializableTypes(EnvUtil.java:289)
              at org.jboss.errai.config.rebind.EnvUtil.processErraiAppPropertiesBundle(EnvUtil.java:213)
              at org.jboss.errai.config.rebind.EnvUtil.processErraiAppPropertiesUrls(EnvUtil.java:187)
              at org.jboss.errai.config.rebind.EnvUtil.newEnvironmentConfig(EnvUtil.java:144)
              at org.jboss.errai.config.rebind.EnvUtil.access$000(EnvUtil.java:53)
              at org.jboss.errai.config.rebind.EnvUtil$EnvironmentConfigCache.clear(EnvUtil.java:64)
              at org.jboss.errai.config.rebind.EnvUtil$EnvironmentConfigCache.<init>(EnvUtil.java:59)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at java.lang.Class.newInstance(Class.java:442)
              at org.jboss.errai.common.rebind.CacheUtil.getCache(CacheUtil.java:42)
              ... 33 more
      Caused by: java.lang.RuntimeException: Could not load class: org.dashbuilder.dataprovider.StaticProviderType
              at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass(MetaClassFactory.java:553)
              at org.jboss.errai.codegen.meta.MetaClassFactory.createOrGet(MetaClassFactory.java:228)
              at org.jboss.errai.codegen.meta.MetaClassFactory.createOrGet(MetaClassFactory.java:194)
              at org.jboss.errai.codegen.meta.MetaClassFactory.get(MetaClassFactory.java:129)
              at org.jboss.errai.config.rebind.EnvUtil.addSerializableTypes(EnvUtil.java:285)
              ... 45 more
       
              at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:44)
              at org.jboss.weld.bootstrap.events.ProcessObserverMethodImpl.fire(ProcessObserverMethodImpl.java:41)
              at org.jboss.weld.bootstrap.AbstractBeanDeployer.deployObserverMethods(AbstractBeanDeployer.java:160)
              at org.jboss.weld.bootstrap.BeanDeployer.deploy(BeanDeployer.java:328)
              at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:267)
              at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:415)
              at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
              at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:95)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
              ... 3 more
      
      

      because of MetaClassFactory is trying to load classes form dashbuilder.ear/lib but not from dashbuilder.ear/dashbuilder.war/WEB-INF/lib as expected.

      It seems that this behaviour is induced by

      Thread.currentThread().getContextClassLoader()
      

      at org.jboss.errai.codegen.meta.MetaClassFactory.loadClass

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                zcc39r Rustam Usmanov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: