Fórum

Trying to use Spring in Portlet - SEVERE: Error listenerStart

Sarah Killcoyne, modificado 16 Anos atrás.

Trying to use Spring in Portlet - SEVERE: Error listenerStart

New Member Postagens: 14 Data de Entrada: 10/04/08 Postagens Recentes
I'm new to spring and I've played with portlets only a little. I managed to get a basic portlet running in liferay (after pulling ever lib out of the war that liferay already has) however, now I'm trying to get a spring based portlet running and it always fails to startup:


20:04:02,713 INFO  [AutoDeployDir:76] Processing Search.war
20:04:02,714 INFO  [PortletAutoDeployListener:77] Copying portlets for /Users/skillcoy/liferay/deploy/Search.war
20:04:02,716 INFO  [BaseDeployer:493] Deploying Search.war
20:04:02,717 INFO  [BaseDeployer:575] Updating Entrez Gene Search from version 1.0 to version 1.0
  Expanding: /Users/skillcoy/liferay/deploy/Search.war into /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/temp/20080411200402717
  Copying 1 file to /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/temp/20080411200402717/WEB-INF
20:04:03,576 INFO  [BaseDeployer:1131] Modifying Servlet 2.4 /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/temp/20080411200402717/WEB-INF/web.xml
  Copying 14 files to /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/webapps/search
  Copying 1 file to /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/webapps/search
  Deleting directory /Users/skillcoy/liferay-portal-tomcat-6.0-4.4.2/temp/20080411200402717
20:04:03,615 INFO  [PortletAutoDeployListener:87] Portlets for /Users/skillcoy/liferay/deploy/Search.war copied successfully
Apr 11, 2008 8:04:10 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/search]
Apr 11, 2008 8:04:10 PM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/search] has not been started
Apr 11, 2008 8:04:10 PM org.apache.catalina.core.StandardContext addApplicationListener
INFO: The listener "com.liferay.portal.kernel.servlet.PortletContextListener" is already configured for this context. The duplicate definition has been ignored.
20:04:10,233 INFO  [PluginPackageHotDeployListener:74] Reading plugin package for Entrez Gene Search
20:04:10,393 INFO  [PluginPackageHotDeployListener:187] Plugin package systemsbiology/search/1.0/war registered successfully
20:04:10,408 INFO  [PortletHotDeployListener:133] Registering portlets for Entrez Gene Search
Apr 11, 2008 8:04:11 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Apr 11, 2008 8:04:11 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/search] startup failed due to previous errors
20:04:11,053 INFO  [PluginPackageHotDeployListener:74] Reading plugin package for Entrez Gene Search
20:04:11,057 INFO  [PluginPackageHotDeployListener:221] Plugin package systemsbiology/search/1.0/war unregistered successfully


The only error I ever see is "SEVERE: Error listenerStart". I've pulled all the libs out that I could see that also appear in the liferay lib directory and I've tryied commenting out various things in the xml files and I always get this error (which is completely useless and might have me going in the wrong direction entirely). Googling this error obviously doesn't get me very far.

Any suggestions??
Sarah Killcoyne, modificado 16 Anos atrás.

RE: Trying to use Spring in Portlet - SEVERE: Error listenerStart

New Member Postagens: 14 Data de Entrada: 10/04/08 Postagens Recentes
I'm really surprised no one else has come across this. I got help from one of our guys who used liferay a some a year ago and he was stumped too. I'll be trying this in other portals so maybe it will become more clear.
thumbnail
Javier Beringola, modificado 15 Anos atrás.

RE: Trying to use Spring in Portlet - SEVERE: Error listenerStart

New Member Postagens: 24 Data de Entrada: 05/07/08 Postagens Recentes
It happened to me 10 minutes ago with the mail portlet and i'm lost. Have you fix it?
thumbnail
Jonas Yuan, modificado 15 Anos atrás.

RE: Trying to use Spring in Portlet - SEVERE: Error listenerStart

Liferay Master Postagens: 993 Data de Entrada: 27/04/07 Postagens Recentes
Hi Sarah,

It would be very helpful if you had proper project settings in Spring MVC.

Here is real example (posted on 1/9/08) in Plugins SDK

http://www.liferay.com/web/guest/community/forums/-/message_boards/message/383563

Good Luck!

Jonas Yuan
Dan Wellborn, modificado 14 Anos atrás.

RE: Trying to use Spring in Portlet - SEVERE: Error listenerStart

New Member Postagens: 6 Data de Entrada: 05/10/07 Postagens Recentes
I had the exact same problem and after much research/trial and error I discovered an issue with the context load listener when deploying multiple portlets. Every portlet must have a unique webAppRootKey configured in web.xml or you will get this error on startup: java.lang.IllegalStateException: Root context attribute is not of type WebApplication . I thought it was a classpath problem, but this turned out to solve the problem for me.

Please add the following to web.xml to fix this problem.

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>MyPortlet</param-value>
</context-param>

This is a complete web.xml sample:

<!--?xml version="1.0" encoding="UTF-8"?-->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>MyPortlet</display-name>
	<context-param>
		<param-name>webAppRootKey</param-name>
		<param-value>MyPortlet</param-value>
	</context-param>
	
 	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/classes/log4j.properties</param-value>
	</context-param>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>/WEB-INF/context/applicationContext.xml</param-value>
	</context-param>

	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>

	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<servlet>
		<servlet-name>ViewRendererServlet</servlet-name>
		<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
		
	<servlet-mapping>
		<servlet-name>ViewRendererServlet</servlet-name>
		<url-pattern>/WEB-INF/servlet/view</url-pattern>
	</servlet-mapping>
	
	<jsp-config>
		<taglib>
		    <taglib-uri>http://java.sun.com/portlet</taglib-uri>
		    <taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
		</taglib>
	</jsp-config>
</web-app>