Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7567961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:48:06+00:00 2026-05-30T14:48:06+00:00

Does somebody know how to integrate the cxf framework without using the cxf plugin?

  • 0

Does somebody know how to integrate the cxf framework without using the cxf plugin? I have already published a simple service, but my problem is to inject existing grails service bean in the cxf jaxws bean.

In applicationContext.xml i’m using following definition

<jaxws:server id="jaxwsService" serviceClass="at.pdts.cxf.HelloWorld" address="/hello">
    <jaxws:serviceBean>
        <bean class="at.pdts.cxf.HelloWorldImpl">
            <property name="halloService"><ref bean="helloWorld"></ref></property>
        </bean>
    </jaxws:serviceBean>
  </jaxws:server>

The helloWorld bean is a normal grails serivce class. During startup i get following exception.

Cannot resolve reference to bean ‘helloWorld’ while setting bean
property ‘halloService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘helloWorld’ is defined

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xsi:schemaLocation="
            http://cxf.apache.org/jaxws
            http://cxf.apache.org/schemas/jaxws.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>


    <bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
        <description>Grails application factory bean</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="grailsResourceLoader" ref="grailsResourceLoader" />
    </bean>

    <bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
        <description>A bean that manages Grails plugins</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="application" ref="grailsApplication" />
    </bean>

    <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
        <constructor-arg>
            <ref bean="grailsApplication" />
        </constructor-arg>
        <property name="pluginManager" ref="pluginManager" />
    </bean>

    <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean">
        <property name="grailsResourceHolder" ref="grailsResourceHolder" />
    </bean>

    <bean id="grailsResourceHolder" scope="prototype" class="org.codehaus.groovy.grails.commons.spring.GrailsResourceHolder">
        <property name="resources">
              <value>classpath*:**/grails-app/**/*.groovy</value>
        </property>
    </bean>    

   <bean id="characterEncodingFilter"
      class="org.springframework.web.filter.CharacterEncodingFilter">
        <property name="encoding">
          <value>utf-8</value>
        </property>
   </bean>

    <jaxws:server id="jaxwsService" serviceClass="at.pdts.cxf.HelloWorld" address="/hello">
    <jaxws:serviceBean>
        <bean class="at.pdts.cxf.HelloWorldImpl">
            <property name="halloService"><ref bean="halloService"></ref></property>
        </bean>
    </jaxws:serviceBean>
  </jaxws:server>

</beans>    

HelloWorldImpl.groovy

package at.pdts.cxf

import javax.jws.WebService

@WebService(endpointInterface = "at.pdts.cxf.HelloWorld")
public class HelloWorldImpl implements HelloWorld {

    def halloService // inject HelloService. Initialize this bean via applicationContext.xml

    public String sayHi(String text) {
        return "hello " + halloService.scream(text)
    }
}

HelloService.groovy

class HalloService implements InitializingBean{

static transactional = false

String scream(String text) {
    text.toUpperCase()
}

// methods gets not called, so service bean is not initialized at the ws creation time
void afterPropertiesSet() {

   println "------> initializing bean HalloSerivce <--------
}

}

It seems that at the moment of the jaxwsService initialization the helloWorld service bean is not available.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T14:48:08+00:00Added an answer on May 30, 2026 at 2:48 pm

    I missed this the first time I read your question but you are defining your bean in applicationContext.xml. When I was making a test case for your question, I was putting my bean definition in grails-app/conf/spring/resources.xml. Try creating that file and putting the following into it:

    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:lang="http://www.springframework.org/schema/lang"
        xmlns:jaxws="http://cxf.apache.org/jaxws"
        xsi:schemaLocation="
            http://cxf.apache.org/jaxws
            http://cxf.apache.org/schemas/jaxws.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
    
        <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" />
    
        <!--create the bean for the service, link to groovy service bean -->
        <jaxws:server id="jaxwsService" serviceClass="at.pdts.cxf.HelloWorld" address="/hello">
            <jaxws:serviceBean>
                <bean class="at.pdts.cxf.HelloWorldImpl">
                    <property name="halloService" ref="halloService" />
                </bean>
            </jaxws:serviceBean>
        </jaxws:server>
    </beans>
    

    As a side note, you can find more information about integrating Grails and CXF here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does somebody know, how to set up Aptana, to have only one .metadata setting
Supposed I have a file with Perl-code: does somebody know, if there is a
Does somebody know a module, which has a function that returns ( for example
does somebody tested - will authlogic works with oauth-plugin ( https://github.com/pelle/oauth-plugin ) or not?
Does somebody has an idea?? I've been googling it but didnt found so much
Does anybody have any experience with TFS no longer letting somebody queue a new
Does somebody know a script that is able to convert a string to a
Does somebody know a quick and easy explode() like function that can ignore splitter
Under Hudson, does somebody know how to specify a release tag name in a
does somebody know, why the argparse module didn't make it in python 3? it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.