PrimeFaces application not run

UI Components for JSF
Post Reply
darbicx
Posts: 2
Joined: 29 Apr 2010, 15:08

29 Apr 2010, 15:30

Hello,

I have tried to write my first PrimeFaces application. But during almost two days I'm not able run it. Here is my configuration:

web.xml:

Code: Select all

<context-param>
	<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
	<param-value>.xhtml</param-value>
</context-param>
<context-param>
	<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
	<param-value>server</param-value>
</context-param>
<context-param>
	<param-name>javax.faces.PROJECT_STAGE</param-name>
	<param-value>Development</param-value>
</context-param>
<context-param>
	<param-name>com.sun.faces.allowTextChildren</param-name>
	<param-value>true</param-value>
</context-param>
<servlet>
	<servlet-name>faces</servlet-name>
	<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
	<load-on-startup>2</load-on-startup>
</servlet>
<servlet>
	<servlet-name>Resource Servlet</servlet-name>
	<servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
	<servlet-name>Resource Servlet</servlet-name>
	<url-pattern>/primefaces_resource/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
	<servlet-name>faces</servlet-name>
	<url-pattern>*.do</url-pattern>
</servlet-mapping>
<session-config>
	<session-timeout>15</session-timeout>
</session-config>
<welcome-file-list>
	<welcome-file>index.jsp</welcome-file>
	<welcome-file>index.html</welcome-file>
</welcome-file-list>
<security-constraint>
	<display-name>Restrict access to XHTML files</display-name>
	<web-resource-collection>
		<web-resource-name>Restrict access to XHTML pages</web-resource-name>
		<url-pattern>*.xhtml</url-pattern>
	</web-resource-collection>
	<auth-constraint>
		<description>With no roles defined, no access granted</description>
	</auth-constraint>
</security-constraint>
<login-config>
	<auth-method>BASIC</auth-method>
</login-config>
<locale-encoding-mapping-list>
	<locale-encoding-mapping>
		<locale>cs</locale>
		<encoding>UTF-8</encoding>
	</locale-encoding-mapping>
</locale-encoding-mapping-list>
libraries:
  • activation-1.1.jar
  • commons-codec-1.4.jar
  • derbyclient-10.5.3.0_1.jar
  • eodsql-2.1.jar
  • jsf-api-2.0.jar
  • jsf-impl-2.0.0-RC.jar
  • junit-3.8.1.jar
  • mail-1.4.2.jar
  • mailapi-1.4.2.jar
  • primefaces-2.0.1.jar
page code:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
	<title>Home</title>
</h:head>
<h:body>
	<p:menubar>
	</p:menubar>
</h:body>
</html>
exception (after accessing the page):
EVERE: JSF1068: Cannot instantiate component with component-type javax.faces.ComponentResourceContainer
SEVERE: Servlet.service() for servlet faces threw exception
javax.faces.FacesException: Expression Error: Named Object: javax.faces.ComponentResourceContainer not found.
at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1801)
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:912)
at javax.faces.component.UIViewRoot.getComponentResources(UIViewRoot.java:1745)
at javax.faces.component.UIViewRoot.addComponentResource(UIViewRoot.java:520)
at org.primefaces.component.menubar.Menubar.processEvent(Menubar.java:135)
at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2345)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:102)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:1985)
at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:1933)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:287)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2005)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2010)
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1691)
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:403)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2439)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2411)
at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:346)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:209)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:114)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:91)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:86)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:75)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:130)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:823)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
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:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
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:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Thank you for any hint!

Tomas

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Apr 2010, 16:58

Hi Tomas,

Try with a stable JSF implementation like Mojarra 2.0.2.

https://javaserverfaces.dev.java.net/download.html

darbicx
Posts: 2
Joined: 29 Apr 2010, 15:08

29 Apr 2010, 19:15

Hi Cagatay,

thank you for prompt reply! I have tried Mojarra 2.0.1 FCS but without success. However 2.0.2 FCS solved the problem! Thank you one more time.

Tomas

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Apr 2010, 20:54

Glad to hear Tomas, enjoy PrimeFaces :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests