2012-07-25 8 views
1

내 응용 프로그램을 jboss-portal-2.7.2에 배포하려고하고 있습니다. 다음 오류가 발생합니다 :java.lang.NoSuchMethodError : org.springframework.web.portlet.context.ConfigurablePortletApplicationContext.setId (Ljava/lang/String;) V

04:17:23,879 INFO [DispatcherPortlet] FrameworkPortlet 'my_portlet': initialization started 
04:17:23,882 ERROR [LifeCycle] Cannot start object 
org.jboss.portal.portlet.container.PortletInitializationException: The portlet my_portlet threw an error during init 
    at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:292) 
    at org.jboss.portal.portlet.impl.container.PortletContainerLifeCycle.invokeStart(PortletContainerLifeCycle.java:76) 
    at org.jboss.portal.portlet.impl.container.LifeCycle.managedStart(LifeCycle.java:92) 
    at org.jboss.portal.portlet.impl.container.PortletApplicationLifeCycle.startDependents(PortletApplicationLifeCycle.java:351) 
... 
    at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421) 
    at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610) 
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263) 
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274) 
    at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225) 
Caused by: java.lang.NoSuchMethodError: org.springframework.web.portlet.context.ConfigurablePortletApplicationContext.setId(Ljava/lang/String;)V 
    at org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:345) 
    at org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294) 
    at org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268) 
    at org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:116) 
    at javax.portlet.GenericPortlet.init(GenericPortlet.java:107) 
    at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.initPortlet(PortletContainerImpl.java:417) 
    at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.start(PortletContainerImpl.java:256) 
    ... 76 more 

누구든지 해결 방법을 알고 있습니까?

MainController : 당신은 봄 context.jar Spring Context API - Version 2.0.x의 이전 버전을 사용하는 것처럼

package myportlet.spring.controller; 

import org.springframework.stereotype.Controller; 
import org.springframework.ui.Model; 
import org.springframework.web.bind.annotation.RequestMapping; 
import org.springframework.web.bind.annotation.RequestParam; 
import org.springframework.web.portlet.bind.annotation.RenderMapping; 
import org.apache.commons.lang.StringUtils; 
import javax.portlet.PortletPreferences; 
import javax.portlet.PortletRequest; 
import javax.portlet.PortletSession; 
import java.util.LinkedList; 
import java.util.List; 

@RequestMapping(value = "VIEW") 
@Controller(value = "mainController") 
public class MainController { 

    @RenderMapping 
    public String init(@RequestParam(value = "key", required = false) String key, Model model, PortletRequest request) throws Exception { 
     PortletSession session = request.getPortletSession(); 

     /* Get Key from Portlet Preferences */ 
     PortletPreferences preferences = request.getPreferences(); 
     String preferencesKey = preferences.getValue(constants.KEY, constants.FACTORY); 
     if(StringUtils.isEmpty(key)) { 
      key = preferencesKey; 
     } 

     /* Save current KEY into session */ 
     session.setAttribute(constants.KEY, key, PortletSession.APPLICATION_SCOPE); 

     model.addAttribute("entityList", getEntities()); 
     model.addAttribute("preferencesKey", preferencesKey); 
     return "index"; 
    } 
} 

pom.xml

답변

2
Caused by: java.lang.NoSuchMethodError: org.springframework.web.portlet.context.ConfigurablePortletApplicationContext.setId(Ljava/lang/String;)V 

소리가 난다.

최신 버전 Spring Context API - Version 3.0.x을 사용해보세요.

+0

스프링 용 MVC 프레임 워크 3.0.4.RELEASE를 사용합니다. 내 pom.xml : http://pastebin.com/35Efzzrc – abg

+1

프로필 local_test를 사용하고 있습니까? jboss 서버 (jboss/lib)에서 올바른 스프링 버전을 사용하고 있는지 확인하거나 프로젝트의 pom.xml (local_test 프로필 아래)에서 ()을 제거하면됩니다. – yorkw

+0

포틀릿의 내용을 확인했습니다. 스프링 컨텍스트에는 두 가지 버전이 있습니다. http://3.firepic.org/3/images/2012-07/26/uqb65sn5veam.png 포틀릿에 어떻게 들어갈 수 있는지 이해하지 못합니다. 프로필 local_test에서 pom.xml의 으로 삭제했지만 아무 효과가 없습니다. – abg