chinedubond
Jul 12th, 2007, 12:21 PM
I am trying to convert an exiting spring mvc app to use spring portlet mvc
i am trying to deploy it on liferay portal.
i followed the sample in the sample-portlet.the war that can from the sample works well. but when i try to modify my app to use portlet mvc i get lots of errors.
i keep getting errors
like
class
org.springframework.web.portlet.DispatcherPortlet ca not be found
or
class cast exception when i hot deploy with liferay
org.springframework.web.portlet.DispatcherPortlet
mind you all the need jars are in my lib folder
please my portlel mvc is not working.
please help out
My portlet.xml
<code>
<?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>TestSpring</portlet-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/context/portlet/testSpring.xml</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>Spring Test</title>
</portlet-info>
</portlet>
</portlet-app>
</code>
my
<code>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "../../dtd/spring-beans.dtd">
<beans>
<!-- Controllers -->
<bean id="statePortletController" class="com.mindworks.sample.web.portlet.StatePortletContr oller">
<property name="stateService"><ref bean="stateService"/></property>
</bean>
<bean class="com.mindworks.sample.service.StateServiceImpl" id="stateService">
<property name="stateDao"><ref bean="stateDAO"/></property>
</bean>
<!-- Handler Mapping -->
<bean id="parameterMappingInterceptor" class="org.springframework.web.portlet.handler.ParameterM appingInterceptor"/>
<bean id="portletModeParameterHandlerMapping" class="org.springframework.web.portlet.handler.PortletMod eParameterHandlerMapping">
<property name="order" value="10"/>
<property name="interceptors">
<list>
<ref bean="parameterMappingInterceptor"/>
</list>
</property>
<property name="portletModeParameterMap">
<map>
<entry key="view">
<map>
<entry key="hello"><ref bean="statePortletController"/></entry>
</map>
</entry>
</map>
</property>
</bean>
<bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletMod eHandlerMapping">
<property name="order" value="20"/>
<property name="portletModeMap">
<map>
<entry key="view"><ref bean="statePortletController"/></entry>
</map>
</property>
</bean>
<!-- Exceptions Handler -->
<bean id="defaultExceptionHandler" parent="defaultExceptionHandlerTemplate"/>
</beans>
</code>
i am trying to deploy it on liferay portal.
i followed the sample in the sample-portlet.the war that can from the sample works well. but when i try to modify my app to use portlet mvc i get lots of errors.
i keep getting errors
like
class
org.springframework.web.portlet.DispatcherPortlet ca not be found
or
class cast exception when i hot deploy with liferay
org.springframework.web.portlet.DispatcherPortlet
mind you all the need jars are in my lib folder
please my portlel mvc is not working.
please help out
My portlet.xml
<code>
<?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>TestSpring</portlet-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/context/portlet/testSpring.xml</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>Spring Test</title>
</portlet-info>
</portlet>
</portlet-app>
</code>
my
<code>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "../../dtd/spring-beans.dtd">
<beans>
<!-- Controllers -->
<bean id="statePortletController" class="com.mindworks.sample.web.portlet.StatePortletContr oller">
<property name="stateService"><ref bean="stateService"/></property>
</bean>
<bean class="com.mindworks.sample.service.StateServiceImpl" id="stateService">
<property name="stateDao"><ref bean="stateDAO"/></property>
</bean>
<!-- Handler Mapping -->
<bean id="parameterMappingInterceptor" class="org.springframework.web.portlet.handler.ParameterM appingInterceptor"/>
<bean id="portletModeParameterHandlerMapping" class="org.springframework.web.portlet.handler.PortletMod eParameterHandlerMapping">
<property name="order" value="10"/>
<property name="interceptors">
<list>
<ref bean="parameterMappingInterceptor"/>
</list>
</property>
<property name="portletModeParameterMap">
<map>
<entry key="view">
<map>
<entry key="hello"><ref bean="statePortletController"/></entry>
</map>
</entry>
</map>
</property>
</bean>
<bean id="portletModeHandlerMapping" class="org.springframework.web.portlet.handler.PortletMod eHandlerMapping">
<property name="order" value="20"/>
<property name="portletModeMap">
<map>
<entry key="view"><ref bean="statePortletController"/></entry>
</map>
</property>
</bean>
<!-- Exceptions Handler -->
<bean id="defaultExceptionHandler" parent="defaultExceptionHandlerTemplate"/>
</beans>
</code>