javajsfjbossportletgatein

GateIn Quickstarts: can't deploy JSF2 HelloWorld example


I've got this example from jboss.org/gatein site, I just packed it with

mvn package 

all maven phases were successful. The I copy jsf2-hello-world-portlet.war to

gatein\server\default\deploy

and in server.log I see following output:

2013-08-02 16:01:40,661 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/jsf2-hello-world-portlet
2013-08-02 16:01:40,859 ERROR [org.gatein.pc.portlet.impl.container.LifeCycle] (HDScanner) Cannot start object: org.gatein.pc.portlet.container.PortletInitializationException: Portlet class not found javax.portlet.faces.GenericFacesPortlet
    at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:277) [:2.3.1-Beta02]
    at org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle.invokeStart(PortletContainerLifeCycle.java:76) [:2.3.1-Beta02]
    at org.gatein.pc.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:93) [:2.3.1-Beta02]
    ...

Caused by: java.lang.ClassNotFoundException: javax.portlet.faces.GenericFacesPortlet
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [:1.7.0_13]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [:1.7.0_13]
    ... 89 more

2013-08-02 16:01:41,059 ERROR [org.gatein.pc.portlet.impl.container.LifeCycle] (HDScanner) Cannot start object: org.gatein.pc.portlet.container.PortletInitializationException: Portlet class not found javax.portlet.faces.GenericFacesPortlet
    at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:277) [:2.3.1-Beta02]
    at org.gatein.pc.portlet.impl.container.PortletContainerLifeCycle.invokeStart(PortletContainerLifeCycle.java:76) [:2.3.1-Beta02]
    ...

Caused by: java.lang.ClassNotFoundException: javax.portlet.faces.GenericFacesPortlet
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [:1.7.0_13]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [:1.7.0_13]
    ... 89 more

2013-08-02 16:01:41,244 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (HDScanner) Initializing Mojarra 2.0.3 ( b05) for context '/jsf2-hello-world-portlet'
2013-08-02 16:02:57,976 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (HDScanner) Unsanitized stacktrace from failed start...: com.sun.faces.config.ConfigurationException: java.lang.ClassNotFoundException: org.ajax4jsf.webapp.taglib.EmptyHandler
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processHandlerClass(FaceletTaglibConfigProcessor.java:432) [:1.2_15-20100816-SNAPSHOT]
    at com.sun.faces.config.processor.FaceletTaglibConfigProcessor.processTags(FaceletTaglibConfigProcessor.java:367) [:1.2_15-20100816-SNAPSHOT]
    ...
Caused by: java.lang.ClassNotFoundException: org.ajax4jsf.webapp.taglib.EmptyHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [:1.7.0_13]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [:1.7.0_13]
    ... 80 more

2013-08-02 16:02:58,147 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/jsf2-hello-world-portlet]] (HDScanner) Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossMojarra20ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org.ajax4jsf.webapp.taglib.EmptyHandler
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:351) [:1.2_15-20100816-SNAPSHOT]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:220) [:1.2_15-20100816-SNAPSHOT]
    ...
Caused by: java.lang.ClassNotFoundException: org.ajax4jsf.webapp.taglib.EmptyHandler
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366) [:1.7.0_13]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) [:1.7.0_13]
    ... 76 more

2013-08-02 16:02:58,273 ERROR [org.apache.catalina.core.StandardContext] (HDScanner) Error listenerStart
2013-08-02 16:02:58,274 ERROR [org.apache.catalina.core.StandardContext] (HDScanner) Context [/jsf2-hello-world-portlet] startup failed due to previous errors
2013-08-02 16:02:58,278 WARN  [org.exoplatform.portal.resource.MainResourceResolver] (HDScanner) Cannot find servlet context module
2013-08-02 16:02:58,278 WARN  [org.exoplatform.portal.resource.MainResourceResolver] (HDScanner) Cannot find servlet context module
2013-08-02 16:02:58,279 WARN  [org.exoplatform.portal.resource.MainResourceResolver] (HDScanner) Cannot find servlet context module
2013-08-02 16:02:58,280 WARN  [org.exoplatform.portal.resource.MainResourceResolver] (HDScanner) Cannot find servlet context module
2013-08-02 16:02:58,286 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (HDScanner) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800) [:1.2_15-20100816-SNAPSHOT]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302) [:1.2_15-20100816-SNAPSHOT]
    ...

2013-08-02 16:02:58,433 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Start: name=jboss.web.deployment:war=/jsf2-hello-world-portlet state=Create mode=Manual requiredState=Installed: org.jboss.deployers.spi.DeploymentException: URL file:/D:/java/GateIn-3.2.0.Final-jbossas6/server/default/tmp/vfs/automountdd006d65fe966d21/jsf2-hello-world-portlet.war-b2279a82cf9db53d/ deployment failed
    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:325) [:6.0.0.Final]
    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146) [:6.0.0.Final]
    ...

2013-08-02 16:02:58,795 WARN  [org.jboss.profileservice.deployment.hotdeploy.HDScanner] (HDScanner) Scan failed: org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS IN ERROR:
  Deployment "jboss.web.deployment:war=/jsf2-hello-world-portlet" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: URL file:/D:/java/GateIn-3.2.0.Final-jbossas6/server/default/tmp/vfs/automountdd006d65fe966d21/jsf2-hello-world-portlet.war-b2279a82cf9db53d/ deployment failed

    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
    at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
    at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
    ...

Note that "simplest-hello-world-portlet" from the same GateIn Quickstarts deploying successfully (and i can use it to add to pages), and my own example portlet deploy is successful, but when I add it to new portal page, it writes me "Portlet error" instead of portlet's contents.

I'm using JBoss GateIn 3.2.0.


Solution

  • JSF libs are missing. They must be added in your server's libs, or in the webapp's libs (simply remove the "provided" scope in the pom.xml).

    Note that the Quickstarts have been only tested with Gatein 3.6, with JBoss AS 7, as stated here. It works fine, out of the box, with this configuration.