我得從jboss.org/gatein網站這個例子,我只是GateIn快速入門:不能部署JSF2 HelloWorld示例
mvn package
擠滿所有的Maven階段是成功的。在我JSF2問候 - 世界portlet.war複製到
gatein\server\default\deploy
和server.log中我看到下面的輸出:
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]
...
需要注意的是「簡單的問候 - 世界門戶」,從相同的GateIn快速入門成功部署(我可以使用它來添加到頁面),我自己的示例Portlet部署成功,但是當我將它添加到新的門戶頁面時,它會向我寫入「Portlet錯誤」而不是Portlet的內容。
我正在使用JBoss GateIn 3.2.0。
通過google找到我自己的問題。奇怪的感覺。 – AlexeyGorovoy