You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by thomaslarsson <th...@gmail.com> on 2007/10/22 08:35:43 UTC

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

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?


-- 
View this message in context: http://www.nabble.com/Newbie-question.-No-bean-named-%27cfx%27-is-defined.-tf4668972.html#a13337555
Sent from the cxf-user mailing list archive at Nabble.com.


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

Posted by Glen Mazza <gl...@verizon.net>.
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
> 
> 



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

Posted by thomaslarsson <th...@gmail.com>.

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>
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbie-question.-No-bean-named-%27cfx%27-is-defined.-tf4668972.html#a13338056
Sent from the cxf-user mailing list archive at Nabble.com.


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

Posted by Willem Jiang <ni...@iona.com>.
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>
>
>   

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

Posted by thomaslarsson <th...@gmail.com>.
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>

-- 
View this message in context: http://www.nabble.com/Newbie-question.-No-bean-named-%27cfx%27-is-defined.-tf4668972.html#a13337556
Sent from the cxf-user mailing list archive at Nabble.com.


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

Posted by thomaslarsson <th...@gmail.com>.

Hi,

Yes, since I am using the CXFServlet I am by default using the
SpringBusFactory.

-- 
View this message in context: http://www.nabble.com/Newbie-question.-No-bean-named-%27cfx%27-is-defined.-tf4668972.html#a13337689
Sent from the cxf-user mailing list archive at Nabble.com.


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

Posted by Willem Jiang <ni...@iona.com>.
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?
>
>
>