English 中文(简体)
将Richfaces添加到现有的海洋应用中
原标题:Adding Richfaces to an existing Seam application

I m 感受实验,希望尝试将RichFaces 3.3添加到现有的“JBoss Seam”申请中,该申请在目录上运行 5. 该项目有以下内容:

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.28commonlib
  ant-launcher.jar - C:jakarta-tomcat-5.0.28commonlib
  commons-collections-3.1.jar - C:jakarta-tomcat-5.0.28commonl
  commons-dbcp-1.2.1.jar - C:jakarta-tomcat-5.0.28commonlib
  commons-el.jar - C:jakarta-tomcat-5.0.28commonlib
  commons-pool-1.2.jar - C:jakarta-tomcat-5.0.28commonlib
  jasper-compiler.jar - C:jakarta-tomcat-5.0.28commonlib
  jasper-runtime.jar - C:jakarta-tomcat-5.0.28commonlib
  jsp-api.jar - C:jakarta-tomcat-5.0.28commonlib
  naming-common.jar - C:jakarta-tomcat-5.0.28commonlib
  naming-factory.jar - C:jakarta-tomcat-5.0.28commonlib
  naming-java.jar - C:jakarta-tomcat-5.0.28commonlib
  naming-resources.jar - C:jakarta-tomcat-5.0.28commonlib
  servlet-api.jar - C:jakarta-tomcat-5.0.28commonlib
  tools.jar - C:jakarta-tomcat-5.0.28commonlib
  xercesImpl.jar - C:jakarta-tomcat-5.0.28commonendorsed
  xml-apis.jar - C:jakarta-tomcat-5.0.28commonendorsed
  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.28confCatalinalocalhostadmin.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.28confCatalinalocalhostalancer.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.28confCatalinalocalhostmanager.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.28webappsROOT
27/10/2011 9:44:00 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:jakarta-tomcat-5.0.28webappsROOTWEB-INFlibservlet-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.28confjk2.properties
27/10/2011 9:44:04 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5312 ms

<>执行> 动态网络单元至2.4,与网络、xml和移除服务器。

 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

谁能告诉我,这里发生了什么错误? 页: 1

HTTP Status 404 - /

type Status report

message /

description The requested resource (/) is not available.

Apache Tomcat/5.0.28 
最佳回答

Caused by: java.lang.IllegalArgumentException: Both parameter name and parameter value are required
at org.apache.catalina.core.StandardContext.addParameter(StandardContext.java:2113)

这一例外表明,你在以下几处填写了<代码>web.xml a <context-param>, 其中要么是<param-name> or <param- Value>的条目缺失或错下。


<>Update> 根据您提出的问题更新:

INFO: validateJarFile(C:jakarta-tomcat-5.0.28webappsROOTWEB-INFlibservlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class

联合行动确实属于那里。 删除。 另见。 我如何进口 j。 我的Eclipse项目中的保护性预报?

令我看上去的其他事情是你在具体使用“Serlet AP”版本时前后不一致。 Tomcat 5.0是一辆服务器式2.3箱(5.5为Serlet 2.4;6.0为服务器2.5;7.0为Serlet3.0。 您将动态的网络项目版本定在2.3,该版本是罚款,但您已宣布:web.xml。 这可能混淆了Tomcat 5.0,而“代码”则模糊了xml。 此外,你的Eclipse建路提到Java EE 5图书馆(这意味着Selelet 2.5),这完全是错误的。 您本应在上设定Toncat 5.0。

全部放弃。 如果你想要遵守古老的(和EOL ed)Tamcat 5.0,则使用Serlet2.3。 缩略语 如下:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <!-- Config here. -->
</web-app>

否则,将更好地提升Tomcat(并根据Tomcat版本调整所有内容)。 你确实需要它,因为RichFaces 3.3要求JF 1.2,而这反过来又要求Serlet 2.5,但在你使用面孔1.x而不是JP时,可以操作Serlet 2.4。

问题回答

暂无回答




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

热门标签