The problem is that the #context bean is not defined in servicemix-bean. We really need to make things a bit easier by having a homogeneous way to set up things in servicemix-bean, servicemix-cxf-se and servicemix-jsr181. It also involves injecting resources into beans, using @PostConstruct and @PreDestroy, etc.
Anyway, to create a context, I'm not sure if there is a simple way currently but to create a spring factory bean that could create a valid one. Imho, it would be better to fix the #context problem instead. Look at how this is done in jsr181 or cxf-se: http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181XBeanDeployer.java?view=markup http://svn.apache.org/viewvc/servicemix/smx3/trunk/deployables/serviceengines/servicemix-cxf-se/src/main/java/org/apache/servicemix/cxfse/CxfSeXBeanDeployer.java?revision=602826&view=markup It should be easy to do the same in servicemix-bean, and even have a single class to do that, or even do that for all components. On Thu, Feb 21, 2008 at 5:57 PM, Garry <[EMAIL PROTECTED]> wrote: > > Hi, > > Here's my xbean.xml file deployed to the bean-se container; it > attempts to define a pojo with a member named "proxy" that I > want injected with a CXF proxy to the web service 'PersonService': > > > <?xml version="1.0" encoding="UTF-8"?> > <beans xmlns:bean="http://servicemix.apache.org/bean/1.0" > xmlns:person="http://servicemix.apache.org/samples/wsdl-first" > xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"> > > <bean:endpoint service="person:PersonService2" > endpoint="person:Person" > bean="#myBean" /> > > <bean id="myBean" > class="org.apache.servicemix.samples.cxf_wsdl_first.MyBean"> > > <property name="proxy"> > <cxfse:proxy service="person:PersonService" > context="#context" > type="org.apache.servicemix.samples.wsdl_first.Person" /> > </property> > > </bean> > > <classpath> > <component>servicemix-bean</component> > <component>servicemix-cxf-se</component> > <classpath> > </beans> > > > My POJO bean is defined like this: > > public class MyBean implements MessageExchangeListener > > and contains no annotations of any kind; it's just a pojo. > > On deployment to SMX, I get the following error: > > Cannot resolve reference to bean 'context' while setting > bean property 'context'; nested exception is > org.springframework.beans.factory.NoSuchBeanDefinitionException: > No bean named 'context' is defined. > > > The reference to '#context" does, however, resolve correctly > when made inside an xbean deployed to the cxf-se container. > What do I need to do to get CXF proxy working inside the > bean container? > > Thanks, Garry > > > > > Garry wrote: > > > > Hi, > > > > I can use the jsr-181 proxy in a bean SU but seem unable to use the > > cxf proxy outside the cxf-se container. When I try, the '#context" > > proxy dependency injection fails with a Spring "can't find referenced > > bean" error. Works just fine inside the cxf-se container, however. I > > want to confirm that is the case. Is it possible to use cxf proxy in a > > bean SU? Example? > > > > Thanks, Garry > > > > > > > > -- > View this message in context: > http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15614266.html > > > Sent from the ServiceMix - User mailing list archive at Nabble.com. > > -- Cheers, Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/
