Foros de discusión

Problem with Spring Portlet MVC in Liferay

Mauricio Ganz, modificado hace 15 años.

Problem with Spring Portlet MVC in Liferay

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
[1]

Hi!

I developed some simple portlets for Liferay and all of them are working fine. Another one (more complex) I developed under Spring Portlet MVC for Pluto first (working fine). But when I adapted it to work in Liferay i´ve got some problems. When I deploy it to Liferay and start the portal, I´ve got the messages in [3] during the initialization. After the init is complete and I run liferay, the portlet does not appear in my portlets list (when I click "Add Application").

Configurations:

Liferay Jboss Tomcat 4.4.2
Spring Framework 2.5.3

Web.xml and Portlet.xml in [2]

Init messages [3]

I researched related problems in this community and google, but nothing helped me.

Any idea what could be? jars versions conflict (between liferay and my portlet)? something in my xml files?

Thanks,

Mauricio Ganz
Mauricio Ganz, modificado hace 15 años.

Web.xml and Portlet.xml

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
[2] Web.xml and Portlet.xml

---- File: Web.xml ----

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Push Portlet Application</display-name>

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>push.root</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>

<!-- Listeners -->

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

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

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

<listener>
<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
</listener>

<!-- Servlets -->

<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>push</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>org.springframework.web.portlet.DispatcherPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

<!-- Servlets Mappings -->

<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>push</servlet-name>
<url-pattern>/push/*</url-pattern>
</servlet-mapping>

<!-- Taglibs -->

<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/WEB-INF/tags/spring-form.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tags/c.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tags/fmt.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/functions</taglib-uri>
<taglib-location>/WEB-INF/tags/fn.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://www.springframework.org/tags</taglib-uri>
<taglib-location>/WEB-INF/tags/spring.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>/WEB-INF/tags/portlet.tld</taglib-location>
</taglib>
</web-app>

---- File: Portlet.xml ----

<?xml version="1.0" encoding="UTF-8"?>

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
<portlet>
<portlet-name>push</portlet-name>
<display-name>Push Portlet</display-name>

<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>

<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/context/portlet/push-portlet.xml</value>
</init-param>

<init-param>
<name>viewRendererUrl</name>
<value>/WEB-INF/servlet/view</value>
</init-param>

<expiration-cache>0</expiration-cache>

<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>

<portlet-info>
<title>PRR1 Push</title>
<short-title>PRR1 Push</short-title>
<keywords>push</keywords>
</portlet-info>
</portlet>
</portlet-app>
shakti rath, modificado hace 12 años.

RE: Web.xml and Portlet.xml

New Member Mensajes: 9 Fecha de incorporación: 27/12/11 Mensajes recientes
I suggest just remove this

<servlet>
<servlet-name>push</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
<init-param>
<param-name>portlet-class</param-name>
<param-value>org.springframework.web.portlet.DispatcherPortlet</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>push</servlet-name>
<url-pattern>/push/*</url-pattern>
</servlet-mapping>
Mauricio Ganz, modificado hace 15 años.

[3] - init messages

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
[3] - init messages

portlet: Intranet-Push-Portlet.war

18:05:44,093 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../tmp/deploy/tmp
22490Intranet-Push-Portlet-exp.war/
18:05:51,953 INFO [[/]] Set web app root system property: 'push.root' = [C:\DOC
UME~1\cdi\CONFIG~1\Temp\8-ROOT\]
18:05:51,968 INFO [[/]] Set web app root system property: 'push.root' = [C:\DOC
UME~1\cdi\CONFIG~1\Temp\8-ROOT\]
18:05:52,359 INFO [[/]] Initializing log4j from [C:\DOCUME~1\cdi\CONFIG~1\Temp\
8-ROOT\WEB-INF\classes\log4j.properties]
18:05:53,015 INFO [[/]] Initializing Spring root WebApplicationContext
18:05:53,015 INFO [STDOUT] 2008-06-16 18:05:53,015 INFO [org.springframework.we
b.context.ContextLoader] - Root WebApplicationContext: initialization started
18:05:53,109 INFO [STDOUT] 2008-06-16 18:05:53,109 INFO [org.springframework.we
b.context.support.XmlWebApplicationContext] - Refreshing org.springframework.web
.context.support.XmlWebApplicationContext@1c8f3cd: display name [Root WebApplica
tionContext]; startup date [Mon Jun 16 18:05:53 GMT 2008]; root of context hiera
rchy
18:05:53,250 INFO [STDOUT] 2008-06-16 18:05:53,250 INFO [org.springframework.be
ans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from Ser
vletContext resource [/WEB-INF/context/applicationContext.xml]
18:05:53,859 INFO [STDOUT] 2008-06-16 18:05:53,859 INFO [org.springframework.we
b.context.support.XmlWebApplicationContext] - Bean factory for application conte
xt [org.springframework.web.context.support.XmlWebApplicationContext@1c8f3cd]: o
rg.springframework.beans.factory.support.DefaultListableBeanFactory@17eb767
18:05:54,343 INFO [STDOUT] 2008-06-16 18:05:54,343 INFO [org.springframework.be
ans.factory.config.PropertyPlaceholderConfigurer] - Loading properties file from
ServletContext resource [/WEB-INF/classes/jdbc.properties]
18:05:55,828 INFO [STDOUT] 2008-06-16 18:05:55,828 INFO [org.springframework.be
ans.factory.support.DefaultListableBeanFactory] - Pre-instantiating singletons i
n org.springframework.beans.factory.support.DefaultListableBeanFactory@17eb767:
defining beans [messageSource,viewResolver,dataSource,propertyConfigurer,transac
tionManager,org.springframework.aop.config.internalAutoProxyCreator,org.springfr
amework.aop.support.DefaultBeanFactoryPointcutAdvisor#0,txAdvice]; root of facto
ry hierarchy
18:05:56,171 INFO [STDOUT] 2008-06-16 18:05:56,171 INFO [org.springframework.we
b.context.ContextLoader] - Root WebApplicationContext: initialization completed
in 3156 ms

18:05:56,609 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/ROOT.wa
r/
18:05:56,640 ERROR [STDERR] 16/06/2008 18:05:56 com.liferay.portal.kernel.log.Jd
k14LogImpl info
INFO: Initializing hot deploy manager 17877744
18:05:56,640 INFO [[/]] Closing Spring root WebApplicationContext
18:05:56,640 INFO [STDOUT] 2008-06-16 18:05:56,640 INFO [org.springframework.we
b.context.support.XmlWebApplicationContext] - Closing org.springframework.web.co
ntext.support.XmlWebApplicationContext@1c8f3cd: display name [Root WebApplicatio
nContext]; startup date [Mon Jun 16 18:05:53 GMT 2008]; root of context hierarch
y
18:05:56,656 INFO [STDOUT] 2008-06-16 18:05:56,656 INFO [org.springframework.be
ans.factory.support.DefaultListableBeanFactory] - Destroying singletons in org.s
pringframework.beans.factory.support.DefaultListableBeanFactory@17eb767: definin
g beans [messageSource,viewResolver,dataSource,propertyConfigurer,transactionMan
ager,org.springframework.aop.config.internalAutoProxyCreator,org.springframework
.aop.support.DefaultBeanFactoryPointcutAdvisor#0,txAdvice]; root of factory hier
archy

18:05:56,671 INFO [[/]] Shutting down log4j

...

18:07:26,875 INFO [PluginPackageHotDeployListener] Plugin package Push Portlet
Application/Push Portlet Application/unknown/war registered successfully
thumbnail
Thiago Moreira, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
Hi Mauricio,

I have been working with Liferay (4.4.x and 5.0.X) and Spring MVC since April and I never noticed this problem. I noticed one thing different from my configuration files in comparative with yours, the thing is an extra listener (org.springframework.web.util.WebAppRootListener) on your web.xml. Try to remove it and deploy again!
I just worked with Liferay bundled on Tomcat, without JBoss, but I will try to deploy my portlets on liferay-portal-jboss-tomcat-4.2-4.4.2.

Cheers
Mauricio Ganz, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
Hi Thiago! I´ll try.

Thanks
Mauricio Ganz, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
I removed WebAppRootListener and nothing changed.

I´m working with liferay-portal-tomcat-6.0-4.4.2 now. I noticed an interesting thing... Deploying my portlet (without any modification) I´ve got the messages in [R1]. Removing PortletContextListener from web.xml I´ve got the messages in [R2] - No errors messages or warning were sent... but I still can´t add my portlet.

Any suggestions?

Still fighting here...
Mauricio Ganz, modificado hace 15 años.

[R1]

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
[R1] with Portlet Context Listener in web.xml


...

17/06/2008 18:00:54 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.WebAppRootListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 18:00:54 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.Log4jConfigListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 18:00:54 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.context.ContextLoaderListener" is al
ready configured for this context. The duplicate definition has been ignored.
17/06/2008 18:00:54 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.PortletContextListener" is
already configured for this context. The duplicate definition has been ignored.

2008-06-17 18:00:55,156 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization started
2008-06-17 18:00:55,218 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Refreshing org.springframework.web.context.support.XmlWebAppli
cationContext@9f26c7: display name [Root WebApplicationContext]; startup date [T
ue Jun 17 18:00:55 GMT 2008]; root of context hierarchy
2008-06-17 18:00:55,328 INFO [org.springframework.beans.factory.xml.XmlBeanDefin
itionReader] - Loading XML bean definitions from ServletContext resource [/WEB-I
NF/context/applicationContext.xml]
2008-06-17 18:00:55,656 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Bean factory for application context [org.springframework.web.
context.support.XmlWebApplicationContext@9f26c7]: org.springframework.beans.fact
ory.support.DefaultListableBeanFactory@110c2e8
2008-06-17 18:00:55,781 INFO [org.springframework.beans.factory.config.PropertyP
laceholderConfigurer] - Loading properties file from ServletContext resource [/W
EB-INF/classes/jdbc.properties]
2008-06-17 18:00:56,781 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.
factory.support.DefaultListableBeanFactory@110c2e8: defining beans [messageSourc
e,viewResolver,dataSource,propertyConfigurer,transactionManager,org.springframew
ork.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultB
eanFactoryPointcutAdvisor#0,txAdvice]; root of factory hierarchy
2008-06-17 18:00:56,921 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization completed in 1765 ms
18:00:56,921 INFO [PluginPackageHotDeployListener:74] Reading plugin package fo
r Push Portlet Application
18:00:57,078 INFO [PluginPackageHotDeployListener:187] Plugin package liferay/I
ntranet-Push-Portlet/4.4.2.1/war registered successfully
18:00:57,093 INFO [PortletHotDeployListener:133] Registering portlets for Push
Portlet Application
18:00:57,156 ERROR [HotDeployUtil:60] com.liferay.portal.kernel.deploy.hot.HotDe
ployException: Error registering portlets for Push Portlet Application
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portl
ets for Push Portlet Application
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(P
ortletHotDeployListener.java:431)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(H
otDeployUtil.java:89)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(Ho
tDeployUtil.java:42)
at com.liferay.portal.kernel.servlet.PortletContextListener.portalInit(P
ortletContextListener.java:45)
at com.liferay.portal.kernel.util.PortalInitableUtil.init(PortalInitable
Util.java:39)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextIniti
alized(PortletContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
350)
...
Mauricio Ganz, modificado hace 15 años.

[R2]

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
[R2] Without Portlet Context Listener

17/06/2008 18:09:33 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.WebAppRootListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 18:09:33 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.Log4jConfigListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 18:09:33 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.context.ContextLoaderListener" is al
ready configured for this context. The duplicate definition has been ignored.
2008-06-17 18:09:34,156 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization started
2008-06-17 18:09:34,218 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Refreshing org.springframework.web.context.support.XmlWebAppli
cationContext@86a602: display name [Root WebApplicationContext]; startup date [T
ue Jun 17 18:09:34 GMT 2008]; root of context hierarchy
2008-06-17 18:09:34,328 INFO [org.springframework.beans.factory.xml.XmlBeanDefin
itionReader] - Loading XML bean definitions from ServletContext resource [/WEB-I
NF/context/applicationContext.xml]
2008-06-17 18:09:34,656 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Bean factory for application context [org.springframework.web.
context.support.XmlWebApplicationContext@86a602]: org.springframework.beans.fact
ory.support.DefaultListableBeanFactory@82c063
2008-06-17 18:09:34,781 INFO [org.springframework.beans.factory.config.PropertyP
laceholderConfigurer] - Loading properties file from ServletContext resource [/W
EB-INF/classes/jdbc.properties]
2008-06-17 18:09:35,906 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.
factory.support.DefaultListableBeanFactory@82c063: defining beans [messageSource
,viewResolver,dataSource,propertyConfigurer,transactionManager,org.springframewo
rk.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultBe
anFactoryPointcutAdvisor#0,txAdvice]; root of factory hierarchy
2008-06-17 18:09:36,046 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization completed in 1890 ms
thumbnail
Thiago Moreira, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
Hi Mauricio,

I think we have a clue on the R1. Please, attach the whole log file here, I think the root problem is in the file.

Cheers
Mauricio Ganz, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
the log of the matrix:

17/06/2008 19:09:37 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\Arquivos
de programas\Java\jdk1.5.0_15\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\Arquivos
de programas\PHP\;C:\ORANT\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System3
2\Wbem;C:\WINDOWS\system32\nls;C:\WINDOWS\system32\nls\PORTUGUE;C:\ARQUIV~1\BROA
DC~1;C:\Arquivos de programas\Plone 2\Python;C:\Arquivos de programas\Java\jdk1.
5.0_15\bin;c:\apache-ant-1.7.0\bin;C:\Jikes-1.22\bin;C:\ORANT\NET80\ADMIN;C:\Arq
uivos de programas\Subversion\SVNService;C:\Liferay\liferay-portal-tomcat-6.0-4.
4.2\bin
17/06/2008 19:09:37 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
17/06/2008 19:09:37 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 922 ms
17/06/2008 19:09:37 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
17/06/2008 19:09:37 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
17/06/2008 19:09:39 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.servlet.PortalSessionListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 19:09:39 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.PortletSessionListenerMana
ger" is already configured for this context. The duplicate definition has been i
gnored.
17/06/2008 19:09:39 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.SerializableSessionAttribu
teListener" is already configured for this context. The duplicate definition has
been ignored.
Loading jar:file:/C:/Liferay/liferay-portal-tomcat-6.0-4.4.2/webapps/ROOT/WEB-IN
F/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/Liferay/liferay-portal-tomcat-6.0-4.4.2/webapps/ROOT/WEB-IN
F/lib/portal-impl.jar!/portal.properties
Starting Liferay Enterprise Portal 4.4.2 (Spurgeon / Build 4402 / February 22, 2
008)
19:09:51,750 INFO [DynamicDialect:79] Determining dialect for HSQL Database Eng
ine 1
19:09:51,765 WARN [DynamicDialect:85] Liferay is configured to use Hypersonic a
s its database. Do NOT use Hypersonic in production. Hypersonic is an embedded d
atabase useful for development and demo'ing purposes.
19:09:51,796 INFO [DynamicDialect:102] Using dialect org.hibernate.dialect.HSQL
Dialect
19:10:09,109 INFO [PortalUtil:2317] Portal lib url file:/C:/Liferay/liferay-por
tal-tomcat-6.0-4.4.2/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/porta
l/util/PortalUtil.class
19:10:09,125 INFO [PortalUtil:2342] Portal lib directory /C:/Liferay/liferay-po
rtal-tomcat-6.0-4.4.2/webapps/ROOT/WEB-INF/lib/
19:10:09,203 INFO [PluginPackageHotDeployListener:71] Reading plugin package fo
r the root context
19:10:11,421 INFO [HotDeployUtil:76] Initializing hot deploy manager 12316528
19:10:11,421 INFO [ServerDetector:76] Detected server tomcat
19:10:11,890 INFO [AutoDeployDir:76] Auto deploy scanner started for C:\Documen
ts and Settings\cdi\liferay\deploy
19:10:12,046 INFO [CustomSQLUtil:110] Database name HSQL Database Engine
Loading jar:file:/C:/Liferay/liferay-portal-tomcat-6.0-4.4.2/webapps/ROOT/WEB-IN
F/lib/portal-impl.jar!/portal.properties for {companyId=1, webId=liferay.com}
17/06/2008 19:10:13 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.PortletContextListener" is
already configured for this context. The duplicate definition has been ignored.

19:10:13,109 INFO [PluginPackageHotDeployListener:74] Reading plugin package fo
r google-gadget-portlet
19:10:13,406 INFO [PluginPackageHotDeployListener:187] Plugin package liferay/g
oogle-gadget-portlet/4.4.0.1/war registered successfully
19:10:13,406 INFO [PortletHotDeployListener:133] Registering portlets for googl
e-gadget-portlet
19:10:13,593 INFO [PortletHotDeployListener:425] Portlets for google-gadget-por
tlet registered successfully
17/06/2008 19:10:14 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.WebAppRootListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 19:10:14 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.util.Log4jConfigListener" is already
configured for this context. The duplicate definition has been ignored.
17/06/2008 19:10:14 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "org.springframework.web.context.ContextLoaderListener" is al
ready configured for this context. The duplicate definition has been ignored.
17/06/2008 19:10:14 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.PortletContextListener" is
already configured for this context. The duplicate definition has been ignored.

2008-06-17 19:10:14,375 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization started
2008-06-17 19:10:14,437 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Refreshing org.springframework.web.context.support.XmlWebAppli
cationContext@1f0c3ef: display name [Root WebApplicationContext]; startup date [
Tue Jun 17 19:10:14 GMT 2008]; root of context hierarchy
2008-06-17 19:10:14,546 INFO [org.springframework.beans.factory.xml.XmlBeanDefin
itionReader] - Loading XML bean definitions from ServletContext resource [/WEB-I
NF/context/applicationContext.xml]
2008-06-17 19:10:14,953 INFO [org.springframework.web.context.support.XmlWebAppl
icationContext] - Bean factory for application context [org.springframework.web.
context.support.XmlWebApplicationContext@1f0c3ef]: org.springframework.beans.fac
tory.support.DefaultListableBeanFactory@170526a
2008-06-17 19:10:15,109 INFO [org.springframework.beans.factory.config.PropertyP
laceholderConfigurer] - Loading properties file from ServletContext resource [/W
EB-INF/classes/jdbc.properties]
2008-06-17 19:10:16,046 INFO [org.springframework.beans.factory.support.DefaultL
istableBeanFactory] - Pre-instantiating singletons in org.springframework.beans.
factory.support.DefaultListableBeanFactory@170526a: defining beans [messageSourc
e,viewResolver,dataSource,propertyConfigurer,transactionManager,org.springframew
ork.aop.config.internalAutoProxyCreator,org.springframework.aop.support.DefaultB
eanFactoryPointcutAdvisor#0,txAdvice]; root of factory hierarchy
2008-06-17 19:10:16,187 INFO [org.springframework.web.context.ContextLoader] - R
oot WebApplicationContext: initialization completed in 1812 ms
19:10:16,187 INFO [PluginPackageHotDeployListener:74] Reading plugin package fo
r Push Portlet Application
19:10:16,328 INFO [PluginPackageHotDeployListener:187] Plugin package liferay/I
ntranet-Push-Portlet/4.4.2.1/war registered successfully
19:10:16,343 INFO [PortletHotDeployListener:133] Registering portlets for Push
Portlet Application
19:10:16,406 ERROR [HotDeployUtil:60] com.liferay.portal.kernel.deploy.hot.HotDe
ployException: Error registering portlets for Push Portlet Application
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portl
ets for Push Portlet Application
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(P
ortletHotDeployListener.java:431)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(H
otDeployUtil.java:89)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(Ho
tDeployUtil.java:42)
at com.liferay.portal.kernel.servlet.PortletContextListener.portalInit(P
ortletContextListener.java:45)
at com.liferay.portal.kernel.util.PortalInitableUtil.init(PortalInitable
Util.java:39)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextIniti
alized(PortletContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
t.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
350)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
1)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:924)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j
ava:887)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492
)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
)
at org.apache.catalina.core.StandardService.start(StandardService.java:5
16)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.ClassCastException: org.springframework.web.portlet.Dispatc
herPortlet
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(P
ortletHotDeployListener.java:159)
... 29 more
17/06/2008 19:10:16 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.ThemeContextListener" is a
lready configured for this context. The duplicate definition has been ignored.
19:10:16,796 INFO [PluginPackageHotDeployListener:74] Reading plugin package fo
r liferay-jedi-theme
19:10:16,906 INFO [PluginPackageHotDeployListener:187] Plugin package liferay/l
iferay-jedi-theme/4.4.2.1/war registered successfully
19:10:16,921 INFO [ThemeHotDeployListener:77] Registering themes for liferay-je
di-theme
19:10:16,921 INFO [ThemeHotDeployListener:89] Themes for liferay-jedi-theme reg
istered successfully
17/06/2008 19:10:17 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.SpringServletContextListen
er" is already configured for this context. The duplicate definition has been ig
nored.
17/06/2008 19:10:17 org.apache.catalina.core.StandardContext addApplicationListe
ner
INFO: The listener "com.liferay.portal.kernel.servlet.TunnelContextListener" is
already configured for this context. The duplicate definition has been ignored.
17/06/2008 19:10:20 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
17/06/2008 19:11:06 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
17/06/2008 19:11:06 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
17/06/2008 19:11:06 org.apache.catalina.startup.Catalina start
INFO: Server startup in 88462 ms
thumbnail
Thiago Moreira, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
Ok, the root problem is this:

java.lang.ClassCastException: org.springframework.web.portlet.DispatcherPortlet

It occurs because you may have two different versions of DispatcherPortlet class on your classpath. Try to find every entry of it on your classpath and list them here.

Cheers
Mauricio Ganz, modificado hace 15 años.

RE: Problem with Spring Portlet MVC in Liferay

New Member Mensajes: 9 Fecha de incorporación: 16/06/08 Mensajes recientes
Thiago Moreira:

java.lang.ClassCastException: org.springframework.web.portlet.DispatcherPortlet




emoticon i didn´t notice that exception!

i removed portlet-api.jar from my lib directory and now the problem is resolved! emoticon

now i have a new one!

great! thanks a lot!