Использование spring вместе с jbossws-cxf на jboss 6

Я хочу использовать Spring вместе с jbossws-cxf. Это возможно?

Сначала я попытался использовать jbossws-cxf.xml с определениями компонентов Spring. В предупреждающем сообщении [DescriptorDeploymentAspect] Spring not available, skipping check for user provided jbossws-cxf.xml / cxf.xml configuration files. говорится, что файл игнорируется, и это означает, что вы должны установить Spring, чтобы он не был проигнорирован :-). Поэтому я установил Spring для jboss.

После установки и запуска простого MathWS вместе с простым примером WS я получаю

  [org.jboss.wsf.stack.cxf.client.configuration.JBossWSSpringBusFactory] INITIAL_APP_CONTEXT_CREATION_FAILED_MSG: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.binding.soap.customEditorConfigurer' defined in URL [vfs:/D:/lifeDevSuite/jboss/jboss-6.0.0.FinalSpring/common/lib/cxf-rt-bindings-soap.jar/META-INF/cxf/cxf-extension-soap.fixml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'org.springframework.beans.PropertyEditorRegistrar[]' for property 'propertyEditorRegistrars'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.apache.cxf.binding.soap.spring.SoapVersionRegistrar] to required type [org.springframework.beans.PropertyEditorRegistrar] for property 'propertyEditorRegistrars[0]': no matching editors or conversion strategy found

ошибка.

Мой jbossws-cxf.xml выглядит так: `

<beans
 xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:beans="http://www.springframework.org/schema/beans"
 xmlns:jaxws="http://cxf.apache.org/jaxws"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd
 http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd">


<bean id="mathBean" class="com.sample.MathWS">
    <constructor-arg value="alabama" />
</bean>


<jaxws:endpoint id="MathWSX" implementor="#mathBean" address="http://localhost:8080/HelloCXF" />

`


person Toskan    schedule 01.02.2012    source источник


Ответы (1)


Я решил проблему. К сожалению - не помню как. И, пожалуйста, простите меня, но я не собираюсь повторять это :-) В основном ответ "да". Для этой конкретной проблемы это может быть проблема с пространством имен, например. правильно было бы

<beans
 xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:beans="http://www.springframework.org/schema/beans"
 xmlns:jaxws="http://cxf.apache.org/jaxws"
 xmlns:util="http://www.springframework.org/schema/util"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/util
 http://www.springframework.org/schema/util/spring-util-2.5.xsd
 http://cxf.apache.org/jaxws
 http://cxf.apache.org/schemas/jaxws.xsd">

Возможно, было также, что были развернуты пользовательские библиотеки Spring (я думаю, что рекомендуется использовать библиотеки Spring, поставляемые с jboss, и развертываются динамически автоматически)

Возможно, это было что-то еще

person Toskan    schedule 24.07.2012