Wojciech Potocki ...
Temat: Spring+Hibernate+Liferay
Pojawia mi się błąd i nie wiem dlaczego:applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
">
<aop:aspectj-autoproxy />
<context:component-scan base-package="code" />
<bean
class="org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter"
id="dataSource"> </bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>code.domain.News</value>
</list>
</property>
</bean>
<tx:annotation-driven transaction-manager="txManager" />
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
NewsController.java
package code.controller;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import javax.portlet.*;
import org.springframework.ui.Model;
import org.springframework.web.portlet.ModelAndView;
import javax.portlet.RenderResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.portlet.bind.annotation.RenderMapping;
import com.liferay.portal.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
@Controller(value="newsController")
@RequestMapping(value = "VIEW")
public class NewsController {
public void handleActionRequest(ActionRequest request,
ActionResponse response) throws Exception
{
}
@RenderMapping
public ModelAndView hello(RenderRequest request, RenderResponse
response) throws Exception
{
Map<String, Object> model = new HashMap<String,
Object>();
model.put("helloWorldMessage", "Hello World");
return new ModelAndView("helloWorld", model);
}
}
Otrzymuję błąd:
2012-08-31 21:23:44
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet Wiadomosci Servlet threw
exception
javax.portlet.UnavailableException: No handler found for
request
Co to oznacza?