将 Richfaces 添加到现有 Seam 应用程序
项目中存在以下内容:
Dynamic Web Module: 2.3
Java : 1.5
JavaScript: 1.0
以及以下库(包括新添加的 Richfaces 及其依赖库):
commons-beanutils-1.7.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-codec-1.3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-digester-1.6.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-el-1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-fileupload-1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-lang-2.1.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-logging-1.0.4.jar - FCL - Experimental/WebRoot/WEB-INF/lib
cssparser-0.9.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
guava-r08.jar - FCL - Experimental/WebRoot/WEB-INF/lib
iText-2.1.2u.jar - FCL - Experimental/WebRoot/WEB-INF/lib
jstl-1.1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
jxl.jar - FCL - Experimental/WebRoot/WEB-INF/lib
log4j-1.2.8.jar - FCL - Experimental/WebRoot/WEB-INF/lib
mail.jar - FCL - Experimental/WebRoot/WEB-INF/lib
myfaces-api-1.1.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
myfaces-impl-1.1.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
Opta2000.jar - FCL - Experimental/WebRoot/WEB-INF/lib
postgresql-8.4-701.jdbc3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-api-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-impl-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-ui-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
sac.jar - FCL - Experimental/WebRoot/WEB-INF/lib
standard.jar - FCL - Experimental/WebRoot/WEB-INF/lib
tomahawk-1.1.3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
Java EE 5 Libraries
TOMCAT 5
ant.jar - C:\jakarta-tomcat-5.0.28\common\lib
ant-launcher.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-collections-3.1.jar - C:\jakarta-tomcat-5.0.28\common\l
commons-dbcp-1.2.1.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-el.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-pool-1.2.jar - C:\jakarta-tomcat-5.0.28\common\lib
jasper-compiler.jar - C:\jakarta-tomcat-5.0.28\common\lib
jasper-runtime.jar - C:\jakarta-tomcat-5.0.28\common\lib
jsp-api.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-common.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-factory.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-java.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-resources.jar - C:\jakarta-tomcat-5.0.28\common\lib
servlet-api.jar - C:\jakarta-tomcat-5.0.28\common\lib
tools.jar - C:\jakarta-tomcat-5.0.28\common\lib
xercesImpl.jar - C:\jakarta-tomcat-5.0.28\common\endorsed
xml-apis.jar - C:\jakarta-tomcat-5.0.28\common\endorsed
JRE System Library [jdk1.5.0_19]
我感觉实验性的,想尝试将 RichFaces 3.3 添加到在 tomcat 5 上运行的现有 JBoss Seam 应用程序。 以下为 web.xml: 添加了整个 web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_1319603694180">
<!-- RichFaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- END -->
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<listener>
<listener-class>
com.exper.util.SessionExpireHandler
</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>
This is the description of my J2EE component
</description>
<display-name>
This is the display name of my J2EE component
</display-name>
<servlet-name>homeDetail</servlet-name>
<servlet-class>
com.exper.backingbean.homeDetail
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>homescreen</servlet-name>
<url-pattern>/homescreen</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Faces Servlet</filter-name>
<filter-class>com.exper.util.SessionHandler</filter-class>
</filter>
<filter-mapping>
<filter-name>Faces Servlet</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>
<!-- Welcome files -->
<welcome-file-list>
<welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
异常错误更新: 结果是异常错误我不明白如下:
27/10/2011 9:43:59 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8083
27/10/2011 9:43:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 531 ms
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.28
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\admin.xml
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources',
returnNull=true
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\balancer.xml
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\manager.xml
27/10/2011 9:44:00 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path from URL file:C:\jakarta-tomcat-
5.0.28\webapps\ROOT
27/10/2011 9:44:00 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\jakarta-tomcat-5.0.28\webapps\ROOT\WEB-INF\lib\servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
27/10/2011 9:44:03 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
27/10/2011 9:44:03 AM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
27/10/2011 9:44:04 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8083
27/10/2011 9:44:04 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
27/10/2011 9:44:04 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=C:\jakarta-tomcat-5.0.28\conf\jk2.properties
27/10/2011 9:44:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5312 ms
将动态 Web 模块更新到 2.4 以与 web.xml 保持一致并删除 servlet-api.jar ,结果如下:
27/10/2011 10:18:57 AM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at java.beans.Introspector.getBeanInfo(Introspector.java:220)
at java.beans.Introspector.<init>(Introspector.java:368)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule.java:259)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 39 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at java.beans.Introspector.getBeanInfo(Introspector.java:220)
at java.beans.Introspector.<init>(Introspector.java:368)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule.java:259)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
... 6 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 39 more
有谁能告诉我这里出了什么问题吗?我得到:
HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/5.0.28
I'm feeling experimental and wanted to try and add RichFaces 3.3 to an existing JBoss Seam application running on tomcat 5. The following exists in the project:
Dynamic Web Module: 2.3
Java : 1.5
JavaScript: 1.0
and the following Libraries (Including newly added Richfaces and its dependent libraries):
commons-beanutils-1.7.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-codec-1.3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-digester-1.6.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-el-1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-fileupload-1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-lang-2.1.jar - FCL - Experimental/WebRoot/WEB-INF/lib
commons-logging-1.0.4.jar - FCL - Experimental/WebRoot/WEB-INF/lib
cssparser-0.9.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
guava-r08.jar - FCL - Experimental/WebRoot/WEB-INF/lib
iText-2.1.2u.jar - FCL - Experimental/WebRoot/WEB-INF/lib
jstl-1.1.0.jar - FCL - Experimental/WebRoot/WEB-INF/lib
jxl.jar - FCL - Experimental/WebRoot/WEB-INF/lib
log4j-1.2.8.jar - FCL - Experimental/WebRoot/WEB-INF/lib
mail.jar - FCL - Experimental/WebRoot/WEB-INF/lib
myfaces-api-1.1.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
myfaces-impl-1.1.5.jar - FCL - Experimental/WebRoot/WEB-INF/lib
Opta2000.jar - FCL - Experimental/WebRoot/WEB-INF/lib
postgresql-8.4-701.jdbc3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-api-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-impl-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
richfaces-ui-3.3.3.Final.jar - FCL - Experimental/WebRoot/WEB-INF/lib
sac.jar - FCL - Experimental/WebRoot/WEB-INF/lib
standard.jar - FCL - Experimental/WebRoot/WEB-INF/lib
tomahawk-1.1.3.jar - FCL - Experimental/WebRoot/WEB-INF/lib
Java EE 5 Libraries
TOMCAT 5
ant.jar - C:\jakarta-tomcat-5.0.28\common\lib
ant-launcher.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-collections-3.1.jar - C:\jakarta-tomcat-5.0.28\common\l
commons-dbcp-1.2.1.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-el.jar - C:\jakarta-tomcat-5.0.28\common\lib
commons-pool-1.2.jar - C:\jakarta-tomcat-5.0.28\common\lib
jasper-compiler.jar - C:\jakarta-tomcat-5.0.28\common\lib
jasper-runtime.jar - C:\jakarta-tomcat-5.0.28\common\lib
jsp-api.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-common.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-factory.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-java.jar - C:\jakarta-tomcat-5.0.28\common\lib
naming-resources.jar - C:\jakarta-tomcat-5.0.28\common\lib
servlet-api.jar - C:\jakarta-tomcat-5.0.28\common\lib
tools.jar - C:\jakarta-tomcat-5.0.28\common\lib
xercesImpl.jar - C:\jakarta-tomcat-5.0.28\common\endorsed
xml-apis.jar - C:\jakarta-tomcat-5.0.28\common\endorsed
JRE System Library [jdk1.5.0_19]
Followed by adding the following to web.xml: ADDED THE ENTIRE web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_1319603694180">
<!-- RichFaces -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- END -->
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
</context-param>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener
</listener-class>
</listener>
<listener>
<listener-class>
com.exper.util.SessionExpireHandler
</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<description>
This is the description of my J2EE component
</description>
<display-name>
This is the display name of my J2EE component
</display-name>
<servlet-name>homeDetail</servlet-name>
<servlet-class>
com.exper.backingbean.homeDetail
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>homescreen</servlet-name>
<url-pattern>/homescreen</url-pattern>
</servlet-mapping>
<filter>
<filter-name>Faces Servlet</filter-name>
<filter-class>com.exper.util.SessionHandler</filter-class>
</filter>
<filter-mapping>
<filter-name>Faces Servlet</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>
<!-- Welcome files -->
<welcome-file-list>
<welcome-file>jsp/index.jsp</welcome-file>
</welcome-file-list>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
EXCEPTION ERROR UPDATED: The result is exception errors i don't understand as below:
27/10/2011 9:43:59 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8083
27/10/2011 9:43:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 531 ms
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.28
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\admin.xml
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
27/10/2011 9:43:59 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources',
returnNull=true
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\balancer.xml
27/10/2011 9:43:59 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:C:\jakarta-tomcat-
5.0.28\conf\Catalina\localhost\manager.xml
27/10/2011 9:44:00 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path from URL file:C:\jakarta-tomcat-
5.0.28\webapps\ROOT
27/10/2011 9:44:00 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\jakarta-tomcat-5.0.28\webapps\ROOT\WEB-INF\lib\servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
27/10/2011 9:44:03 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
27/10/2011 9:44:03 AM org.apache.catalina.core.StandardContext start
SEVERE: Context startup failed due to previous errors
27/10/2011 9:44:04 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8083
27/10/2011 9:44:04 AM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
27/10/2011 9:44:04 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/16 config=C:\jakarta-tomcat-5.0.28\conf\jk2.properties
27/10/2011 9:44:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5312 ms
UPDATED Dynamic Web module to 2.4 to align with web.xml and removed servlet-api.jar with below result:
27/10/2011 10:18:57 AM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at java.beans.Introspector.getBeanInfo(Introspector.java:220)
at java.beans.Introspector.<init>(Introspector.java:368)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule.java:259)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 39 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:250)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:424)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.beans.Introspector$1.run(Introspector.java:1272)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1270)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1136)
at java.beans.Introspector.getBeanInfo(Introspector.java:387)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at java.beans.Introspector.getBeanInfo(Introspector.java:220)
at java.beans.Introspector.<init>(Introspector.java:368)
at java.beans.Introspector.getBeanInfo(Introspector.java:159)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:896)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptors(PropertyUtilsBean.java:926)
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:801)
at org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:937)
at org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
at org.apache.commons.digester.SetPropertiesRule.begin(SetPropertiesRule.java:259)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1273)
at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:65)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.Catalina.load(Catalina.java:489)
at org.apache.catalina.startup.Catalina.load(Catalina.java:528)
... 6 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:854)
at org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:721)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 39 more
Is anyone able to tell me what has gone wrong here? I'm getting:
HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/5.0.28
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此异常表明您的< /code> 其中
web.xml
中存在
或
条目丢失或拼写错误。根据您的问题更新更新:
该 JAR 确实不属于那里。将其删除。另请参阅如何做我在 Eclipse 项目中导入了 javax.servlet API?
引起我注意的另一件事是您在指定 Servlet API 版本方面的不一致。 Tomcat 5.0 是 Servlet 2.3 容器(5.5 是 Servlet 2.4;6.0 是 Servlet 2.5;7.0 是 Servlet 3.0)。您已将动态 Web 项目版本设置为 2.3,这很好,但您已声明您的
web.xml
符合 Servlet 2.4。这可能在解析web.xml
时使 Tomcat 5.0 感到困惑。另外,您的 Eclipse 构建路径提到了 Java EE 5 库(这意味着 Servlet 2.5),这也是完全错误的。您应该在项目属性的目标运行时部分中设置 Tomcat 5.0。将其全部对齐。如果您想坚持使用古老的(且已停产的)Tomcat 5.0,请在各处使用 Servlet 2.3。 Servlet 2.3 兼容的
web.xml
如下所示:否则最好升级 Tomcat(并根据 Tomcat 版本调整所有内容)。您确实需要它,因为 RichFaces 3.3 需要 JSF 1.2,而 JSF 1.2 又需要 Servlet 2.5,但当您使用 Facelets 1.x 而不是 JSP 时,可以在 Servlet 2.4 上运行。
This exception suggests that you've somewhere in your
web.xml
a<context-param>
of which either the<param-name>
or<param-value>
entry is missing or misspelled.Update as per your question update:
That JAR indeed doesn't belong there. Remove it. See also How do I import the javax.servlet API in my Eclipse project?
Other thing which catched my eye is your inconsistency in specifying the Servlet API version. Tomcat 5.0 is a Servlet 2.3 container (5.5 is Servlet 2.4; 6.0 is servlet 2.5; 7.0 is Servlet 3.0). You've set your dynamic web project version to 2.3, which is fine, but you've declared your
web.xml
conform Servlet 2.4. This had probably confused Tomcat 5.0 while parsingweb.xml
. Also, your Eclipse build path mentions Java EE 5 libraries (which implies Servlet 2.5) which is also utterly wrong. You should have set Tomcat 5.0 in Targeted Runtimes section of the project's properties.Align it all out. If you want to stick to the ancient (and EOL'ed) Tomcat 5.0, use Servlet 2.3 everywhere. A Servlet 2.3 compatible
web.xml
look like follows:Otherwise better upgrade Tomcat (and align everything based on the Tomcat version). You'll really need it as RichFaces 3.3 requires JSF 1.2, which in turn requires Servlet 2.5, but can run on Servlet 2.4 when you use Facelets 1.x instead of JSP.