开发者

primefaces configuration issue

开发者 https://www.devze.com 2023-02-25 05:54 出处:网络
I am newbie to Primefaces.I have tried to create the sample page with Primefaces.But i got the following error.Please help me to resolve this.

I am newbie to Primefaces.I have tried to create the sample page with Primefaces.But i got the following error.Please help me to resolve this.

My Code is:

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://primefaces.prime.com.tr/ui" prefix="p" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>Hello World</title>
            <p:resources/>
        </head>
        <body>
            <h:form id="helloWorldPageForm">
                <p:panel id="primefacesPanel" header="Hello World"
                         footer="Footer">

                    <h:outputText value="Primefaces is great. My first application using Primefaces"/>
                </p:panel>
            </h:form>
        </body>
    </html>
</f:view>

My Exception is:

   SEVERE: Exception sending context initialized event to listener instance of class org.primefaces.optimus.listener.ContextListener
    java.lang.NullPointerException
            at org.primefaces.optimus.config.DefaultAnnotationScanner.scanWebInfClasses(DefaultAnnotationScanner.java:106)
            at org.primefaces.optimus.config.DefaultAnnotationScanner.scan(DefaultAnnotationScanner.java:41)
            at org.primefaces.optimus.config.OptimusBeanContext.initialize(OptimusBeanContext.java:42)
            at org.primefaces.optimus.listener.ContextListener.initializeOptimusBeanContext(ContextListener.java:71)
            at org.primefaces.optimus.listener.ContextListener.contextInitialized(ContextListener.java:52)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
            at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
            at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:521)
            at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1359)
            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.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
            at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
            at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
            at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1500)
            at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:849)
            at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:351)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
            at org.apache.coyote.htt开发者_开发百科p11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
            at java.lang.Thread.run(Thread.java:619)


Which version of PrimeFaces are you using? You can't use JSP with PrimeFaces 2, it works only for standard JSF2 facelets views.

See;

http://www.primefaces.org/gettingStarted.html

0

精彩评论

暂无评论...
验证码 换一张
取 消