Quantcast

Newbie-question. No bean named 'cfx' is defined.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Newbie-question. No bean named 'cfx' is defined.

thomaslarsson
Hello,

During startup of my application which is just a simple jax-ws service I get the message

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'cxf' is defined

So the obvious question was first if there was a context file within my classpath with a bean named 'cfx'?

My lib directory differs a little from the samples. I build my sample with maven and used the
suggested pom file (building your cfx project with maven) to define my dependencies.
This means my WEB-INF/lib folder contains a whole set of cfx-libs.

But all this aside, sure, there is such a bean defined in the cfx-rt-core-2.0.2-incubator jar
under META-INF/cfx/cfx.xml.

What am I missing here?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

thomaslarsson
I misspelled cxf down below but that was only here in the forum post. The question is still valid.

Here is my CXFServlet definition if its of any value:

        <servlet>
                <servlet-name>cxf</servlet-name>
                <display-name>cxf</display-name>
                <description>Apache CXF Endpoint</description>
                <servlet-class>
                        org.apache.cxf.transport.servlet.CXFServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
                <servlet-name>cxf</servlet-name>
                <url-pattern>/services/*</url-pattern>
        </servlet-mapping>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

Willem2
In reply to this post by thomaslarsson
Hi
Do you use the SpringBusFactory to load the Spring configuration file ?
If not , you need to include the below files to start a soap over http
service.

  <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-extension-http-jetty.xml"/>

Willem.

thomaslarsson wrote:

> Hello,
>
> During startup of my application which is just a simple jax-ws service I get
> the message
>
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
> named 'cxf' is defined
>
> So the obvious question was first if there was a context file within my
> classpath with a bean named 'cfx'?
>
> My lib directory differs a little from the samples. I build my sample with
> maven and used the
> suggested pom file (building your cfx project with maven) to define my
> dependencies.
> This means my WEB-INF/lib folder contains a whole set of cfx-libs.
>
> But all this aside, sure, there is such a bean defined in the
> cfx-rt-core-2.0.2-incubator jar
> under META-INF/cfx/cfx.xml.
>
> What am I missing here?
>
>
>  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

Willem2
In reply to this post by thomaslarsson
Hi

You can take [1] as an example which use the spring to setup the
endpoint information.
[1]  http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

Willem.

thomaslarsson wrote:

> I misspelled cxf down below but that was only here in the forum post. The
> question is still valid.
>
> Here is my CXFServlet definition if its of any value:
>
>         <servlet>
> <servlet-name>cxf</servlet-name>
> <display-name>cxf</display-name>
> <description>Apache CXF Endpoint</description>
> <servlet-class>
> org.apache.cxf.transport.servlet.CXFServlet
> </servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>cxf</servlet-name>
> <url-pattern>/services/*</url-pattern>
> </servlet-mapping>
>
>  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

thomaslarsson
In reply to this post by Willem2

Hi,

Yes, since I am using the CXFServlet I am by default using the SpringBusFactory.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

thomaslarsson
In reply to this post by Willem2

Yea, I see that I missed those import statements now.
The reason why I have been having problems with this is probably that I am trying to
mix the setup shown in the sample java_first_jaxws with an existing spring setup.
The java_first_jaxws sample does not contain any spring context files and just defines
the CXF servlet and the annotated service is picked up and exposed automatically
just as the JAX-WS specification specifies.

Should I take it then that this is not possible if I am already using spring
in a web-app?

Thanks for the quick answers btw



Willem2 wrote
Hi

You can take [1] as an example which use the spring to setup the
endpoint information.
[1]  http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html

Willem.

thomaslarsson wrote:
> I misspelled cxf down below but that was only here in the forum post. The
> question is still valid.
>
> Here is my CXFServlet definition if its of any value:
>
>         <servlet>
> <servlet-name>cxf</servlet-name>
> <display-name>cxf</display-name>
> <description>Apache CXF Endpoint</description>
> <servlet-class>
> org.apache.cxf.transport.servlet.CXFServlet
> </servlet-class>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name>cxf</servlet-name>
> <url-pattern>/services/*</url-pattern>
> </servlet-mapping>
>
>  
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Newbie-question. No bean named 'cfx' is defined.

Glen Mazza-2
What I did for my simple web service[1] might(?) be of help for you.

Glen

[1] http://www.jroller.com/gmazza/date/20071019#step7  (steps 7 and 8)

Am Montag, den 22.10.2007, 00:33 -0700 schrieb thomaslarsson:

>
> Yea, I see that I missed those import statements now.
> The reason why I have been having problems with this is probably that I am
> trying to
> mix the setup shown in the sample java_first_jaxws with an existing spring
> setup.
> The java_first_jaxws sample does not contain any spring context files and
> just defines
> the CXF servlet and the annotated service is picked up and exposed
> automatically
> just as the JAX-WS specification specifies.
>
> Should I take it then that this is not possible if I am already using spring
> in a web-app?
>
> Thanks for the quick answers btw
>
>


Loading...