JBoss 上的 Liferay 中的 JSF Portlet

JBoss 上的 Liferay 中的 JSF Portlet

我目前正在研究如何在 Liferay 6.0.5 中使用 JSF portlet 并将其部署到 JBoss 5.1.0 上。我在尝试移植一些 JSF-y/Seam-y/EJB-y 东西时遇到了很多麻烦,所以我想从简单开始,然后逐步提高。

我可以使用 NetBeans Maven 原型为 Liferay portlet 生成通用 portlet,这完全没问题,但这并不重要,因为我想要 JSF portlet

我从中选取了一个 JSF portlet 示例http://www.liferay.com/downloads/liferay-portal/community-plugins/-/software_catalog/products/5546866并尝试部署到 Liferay 6.0.5/JBoss 5.1.0 的干净、原始安装中,但无济于事。日志消息在本文末尾重现。

这个特定示例实际上是针对 GlassFish 和 Tomcat 进行测试的,因此考虑到我正在部署到 JBoss,它并不是特别有用。我尝试将其拆分并删除其中包含的 jsf 实现,因为 JBoss 附带了一个 jsf 实现(在本例中为 Mojarra 1.2_12)。

03:16:17,173 INFO [PortletAutoDeployListener] 正在复制 /usr/local/[REDACTED]/liferay/liferay-portal-6.0.5/deploy/richfaces-sun-jsf1.2-facelets-portlet-1.2.war 的 portlet,正在扩展:将 /usr/local/[REDACTED]/liferay/liferay-portal-6.0.5/deploy/richfaces-sun-jsf1.2-facelets-portlet-1.2.war 复制到 /tmp/20110201031617188,正在复制 1 个文件到 /tmp/20110201031617188/WEB-INF,正在复制 1 个文件到 /tmp/20110201031617188/WEB-INF/classes,正在复制 1 个文件到/tmp/20110201031617188/WEB-INF/classes 将 47 个文件复制到 /usr/local/[REDACTED]/liferay/liferay-portal-6.0.5/jboss-5.1.0/server/default/deploy/richfaces-sun-jsf1.2-facelets-portlet.war 将 1 个文件复制到 /usr/local/[REDACTED]/liferay/liferay-portal-6.0.5/jboss-5.1.0/server/default/deploy/richfaces-sun-jsf1.2-facelets-portlet.war 删除目录 /tmp/20110201031617188 03:16:20,075 INFO [PortletAutoDeployListener] Portlet /usr/local/[REDACTED]/liferay/liferay-portal-6.0.5/deploy/richfaces-sun-jsf1.2-facelets-portlet-1.2.war 已成功复制。部署将在几秒钟后开始。 03:16:23,632 INFO [TomcatDeployment] 部署,ctxPath=/richfaces-sun-jsf1.2-facelets-portlet 03:16:24,446 INFO [PortletHotDeployListener] 为 richfaces-sun-jsf1.2-facelets-portlet 注册 portlet 03:16:24,492 INFO [faces] 为 portlet 1 初始化 GenericFacesPortlet 03:16:24,495 INFO [faces] 桥接类名为 org.jboss.portletbridge.AjaxPortletBridge 03:16:24,509 INFO [faces] 桥接不支持 doHeaders 方法 03:16:24,510 INFO [faces] 为 portlet 1 初始化 GenericFacesPortlet 03:16:24,555 INFO [PortletHotDeployListener] richfaces-sun-jsf1.2-facelets-portlet 的 1 个 portlet 可供使用 03:16:24,627 严重 [webapp] JSF 运行时初始化失败或未发生。请查看服务器日志以了解详细信息。 java.lang.InstantiationException: org.jboss.portletbridge.context.FacesContextFactoryImpl 在 java.lang.Class.newInstance0(Class.java:340) 在 java.lang.Class.newInstance(Class.java:308) 在 javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537) 在 javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:394) 在 javax.faces.FactoryFinder.access$400(FactoryFinder.java:135) 在 javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717) 在 javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239) 在javax.faces.webapp.FacesServlet.init(FacesServlet.java:164) 在 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) 在 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950) 在 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122) 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:4421) 在 org.jboss.web.tomcat.service.deployers.TomcatDeployment。performDeployInternal(TomcatDeployment.java:310) at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142) at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) at org.jboss.web.deployers.WebModule.start(WebModule.java:97) at sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) at $Proxy38.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37) at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.system.ServiceController.doChange(ServiceController.java:688) at org.jboss.system.ServiceController.start(ServiceController.java:460) 在 org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163) 在 org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99) 在 org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46) 在 org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) 在 org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) 在 org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) 在org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) 在 org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) 在 org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) 在 org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) 在org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702) at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) 在 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) 在 java.lang.Thread.run(Thread.java:619) 03:16:24,629 INFO [2-facelets-portlet]] 将 servlet FacesServlet 标记为不可用 03:16:24,630 错误 [2-facelets-portlet]] Servlet /richfaces-sun-jsf1.2-facelets-portlet 抛出了 load() 异常 javax.servlet.UnavailableException: JSF 运行时初始化失败或未发生。请查看服务器日志以了解详细信息。在 javax.faces.webapp.FacesServlet.init(FacesServlet.java:172) 在 org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) 在 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950) 在 org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122) 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:4421) 在 org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310) 在org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142) at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) at org.jboss.web.deployers.WebModule.start(WebModule.java:97) at sun.reflect.GeneratedMethodAccessor286.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) at $Proxy38.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37) at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286) 在 org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) 在 org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.system.ServiceController.doChange(ServiceController.java:688) at org.jboss.system.ServiceController.start(ServiceController.java:460) at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99) 在 org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46) 在 org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) 在 org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) 在 org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) 在org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) 在 org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) 在 org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) 在 org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) 在org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702) at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362) 在 org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) 在 java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) 在 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) 在java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) 在 java.lang.Thread.run(Thread.java:619)

答案1

出现这个特殊问题的原因是,与 Liferay 捆绑在一起的 JBoss 被严重削减,但还包含一些您在原始 Jboss 5.1.0 实例中找不到的其他东西。

这个是Portlet Bridge的版本问题,我打包了一个,Liferay的Jboss也提供了一个。

我认为解决这个问题就足够了,但是我认为 JSF 生命周期和 Portlet 生命周期确实不能很好地融合在一起,所以现在是时候考虑其他类型的 Portlet 了。

相关内容