使用MyFaces和WASCE / Geronimo时的java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener [英] java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener when using MyFaces with WASCE/Geronimo

查看:93
本文介绍了使用MyFaces和WASCE / Geronimo时的java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MyFaces v 2.1与WebSphere Application Server Community Edition v3.0.0.1和Eclipse Juno创建一个简单的JSF Web应用程序但是当我尝试运行该应用程序时,返回以下错误

  java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener 
org.apache.geronimo.common.DeploymentException:java.lang .ClassNotFoundException:com.sun.faces.config.ConfigureListener
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:665)
at org.apache.geronimo.web25。 deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:698)
at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:469)
at org.apache.geronimo.j2ee。 deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:174)
at org.apache.geronimo.j2ee.deployment。 EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:764)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
at org.apache.geronimo.deployment.Deployer.deploy( Deployer.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect。 DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke( ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke( GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean。 Java的:344)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl。 java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
在javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1438)
at javax.management.remote.rmi.RMIConnectionImpl.access $ 200(RMIConnectionImpl.java:83)
at javax。 management.remote.rmi.RMIConnectionImpl $ PrivilegedOperation.run(RMIConnectionImpl.java:1276)
at java.security.AccessController.doPrivileged(AccessController.java:284)
at javax.management.remote.rmi。 RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1378)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:799)
at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.rmi.server。 UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport $ 1.run(Transport.java:171)
at java.security.AccessControll er.doPrivileged(AccessController.java:284)
at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport。 java:547)
at sun.rmi.transport.tcp.TCPTransport $ ConnectionHandler.run0(TCPTransport.java:802)
at sun.rmi.transport.tcp.TCPTransport $ ConnectionHandler.run(TCPTransport。 java:661)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:897)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:919)
at java.lang.Thread.run(Thread.java:736)
引起:java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener
org.eclipse。 osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse。 osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
at org.eclipse.osgi .internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse .osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.addClass(AbstractWebModuleBuilder.java:670)
at org .apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:661)
... 45更多

大概是因为MyFaces jar文件不在类路径中而发生错误但是由于Eclipse中的构建路径包含所需的jar,我无法弄清楚我出错的地方。我也尝试将jar文件复制到WEB-INF / lib目录中但无济于事。



下面的屏幕截图显示了项目结构以及库。 / p>



我是否需要在Eclipse或WASCE中做一些特定的事情来包含jar文件或问题出在其他地方?

解决方案

 引起:java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener 

缺少的课程是 Mojarra 的一部分,它实际上是 MyFaces 。



使用MyFaces时,根本不需要该类。此异常可能有以下可能原因:




  • 有一个手动定义< listener> 在任何已部署的JAR中的webapp的 web.xml web-fragment.xml 中的条目在 / WEB-INF / lib 中,它引用了这个特定于Mojarra的侦听器类。


  • 在类路径中有一个松散的Mojarra .tld 文件(非常不可能,谁会提取一个JAR文件并将其松散的内容放在类路径中?)。 TLD文件自动初始化,并且可以包含< listener> 条目,该条目可以触发 ServletContextListener 实施的自动注册(例如Mojarra ConfigureListener )。




可以修复这些冲突只需删除它。


I am trying to create a simple JSF web application using MyFaces v 2.1 with WebSphere Application Server Community Edition v3.0.0.1 and Eclipse Juno but when I try to run the application the following error is returned

    java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
org.apache.geronimo.common.DeploymentException: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:665)
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.configureBasicWebModuleAttributes(AbstractWebModuleBuilder.java:698)
    at org.apache.geronimo.tomcat.deployment.TomcatModuleBuilder.addGBeans(TomcatModuleBuilder.java:469)
    at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.addGBeans(SwitchingModuleBuilder.java:174)
    at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:764)
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:255)
    at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:140)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
    at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
    at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
    at org.apache.geronimo.kernel.KernelGBean.invoke(KernelGBean.java:344)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
    at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131)
    at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883)
    at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245)
    at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke(MBeanGBeanBridge.java:172)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1438)
    at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:83)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1276)
    at java.security.AccessController.doPrivileged(AccessController.java:284)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1378)
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:799)
    at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:171)
    at java.security.AccessController.doPrivileged(AccessController.java:284)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:167)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:547)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:802)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:661)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
    at java.lang.Thread.run(Thread.java:736)
Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.apache.geronimo.hook.equinox.GeronimoClassLoader.loadClass(GeronimoClassLoader.java:85)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:626)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
    at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207)
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.addClass(AbstractWebModuleBuilder.java:670)
    at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.createWebAppClassFinder(AbstractWebModuleBuilder.java:661)
    ... 45 more

Presumably the error is occurring because the MyFaces jar files are not in the class path however I cannot figure out where I’m going wrong as the build path in Eclipse contains the required jars. I’ve also tried copying the jar files into the WEB-INF/lib directory but to no avail.

The screenshot below shows the project structure along with the libraries.

Is there something specific I need to do either in Eclipse or WASCE to include the jar files or does the problem lie elsewhere?

解决方案

Caused by: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener

The missing class is part of Mojarra, which is actually the competitor of MyFaces.

You shouldn't need that class at all when using MyFaces. This exception can have the following possible causes:

  • There's a manually definied <listener> entry in webapp's web.xml or the web-fragment.xml of any of the deployed JARs in /WEB-INF/lib which references this Mojarra-specific listener class.

  • There's somewhere a loose Mojarra .tld file in the classpath (very unlikely, who would ever extract a JAR file and put its loose contents in the classpath?). TLD files get autoinitialized and can contain a <listener> entry which can trigger autoregistration of a ServletContextListener implementation (such as the Mojarra ConfigureListener).

Those conflicts can be fixed by just removing it.

这篇关于使用MyFaces和WASCE / Geronimo时的java.lang.ClassNotFoundException:com.sun.faces.config.ConfigureListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆