Ошибка включения SpringBeanAutowiringSupport в веб-службе JAX-WS - PullRequest
7 голосов
/ 30 марта 2011

Я пытаюсь включить поддержку Spring Autowiring в моем веб-сервисе, следуя указаниям

public class MyService extends SpringBeanAutowiringSupport implements SomeInterface {

private Dao dao;

@Autowired
public void setDao(Dao dao) {
    this.dao = dao;
}

С классом MyService, помеченным

@WebService(endpointInterface = "SomeInterfacePath")

Однако, когда я пытаюсь запустить это, я получаю

java.lang.NoSuchMethodError: org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext()Lorg/springframework/web/context/WebApplicationContext;
at org.springframework.web.context.support.SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(SpringBeanAutowiringSupport.java:81)
at org.springframework.web.context.support.SpringBeanAutowiringSupport.<init>(SpringBeanAutowiringSupport.java:68)

ошибка, решение которой я не смог найти. Я использую Spring 3.0 jar и apache-cxf. Spring autowiring работает в других местах моего проекта, но, похоже, здесь не очень хорошо. Есть идеи о том, что происходит? У меня есть конечная точка jaxws, определенная в appConfig как

<jaxws:endpoint 
    id="myendpoint" 
    implementor="MyService" 
    address="/helloworld
    />

1 Ответ

1 голос
/ 29 апреля 2011

До недавнего времени Apache CXF считал Spring 2.5.5 зависимостью maven. Тем не менее, CXF версии 2.3 и новее используют Spring 3.

Оба содержат раздел <dependencymanagement>, который связывает Spring с указанной версией.

...