繁体   English   中英

PrimeFaces错误StateHelper

[英]PrimeFaces Error StateHelper

我该怎么办才能解决这个错误? 当我使用撇号运行我的Web应用程序时,会出现此错误,该应用程序可以识别库和标签,但是会发生某些情况。 如果可以解决,请帮助我。 这是我的错误java.lang.NoSuchMethodError:org.primefaces.component.spinner.Spinner.getStateHelper()Ljavax / faces / component / StateHelper; 在org.primefaces.component.spinner.Spinner.getStepFactor(Spinner.java:68)在org.primefaces.component.spinner.SpinnerRenderer.calculateFractionDigits(SpinnerRenderer.java:72)在org.primefaces.component.spinner.SpinnerRenderer。 (SpinnerRenderer.java:52)在org.primefaces.component.spinner.SpinnerRenderer.encodeEnd(SpinnerRenderer.java:45)在javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:649)在javax.faces.component。 org org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)上的javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)上的UIComponent.encodeAll(UIComponent.java:261) org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)上的.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)at org.apache.myfaces.lifecycle.LifecycleImpl.r (LifecycleImpl.java:140)在org.apache.myfaces.custom.ppr.PPRLifecycleWrapper.rende org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)的org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)的javax.faces.webapp.FacesServlet.service(FacesServlet.java:187)的r(PPRLifecycleWrapper.java:84) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:341)的org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java的.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) :235),位于org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233),位于org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)的org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)。 org上org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)的org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)的StandardContextValve.invoke(StandardContextValve.java:191) .apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)在或 g.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)位于org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:861)位于org.apache.coyote.http11.Http11AprProtocol $ Http11ConnectionHandler。 org.apache.tomcat.util.net.AprEndpoint $ Worker.run(AprEndpoint.java:1584)处的进程(Http11AprProtocol.java:579)在java.lang.Thread.run(Thread.java:619)

这是我的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/primefaces_resource/*</url-pattern>
    </servlet-mapping>
    <context-param>
        <description>Comma separated list of URIs of (additional) faces config files.
            (e.g. /WEB-INF/my-config.xml)
            See JSF 1.0 PRD2, 10.3.2
            Attention: You do not need to put /WEB-INF/faces-config.xml in here.
    </description>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
        <description>State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.3</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <description>Only applicable if state saving method is "server" (= default).
            Defines the amount (default = 20) of the latest views are stored in session.</description>
        <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
        <param-value>20</param-value>
    </context-param>
    <context-param>
        <description>Only applicable if state saving method is "server" (= default).
            If true (default) the state will be serialized to a byte stream before it
            is written to the session.
            If false the state will not be serialized to a byte stream.</description>
        <param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>Only applicable if state saving method is "server" (= default) and if
            org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default)
            If true (default) the serialized state will be compressed before it
            is written to the session. If false the state will not be compressed.</description>
        <param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>This parameter tells MyFaces if javascript code should be allowed in the
            rendered HTML output.
            If javascript is allowed, command_link anchors will have javascript code
            that submits the corresponding form.
            If javascript is not allowed, the state saving info and nested parameters
            will be added as url parameters.
            Default: "true"</description>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</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>
        <description>If true, rendered HTML code will be formatted, so that it is "human readable".
            i.e. additional line separators and whitespace will be written, that do not
            influence the HTML code.
            Default: "true"</description>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>If true, a javascript function will be rendered that is able to restore the
            former vertical scroll on every request. Convenient feature if you have pages
            with long lists and you do not want the browser page to always jump to the top
            if you trigger a link or button action that stays on the same page.
            Default: "false"</description>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description> Used for encrypting view state.  Only relevant for client side
      state saving.  See MyFaces wiki/web site documentation for instructions
      on how to configure an application for diffenent encryption strengths.
     </description>
        <param-name>org.apache.myfaces.SECRET</param-name>
        <param-value>NzY1NDMyMTA=</param-value>
    </context-param>
    <context-param>
        <description>
     Validate managed beans, navigation rules and ensure that forms are not nested.
    </description>
        <param-name>org.apache.myfaces.VALIDATE</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <description>A class implementing the
      org.apache.myfaces.shared.renderkit.html.util.AddResource
      interface. It is responsible to
      place scripts and css on the right position in your HTML document.
            Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
            Follow the description on the MyFaces-Wiki-Performance page to enable
            StreamingAddResource instead of DefaultAddResource if you want to
            gain performance.
    </description>
        <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
        <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
        <!--param-value>org.apache.myfaces.component.html.util.StreamingAddResource</param-value-->
    </context-param>
    <context-param>
        <description>
        A very common problem in configuring MyFaces-web-applications
        is that the Extensions-Filter is not configured at all
        or improperly configured. This parameter will check for a properly
        configured Extensions-Filter if it is needed by the web-app.
        In most cases this check will work just fine, there might be cases
        where an internal forward will bypass the Extensions-Filter and the check
        will not work. If this is the case, you can disable the check by setting
        this parameter to false.
    </description>
        <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
        <param-value>true</param-value>
    </context-param>
    <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <description>Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB</description>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
        </init-param>
        <init-param>
            <description>Set the threshold size - files
                    below this limit are stored in memory, files above
                    this limit are stored on disk.

                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB</description>
            <param-name>uploadThresholdSize</param-name>
            <param-value>100k</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
        <servlet-name>SourceCodeServlet</servlet-name>
        <servlet-class>org.apache.myfaces.shared_tomahawk.util.servlet.SourceCodeServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>SourceCodeServlet</servlet-name>
        <url-pattern>*.source</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

我正在使用primefaces 2.0.0 Rc

我假设primefaces和JSF之间的版本不匹配。 对于Primefaces 2.0,我认为您需要JSF 2.0

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM