我试图让一些演示工作,但一直有问题。我正在使用Tomcat 7 + MySql。当我尝试在http://repository.portletfaces.org/content/repositories/liferay-releases/com/liferay/faces/demos/jsf2-portlet/3.1.0-rc2/jsf2-portlet-3.1.0-rc2.war找到的jsf2 portlet演示时,我的日志(为log4j配置)显示它已注册但立即取消注册。我不知道为什么,并没有在日志中看到任何原因。我将不胜感激任何帮助。
有问题的日志条目是:“04:17:55,430 INFO [PortletHotDeployListener:470]取消注册jsf2-portlet的portlet”。
以下是导致上述问题的内容。
04:17:53,693 DEBUG [BridgeConfigImpl:223] Processing faces-config: [/WEB-INF/faces-config.xml]
04:17:53,694 DEBUG [BridgeConfigImpl:296] Processing web-app: [/WEB-INF/web.xml]
04:17:53,695 DEBUG [BridgeConfigImpl:306] Processing web-app: [/WEB-INF/liferay-web.xml]
04:17:53,699 DEBUG [BridgeConfigImpl:341] Added implicit extension-mapped servlet-mapping for urlPattern=[*.xhtml]
04:17:53,699 DEBUG [BridgeConfigImpl:341] Added implicit extension-mapped servlet-mapping for urlPattern=[*.jsp]
04:17:53,713 INFO [PortletHotDeployListener:433] 1 portlet for jsf2-portlet is available for use
04:17:55,418 INFO [PluginPackageUtil:1099] Reading plugin package for jsf2-portlet
04:17:55,430 INFO [PortletHotDeployListener:470] Unregistering portlets for jsf2-portlet
**04:17:55,437 INFO [PortletHotDeployListener:503] 1 portlet for jsf2-portlet was unregistered**
完整的日志可以在下面看到:
04:17:53,183 INFO [PluginPackageUtil:1099] Reading plugin package for jsf2-portlet
04:17:53,469 INFO [PortletHotDeployListener:614] Registering portlets for jsf2-portlet
04:17:53,511 INFO [BridgeImpl] Initializing Liferay Faces Bridge 3.1.0-rc2 (Galatia / Jul 14, 2012 AD)
04:17:53,592 DEBUG [BridgeConfigImpl:168] Pre-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/lib/weld-servlet.jar!/META-INF/faces-config.xml]
04:17:53,598 DEBUG [BridgeConfigImpl:168] Pre-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/lib/ext/resin.jar!/META-INF/faces-config.xml]
04:17:53,599 DEBUG [BridgeConfigImpl:168] Pre-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/liferay-faces-alloy-3.1.0-rc2.jar!/META-INF/faces-config.xml]
04:17:53,600 DEBUG [BridgeConfigImpl:168] Pre-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/liferay-faces-bridge-impl-3.1.0-rc2.jar!/META-INF/faces-config.xml]
04:17:53,601 DEBUG [BridgeConfigImpl:168] Pre-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/util-taglib.jar!/META-INF/faces-config.xml]
04:17:53,602 DEBUG [BridgeConfigImpl:202] Post-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/liferay-faces-bridge-impl-3.1.0-rc2.jar!/META-INF/faces-config.xml]
04:17:53,603 DEBUG [BridgeConfigImpl:802] render-response-wrapper-class=[com.liferay.faces.bridge.application.view.BridgeWriteBehindResponseRenderImpl]
04:17:53,604 DEBUG [BridgeConfigImpl:806] resource-response-wrapper-class=[com.liferay.faces.bridge.application.view.BridgeWriteBehindResponseResourceImpl]
04:17:53,609 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,609 DEBUG [BridgeConfigImpl:592] Instantiated bridgeContextFactory=[com.liferay.faces.bridge.context.BridgeContextFactoryImpl] wrappedFactory=[null]
04:17:53,615 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,622 DEBUG [BridgeConfigImpl:612] Instantiated bridgeFlashFactory=[com.liferay.faces.bridge.context.flash.BridgeFlashFactoryImpl] wrappedFactory=[null]
04:17:53,624 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,624 DEBUG [BridgeConfigImpl:632] Instantiated bridgePhaseFactory=[com.liferay.faces.bridge.BridgePhaseFactoryImpl] wrappedFactory=[null]
04:17:53,626 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,663 DEBUG [BridgeConfigImpl:652] Instantiated BridgeRequestScopeFactory=[com.liferay.faces.bridge.scope.BridgeRequestScopeFactoryImpl] wrappedFactory=[null]
04:17:53,665 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,666 DEBUG [BridgeConfigImpl:673] Instantiated BridgeRequestScopeCacheFactory=[com.liferay.faces.bridge.scope.BridgeRequestScopeCacheFactoryImpl] wrappedFactory=[null]
04:17:53,668 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,669 DEBUG [BridgeConfigImpl:695] Instantiated BridgeRequestScopeManagerFactory=[com.liferay.faces.bridge.scope.BridgeRequestScopeManagerFactoryImpl] wrappedFactory=[null]
04:17:53,671 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,672 DEBUG [BridgeConfigImpl:717] Instantiated BridgeWriteBehindResponseFactory=[com.liferay.faces.bridge.application.view.BridgeWriteBehindResponseFactoryImpl] wrappedFactory=[null]
04:17:53,676 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,677 DEBUG [BridgeConfigImpl:737] Instantiated BridgeURLFactory=[com.liferay.faces.bridge.context.url.BridgeURLFactoryImpl] wrappedFactory=[null]
04:17:53,683 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,684 DEBUG [BridgeConfigImpl:789] Instantiated PortletContainerFactory=[com.liferay.faces.bridge.container.PortletContainerFactoryImpl] wrappedFactory=[null]
04:17:53,686 DEBUG [BridgeConfigImpl:39] Creating instance with zero-arg constructor since wrapperConstructor=null
04:17:53,687 DEBUG [BridgeConfigImpl:817] Instantiated UploadedFileFactory=[com.liferay.faces.bridge.model.UploadedFileFactoryImpl] wrappedFactory=[null]
04:17:53,688 DEBUG [BridgeConfigImpl:202] Post-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/lib/weld-servlet.jar!/META-INF/faces-config.xml]
04:17:53,690 DEBUG [BridgeConfigImpl:202] Post-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/lib/ext/resin.jar!/META-INF/faces-config.xml]
04:17:53,691 DEBUG [BridgeConfigImpl:202] Post-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/liferay-faces-alloy-3.1.0-rc2.jar!/META-INF/faces-config.xml]
04:17:53,692 DEBUG [BridgeConfigImpl:202] Post-processing faces-config: [jar:file:/usr/local/LiferayTomcat/liferay-portal-6.1.0-ce-ga1/apache-tomcat-7.0.27/webapps/jsf2-portlet/WEB-INF/lib/util-taglib.jar!/META-INF/faces-config.xml]
04:17:53,693 DEBUG [BridgeConfigImpl:223] Processing faces-config: [/WEB-INF/faces-config.xml]
04:17:53,694 DEBUG [BridgeConfigImpl:296] Processing web-app: [/WEB-INF/web.xml]
04:17:53,695 DEBUG [BridgeConfigImpl:306] Processing web-app: [/WEB-INF/liferay-web.xml]
04:17:53,699 DEBUG [BridgeConfigImpl:341] Added implicit extension-mapped servlet-mapping for urlPattern=[*.xhtml]
04:17:53,699 DEBUG [BridgeConfigImpl:341] Added implicit extension-mapped servlet-mapping for urlPattern=[*.jsp]
04:17:53,713 INFO [PortletHotDeployListener:433] 1 portlet for jsf2-portlet is available for use
04:17:55,418 INFO [PluginPackageUtil:1099] Reading plugin package for jsf2-portlet
04:17:55,430 INFO [PortletHotDeployListener:470] Unregistering portlets for jsf2-portlet
**04:17:55,437 INFO [PortletHotDeployListener:503] 1 portlet for jsf2-portlet was unregistered**
答案 0 :(得分:0)
您描述的行为通常意味着仍然会发生异常,但Liferay并未对其进行正确记录。大多数时候对我有用的是将logging.properties文件添加到我的portlet的WEB-INF / classes目录中,并为其提供以下内容:
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = catalina.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
在部署这个新WAR之后,您应该会看到其他日志记录,它们可以帮助您找到部署失败的原因。