Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1712

ClassNotFoundException: org.apache.myfaces.renderkit.MyfacesResponseStateManager

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 2.4.6
    • Fix Version/s: 2.5.RC1
    • Component/s: None
    • Labels:
      None

      Description

      Hi,

      Spring webflow is throwing ClassNotFoundException with Myfaces 2.2. I am running Spring webflow version 3.4.6 and Core 4.3.11 on Websphere Liberty 16.0.0.4.

      As per the answer in stack overflow "Spring class org.springframework.faces.webflow.FlowRenderKit is trying to load the internal class org.apache.myfaces.renderkit.MyfacesResponseStateManager via ClassUtils.forName, which won't work on Liberty"

      I was suggested to raise the issue here. Heres the stacktrace. Thanks. Sanjay

      [9/28/17 14:53:57:669 EDT] 0000002a id= org.apache.myfaces.shared.util.ClassUtils                    
      E null java.lang.reflect.InvocationTargetException
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88)
                  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
                  at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:670)
                  at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:542)
                  at org.apache.myfaces.config.FacesConfigurator.configureRenderKits(FacesConfigurator.java:1317)
                  at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:607)
                  at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:421)
                  at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)
                  at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:177)
                  at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119)
                  at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2420)
                  at com.ibm.ws.webcontainer31.osgi.webapp.WebApp31.notifyServletContextCreated(WebApp31.java:505)
                  at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1064)
                  at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6562)
                  at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:468)
                  at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:463)
                  at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1004)
                  at com.ibm.ws.webcontainer.osgi.WebContainer.startModule(WebContainer.java:825)
                  at com.ibm.ws.app.manager.module.internal.ModuleHandlerBase.deployModule(ModuleHandlerBase.java:100)
                  at com.ibm.ws.app.manager.module.internal.DeployedModuleInfoImpl.installModule(DeployedModuleInfoImpl.java:50)
                  at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployModules(DeployedAppInfoBase.java:420)
                  at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:406)
                  at com.ibm.ws.app.manager.ear.internal.EARApplicationHandlerImpl.install(EARApplicationHandlerImpl.java:84)
                  at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:141)
                  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1191)
                  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:804)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                  at java.lang.Thread.run(Thread.java:785)
      Caused by: java.lang.IllegalStateException: Could not initialize MyFacesFlowResponseStateManager
                  at org.springframework.faces.webflow.FlowRenderKit.initResponseStateManager(FlowRenderKit.java:58)
                  at org.springframework.faces.webflow.FlowRenderKit.<init>(FlowRenderKit.java:43)
                  ... 31 more
      Caused by: java.lang.NoClassDefFoundError: org.apache.myfaces.renderkit.MyfacesResponseStateManager
                  at java.lang.ClassLoader.defineClassImpl(Native Method)
                  at java.lang.ClassLoader.defineClass(ClassLoader.java:346)
                  at com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:335)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:310)
                  at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
                  at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
                  at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
                  at org.springframework.faces.webflow.FlowRenderKit.initResponseStateManager(FlowRenderKit.java:53)
                  ... 32 more
      Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.renderkit.MyfacesResponseStateManager
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:499)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:294)
                  at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
                  at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
                  ... 43 more
      
      [9/28/17 14:53:57:676 EDT] 0000002a id=         org.apache.myfaces.webapp.AbstractFacesInitializer           E An error occured while initializing MyFaces: java.lang.reflect.InvocationTargetException
      javax.faces.FacesException: java.lang.reflect.InvocationTargetException
                  at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:697)
                  at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:542)
                  at org.apache.myfaces.config.FacesConfigurator.configureRenderKits(FacesConfigurator.java:1317)
                  at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:607)
                  at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:421)
                  at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)
                  at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:177)
                  at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119)
                  at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2420)
                  at com.ibm.ws.webcontainer31.osgi.webapp.WebApp31.notifyServletContextCreated(WebApp31.java:505)
                  at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:1064)
                  at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:6562)
                  at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApp(DynamicVirtualHost.java:468)
                  at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.startWebApplication(DynamicVirtualHost.java:463)
                  at com.ibm.ws.webcontainer.osgi.WebContainer.startWebApplication(WebContainer.java:1004)
                  at com.ibm.ws.webcontainer.osgi.WebContainer.startModule(WebContainer.java:825)
                  at com.ibm.ws.app.manager.module.internal.ModuleHandlerBase.deployModule(ModuleHandlerBase.java:100)
                  at com.ibm.ws.app.manager.module.internal.DeployedModuleInfoImpl.installModule(DeployedModuleInfoImpl.java:50)
                  at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployModules(DeployedAppInfoBase.java:420)
                  at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:406)
                  at com.ibm.ws.app.manager.ear.internal.EARApplicationHandlerImpl.install(EARApplicationHandlerImpl.java:84)
                  at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:141)
                  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1191)
                  at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:804)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1153)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                  at java.lang.Thread.run(Thread.java:785)
      Caused by: java.lang.reflect.InvocationTargetException
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88)
                  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
                  at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:670)
                  ... 26 more
      Caused by: java.lang.IllegalStateException: Could not initialize MyFacesFlowResponseStateManager
                  at org.springframework.faces.webflow.FlowRenderKit.initResponseStateManager(FlowRenderKit.java:58)
                  at org.springframework.faces.webflow.FlowRenderKit.<init>(FlowRenderKit.java:43)
                  ... 31 more
      Caused by: java.lang.NoClassDefFoundError: org.apache.myfaces.renderkit.MyfacesResponseStateManager
                  at java.lang.ClassLoader.defineClassImpl(Native Method)
                  at java.lang.ClassLoader.defineClass(ClassLoader.java:346)
                  at com.ibm.ws.classloading.internal.AppClassLoader.definePackageAndClass(AppClassLoader.java:335)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:310)
                  at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
                  at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
                  at org.springframework.util.ClassUtils.forName(ClassUtils.java:250)
                  at org.springframework.faces.webflow.FlowRenderKit.initResponseStateManager(FlowRenderKit.java:53)
                  ... 32 more
      Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.renderkit.MyfacesResponseStateManager
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:499)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:294)
                  at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
                  at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:477)
                  at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:449)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
                  ... 43 more
       

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            sangarg Sanjay Garg
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: