Jboss

JBoss 上 Liferay 中的 JSF Portlet

  • February 18, 2011

我目前正在考慮使用 JSF portlet 並將其部署到 Liferay 6.0.5 中,它位於 JBoss 5.1.0 上。我在嘗試移植一些 JSF-y/Seam-y/EJB-y 的東西時遇到了很多麻煩,所以我想我應該從簡單的開始,然後逐步提高。

我可以使用 NetBeans Maven 原型為 Liferay Portlet 生成通用 Portlet,這絕對沒問題,但這無關緊要,因為我想要 JSF Portlet

我從http://www.liferay.com/downloads/liferay-portal/community-plugins/-/software_catalog/products/5546866 獲取了一個範例 JSF portlet,並嘗試部署到 Liferay 6.0.5/ 的干淨、普通安裝中JBoss 5.1.0 無濟於事。日誌消息在此結束時再現。

這個特定的例子實際上是針對 GlassFish 和 Tomcat 測試的,所以考慮到我正在使用 JBoss,它並不是特別有用。我嘗試將它拆開並刪除其中包含的 jsf 實現,因為 JBoss 附帶了一個 jsf 實現(在本例中為 Mojarra 1.2_12)。

03:16:17,173 資訊

$$ PortletAutoDeployListener $$複製 /usr/local/ 的 portlet$$ REDACTED $$/liferay/liferay-portal-6.0.5/deploy/richfaces-sun-jsf1.2-facelets-portlet-1.2.war 擴展:/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 $$/usr/local/ 的 Portlet$$ REDACTED $$/liferay/liferay-portal-6.0.5/deploy/richfaces-sun-jsf1.2-facelets-portlet-1.2.war 複製成功。部署將在幾秒鐘後開始。03:16:23,632 資訊 $$ TomcatDeployment $$部署,ctxPath=/richfaces-sun-jsf1.2-facelets-portlet 03:16:24,446 資訊 $$ PortletHotDeployListener $$為 richfaces-sun-jsf1.2-facelets-portlet 註冊 portlet 03:16:24,492 INFO $$ faces $$為 portlet 1 03:16:24,495 INFO 初始化 GenericFacesPortlet $$ 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 資訊 $$ PortletHotDeployListener $$1 個用於richfaces-sun-jsf1.2-facelets-portlet 的 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) at javax.faces.FactoryFinder $ FactoryManager.getFactory(FactoryFinder.java:717) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164) at 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 的 org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)。 service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142) 在 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) 在 org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) 在 org.jboss.mx.server.Invocation.invoke(Invocation.java:88) 在 org. jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) 在 org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) 在 org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) 在 $ 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) at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) 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.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) 在 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 $ java.util.concurrent.ScheduledThreadPoolExecutor 上的 ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:885) 在 java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:619) 03:16:24,629 INFO [2-facelets-portlet]] Marking servlet FacesServlet as unavailable 03:16:24,630 ERROR [2-facelets-portlet]] Servlet /richfaces-sun-jsf1.2-facelets-portlet threw load() exception javax.servlet.UnavailableException: Initialization of the JSF runtime either failed or did not occurr. Review the server’’s log for details. at javax.faces.webapp.FacesServlet.init(FacesServlet.java:172) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421) at 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 $ org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37) 中的 org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42) 中的 Proxy38.start(Unknown Source)。 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) 位於 org.jboss.system.microcontainer.ServiceControllerContext 的 org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)。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) 在 org.jboss.system.ServiceController.doChange(ServiceController.java:688) 在 org.jboss.system.AbstractController.change(AbstractController.java:553) 在 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) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss .deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) at org.jboss.deployers.plugins.deployers.DeployersImpl .doInstallParentFirst(DeployersImpl.java:1157) 在 org.jboss.deployers.plugins.deployers.DeployersImpl。doInstallParentFirst(DeployersImpl.java:1178) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) 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) 在 org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) 在 org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) 在 org.jboss.dependency。 plugins.AbstractController.change(AbstractController.java:553) 在 org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) 在 org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702) 在 org.jboss .system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) 在 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.Executorsorg.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362) 在 org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner. java:255) 在 java.util.concurrent.Executorsorg.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) 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)在 java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor $ java.util.concurrent.ThreadPoolExecutor 上的 ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) $ Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:907) 在 java.lang.Thread.run(Thread.java:619)

之所以出現這個特殊問題,是因為與 Liferay 捆綁在一起的 JBoss 已被嚴重削減,但還包括一些您在普通 Jboss 5.1.0 實例中找不到的其他東西。

在這種情況下,Portlet Bridge 的版本存在問題。我正在包裝一個,Liferay 的 Jboss 提供了一個。

我認為解決這個問題會解決這個問題,但我認為 JSF 生命週期和 Portlet 生命週期確實不能很好地結合在一起,所以是時候為我看看其他類型的 Portlet。

引用自:https://serverfault.com/questions/229446