Try moving the <import>s to the top of your Spring config file. I know the order of definition of Spring beans isn't supposed to matter, but in the case of CXF the bus dependency is handled by the XML parsing code rather than by a separate BeanFactoryPostProcessor or similar, so the bus definition (in one of the imported files) needs to be processed before the jaxws:endpoint.

I've been meaning to submit a JIRA about this but never got around to it, this may be the prod I needed...

Ian

bjornharvold wrote:
Hi Leo,

I am getting a similar error and I have been scouring the forums to find
someone with the same problem.

I grabbed the cxf v2.1 source and did a test with their spring hello world
example. I included all the included dependencies in my test project but
upgraded Spring to the latest v2.5.4.

The hello world test runs fine when the implementor is set to just the class
but not the Spring hello world bean. When I use the #helloWorldBean I get
this error: (I put the real error in bold). At the bottom I have included
the spring xml, and the hello world example classes as well.

Here's the spring xml:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2007, Health XCEL Inc. All Rights Reserved.
  -->
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:aop="http://www.springframework.org/schema/aop";
       xmlns:util="http://www.springframework.org/schema/util";
       xmlns:jee="http://www.springframework.org/schema/jee";
       xmlns:lang="http://www.springframework.org/schema/lang";
       xmlns:tool="http://www.springframework.org/schema/tool";
       xmlns:tx="http://www.springframework.org/schema/tx";
       xmlns:jms="http://www.springframework.org/schema/jms";
       xmlns:context="http://www.springframework.org/schema/context";
       xmlns:jaxws="http://cxf.apache.org/jaxws";
       xmlns:cxf="http://cxf.apache.org/core";
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
                           http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd
                           http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-util-2.5.xsd
                           http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
                           http://www.springframework.org/schema/tool
http://www.springframework.org/schema/tool/spring-tool-2.5.xsd
                           http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
                           http://www.springframework.org/schema/jms
http://www.springframework.org/schema/jms/spring-jms-2.5.xsd
                           http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
                           http://cxf.apache.org/jaxws
                           http://cxf.apache.org/schemas/jaxws.xsd
                           http://cxf.apache.org/core
                           http://cxf.apache.org/schemas/core.xsd";>
    <!-- ============================== WEB SERVICE END
POINT============================== -->
    <!-- this does not work -->
    <jaxws:endpoint
      id="helloWorld"
      implementor="#testWebService"
      address="http://localhost:8080/HelloWorld"; />
<!-- this works -->
    <!--<jaxws:endpoint
      id="helloWorld"
      implementor="test.HellowWorldImpl"
      address="http://localhost:8080/HelloWorld"; />-->

    <!-- ============================== WEB SERVICE END
POINT============================== -->

    <!-- ============================== WEB SERVICE
============================== -->
    <bean id="testWebService" class="test.HelloWorldImpl"/>
    <!-- ============================== WEB SERVICE
============================== -->

    <!-- now we can make use of the new Spring 2.5 annotation features -->
    <context:annotation-config/>

    <!-- required cxf ws imports -->
    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
</beans>


--
Ian Roberts               | Department of Computer Science
[EMAIL PROTECTED]  | University of Sheffield, UK

Reply via email to