2012-09-03 2 views
0

봄의 새내기는 여기에 있습니다. 내 스프링 MVC 3.0.2 응용 프로그램과 함께 글래스 피쉬 3.0.1에서 다음과 같은 오류를 받고 있어요 :WELD-001408 주입 지점에 org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter의 종속성이 없습니다.

rg.glassfish.deployment.common.DeploymentException: WELD-001408 Injection point has unsatisfied dependencies. Injection point: parameter 0 of constructor public controller.CustomWebArgumentResolverInstaller(org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter); Qualifiers: [@javax.enterprise.inject.Default()] 

내 applicationContext.xml은 CustomWebArgumentResolverInstaller.java은 다음과 같다

<mvc:annotation-driven /> 

있습니다

package controller; 

import javax.inject.Inject; 

import org.springframework.stereotype.Component; 
import org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter; 
import org.springframework.web.bind.support.WebArgumentResolver; 
import org.springframework.mobile.device.mvc.DeviceWebArgumentResolver; 



@Component 
public class CustomWebArgumentResolverInstaller { 

@Inject 
public CustomWebArgumentResolverInstaller(AnnotationMethodHandlerAdapter controllerInvoker) { 
    WebArgumentResolver[] resolvers = new WebArgumentResolver[1]; 
    resolvers[0] = new DeviceWebArgumentResolver(); 
    controllerInvoker.setCustomArgumentResolvers(resolvers); 
} 
} 

무엇을 가장 환영 할 만한지에 대한 아이디어. 이 기사를 처음 접했을 때 게시와 관련된 내용이 확실하지 않으므로 다른 정보가 필요하면 질문하십시오.

답변

1

JSR-330 주석 (@Inject, @Named 등)이 Spring이 아닌 Glassfish에 의해 처리되는 것처럼 보입니다. 그 방법을 어떻게 억제 할 수 있을지 모르지만, 해결 방법은 스프링 기본 주석 (@Autowired)을 대신 사용하는 것일 수 있습니다.

+0

로 고정했습니다. 대단히 감사합니다! – TomL

관련 문제