0

我在 Websphere Liberty 16.0.0.4 中运行 JSF 2.2 应用程序。

它使用 JSF 的 Myfaces 2.2 实现,捆绑在 com.ibm.ws.jsf.2.2_1.0.15.jar 中。我收到 org.apache.myfaces.renderkit.MyfacesResponseStateManager 的 ClassNotFoundException 。

相同的 JSF 页面在 WAS 9 Classic 中运行良好,它也使用 Myfaces 2.2。

任何帮助都将受到欢迎。请参阅下面的堆栈跟踪。

谢谢,桑杰

[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
4

1 回答 1

0

jsf-2.2 Liberty 特性不公开 MyFaces 实现类,而 WebSphere 传统配置文件(经典)允许访问这些内部类。在您的场景中,Spring 类org.springframework.faces.webflow.FlowRenderKit试图通过 加载内部类org.apache.myfaces.renderkit.MyfacesResponseStateManagerClassUtils.forName这在 Liberty 上不起作用,通常也不是一个好习惯。

如果您不需要将 CDI 与您的应用程序集成,那么直接捆绑 MyFaces(而不是使用 Liberty jsf-2.2 功能部件)应该允许此方案工作。

在Spring 的问题跟踪器上提出问题可能是值得的

相关答案:MyFaces 和 WebSphere Liberty Profile (ClassNotFoundException)

于 2017-09-29T20:15:01.253 回答