0

我从 jboss.org/gatein 网站得到了这个例子,我只是把它打包

mvn package 

所有 Maven 阶段都是成功的。我将 jsf2-hello-world-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 快速入门的“simplest-hello-world-portlet”部署成功(我可以使用它添加到页面),并且我自己的示例 portlet 部署成功,但是当我将它添加到新门户页面时,它写给我“Portlet 错误”而不是 Portlet 的内容。

我正在使用 JBoss GateIn 3.2.0。

4

1 回答 1

1

缺少 JSF 库。它们必须添加到服务器的库中,或者 webapp 的库中(只需删除 pom.xml 中的“提供”范围)。

请注意,快速入门仅使用 Gatein 3.6 和 JBoss AS 7 进行了测试,如此处所述。使用此配置,它可以正常工作,开箱即用。

于 2013-08-04T20:20:20.187 回答