You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by callum <ca...@hotmail.com> on 2008/03/12 14:34:37 UTC

Re: Can use cxf proxy outside cxf-se container?

I needed to use the cxf proxy within a BeanComponent service unit, and
followed the pattern in the CxfSeComponent and Jsr181Component for making
the ComponentContext available (as suggested by Guillaume).

I can confirm it works.  The patch is attached to SM-1271.  Obviously it
would better if the functionality was centralized somewhere, but this
approach got me moving again.

Regards,
Callum


rgavlin wrote:
> 
> Thanks.
> 
> - Ron
> 
> 
> gnodet wrote:
>> 
>> https://issues.apache.org/activemq/browse/SM-1243
>> 
>> As I said, we should make the #context available in all components
>> and make jsr181 / bean / cxf-se more homogeneous wrt to pojo injection,
>> but that's a different issue.
>> 
>> On Wed, Feb 27, 2008 at 2:30 PM, rgavlin <rg...@yahoo.com> wrote:
>>>
>>>  Hi Guillaume,
>>>
>>>  Is there a JIRA for this issue that references your committed patch? I
>>> am
>>>  interested in seeing how the problem was resolved.
>>>
>>>  Thanks,
>>>
>>>  - Ron
>>>
>>>
>>>
>>>
>>>  gnodet wrote:
>>>  >
>>>  > Well, it seems the proxy factory can accept other ways
>>>  > to pass the context but due to a bug, these are not used at all.
>>>  > Unfortunately, there is a small bug which prevents this use.
>>>  > I've just fixed it so could you try building a snapshot of the cxf-se
>>>  > component, install it, and try again using without the
>>>  >    context="#context"
>>>  > attribute at all ?
>>>  >
>>>  > On Thu, Feb 21, 2008 at 11:50 PM, Garry <gm...@hotmail.com> wrote:
>>>  >>
>>>  >>  Well, I can only agree with you guys that consistency
>>>  >>  across the proxies would be great. I'm sure I don't
>>>  >>  understand all the issues involved, but it would be
>>>  >>  most convenient if the proxy context-injection
>>>  >>  happened automatically and the user didn't have to
>>>  >>  configure it at all.
>>>  >>
>>>  >>  I'm getting my cxf-se information from this document
>>>  >>  http://servicemix.apache.org/servicemix-cxf-se.html.
>>>  >>  It says:
>>>  >>
>>>  >>   You can use it from one of you client bean, or from
>>>  >>   inside another component, and call the JBI endpoint
>>>  >>   as a plain Java object.
>>>  >>
>>>  >>   From a cxfse Service Unit, it could be used as
>>>  >>   following: ...
>>>  >>
>>>  >>  which lead me to believe the example would work
>>>  >>  equally well (without change) in a non-cxfse container.
>>>  >>  Perhaps you could add a sentence making it clear the
>>>  >>  technique shown in the example works *only* in the
>>>  >>  cxf-se component?  Might save the next person some
>>>  >>  time ...
>>>  >>
>>>  >>  Thanks, Garry
>>>  >>
>>>  >>
>>>  >>
>>>  >>
>>>  >>
>>>  >>  bsnyder wrote:
>>>  >>  >
>>>  >>  > On Thu, Feb 21, 2008 at 10:18 AM, Guillaume Nodet
>>> <gn...@gmail.com>
>>>  >>  > wrote:
>>>  >>  >> 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.
>>>  >>  >
>>>  >>  > Yeah it would be a nicer solution if we could do this for all
>>>  >>  > components so that it's consistent and not implemented in many
>>> places.
>>>  >>  >
>>>  >>  > Bruce
>>>  >>  > --
>>>  >>  > perl -e 'print
>>>  >>  >
>>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>>  >>  > );'
>>>  >>  >
>>>  >>  > Apache ActiveMQ - http://activemq.org/
>>>  >>  > Apache Camel - http://activemq.org/camel/
>>>  >>  > Apache ServiceMix - http://servicemix.org/
>>>  >>  > Apache Geronimo - http://geronimo.apache.org/
>>>  >>  >
>>>  >>  > Blog: http://bruceblog.org/
>>>  >>  >
>>>  >>  >
>>>  >>
>>>  >>  --
>>>  >>  View this message in context:
>>>  >>
>>> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15622032.html
>>>  >>
>>>  >>
>>>  >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>  >>
>>>  >>
>>>  >
>>>  >
>>>  >
>>>  > --
>>>  > Cheers,
>>>  > Guillaume Nodet
>>>  > ------------------------
>>>  > Blog: http://gnodet.blogspot.com/
>>>  >
>>>  >
>>>
>>>  --
>>>  View this message in context:
>>> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15713239.html
>>>
>>>
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> 
>> -- 
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p16002314.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Can use cxf proxy outside cxf-se container?

Posted by Guillaume Nodet <gn...@gmail.com>.
In your service unit, you need to add a reference to servicemix-cxf-se
classloader.
Look at
http://servicemix.apache.org/classloaders.html#Classloaders-NewinServiceMix3.2
Add the following at the top of your xbean.xml

  <classpath>
    <component>servicemix-cxf-se</component>
  </classpath>



On Thu, Apr 10, 2008 at 11:36 AM, Sebastian Gomez <sa...@gmail.com> wrote:

> Hi.
>
> It looks like this problem is resolved, but I can't get it working.
> I'm trying to call the cxf-se endpoint from servicemix-bean. I've had
> a look at the examples but I haven't seen any that declare the proxy
> in the xbean of the servicemix-bean. I've tried doing
>
>               <bean:endpoint service="Z:X" endpoint="X" bean="#X">
>        </bean:endpoint>
>
>                <bean id="X" class="aaa.bbb.ccc.D">
>                <property name="Y">
>                        <cxfse:proxy service="test:Z" type =
> "aaa.bbb.ccc.E"/>
>                </property>
>        </bean>
>
> having the service declared on a servicemix-cxf-bc SU, but the problem
> comes when I have to declare both the bean and the cxfse namespaces. I
> get the following exception:
>
> Bean 'X'; nested exception is org.springframework.beans.factory.BeanDefini
> tionStoreException: Unrecognized xbean namespace mapping:
> http://servicemix.apac
> he.org/cxfse/1.0</loc-message>
>
> Any idea of what I am incorrectly?
>
> Thanks in advance.
>
> Sebastian Gomez.
>
> On Wed, Mar 12, 2008 at 4:07 PM, Freeman Fang <fr...@gmail.com>
> wrote:
> > Hi Callum,
> >
> > Thanks, I will take care of this patch.
> >
> > Regards
> >
> > Freeman
> >
> >
> >
> > callum wrote:
> > > I needed to use the cxf proxy within a BeanComponent service unit, and
> > > followed the pattern in the CxfSeComponent and Jsr181Component for
> making
> > > the ComponentContext available (as suggested by Guillaume).
> > >
> > > I can confirm it works.  The patch is attached to SM-1271.  Obviously
> it
> > > would better if the functionality was centralized somewhere, but this
> > > approach got me moving again.
> > >
> > > Regards,
> > > Callum
> > >
> > >
> > > rgavlin wrote:
> > >
> > >
> > > > Thanks.
> > > >
> > > > - Ron
> > > >
> > > >
> > > > gnodet wrote:
> > > >
> > > >
> > > > > https://issues.apache.org/activemq/browse/SM-1243
> > > > >
> > > > > As I said, we should make the #context available in all components
> > > > > and make jsr181 / bean / cxf-se more homogeneous wrt to pojo
> > injection,
> > > > > but that's a different issue.
> > > > >
> > > > > On Wed, Feb 27, 2008 at 2:30 PM, rgavlin <rg...@yahoo.com>
> wrote:
> > > > >
> > > > >
> > > > > >  Hi Guillaume,
> > > > > >
> > > > > >  Is there a JIRA for this issue that references your committed
> > patch? I
> > > > > > am
> > > > > >  interested in seeing how the problem was resolved.
> > > > > >
> > > > > >  Thanks,
> > > > > >
> > > > > >  - Ron
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >  gnodet wrote:
> > > > > >  >
> > > > > >  > Well, it seems the proxy factory can accept other ways
> > > > > >  > to pass the context but due to a bug, these are not used at
> all.
> > > > > >  > Unfortunately, there is a small bug which prevents this use.
> > > > > >  > I've just fixed it so could you try building a snapshot of
> the
> > cxf-se
> > > > > >  > component, install it, and try again using without the
> > > > > >  >    context="#context"
> > > > > >  > attribute at all ?
> > > > > >  >
> > > > > >  > On Thu, Feb 21, 2008 at 11:50 PM, Garry <gm...@hotmail.com>
> > wrote:
> > > > > >  >>
> > > > > >  >>  Well, I can only agree with you guys that consistency
> > > > > >  >>  across the proxies would be great. I'm sure I don't
> > > > > >  >>  understand all the issues involved, but it would be
> > > > > >  >>  most convenient if the proxy context-injection
> > > > > >  >>  happened automatically and the user didn't have to
> > > > > >  >>  configure it at all.
> > > > > >  >>
> > > > > >  >>  I'm getting my cxf-se information from this document
> > > > > >  >>  http://servicemix.apache.org/servicemix-cxf-se.html.
> > > > > >  >>  It says:
> > > > > >  >>
> > > > > >  >>   You can use it from one of you client bean, or from
> > > > > >  >>   inside another component, and call the JBI endpoint
> > > > > >  >>   as a plain Java object.
> > > > > >  >>
> > > > > >  >>   From a cxfse Service Unit, it could be used as
> > > > > >  >>   following: ...
> > > > > >  >>
> > > > > >  >>  which lead me to believe the example would work
> > > > > >  >>  equally well (without change) in a non-cxfse container.
> > > > > >  >>  Perhaps you could add a sentence making it clear the
> > > > > >  >>  technique shown in the example works *only* in the
> > > > > >  >>  cxf-se component?  Might save the next person some
> > > > > >  >>  time ...
> > > > > >  >>
> > > > > >  >>  Thanks, Garry
> > > > > >  >>
> > > > > >  >>
> > > > > >  >>
> > > > > >  >>
> > > > > >  >>
> > > > > >  >>  bsnyder wrote:
> > > > > >  >>  >
> > > > > >  >>  > On Thu, Feb 21, 2008 at 10:18 AM, Guillaume Nodet
> > > > > > <gn...@gmail.com>
> > > > > >  >>  > wrote:
> > > > > >  >>  >> 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.
> > > > > >  >>  >
> > > > > >  >>  > Yeah it would be a nicer solution if we could do this for
> all
> > > > > >  >>  > components so that it's consistent and not implemented in
> > many
> > > > > > places.
> > > > > >  >>  >
> > > > > >  >>  > Bruce
> > > > > >  >>  > --
> > > > > >  >>  > perl -e 'print
> > > > > >  >>  >
> > > > > >
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> > > > > >  >>  > );'
> > > > > >  >>  >
> > > > > >  >>  > Apache ActiveMQ - http://activemq.org/
> > > > > >  >>  > Apache Camel - http://activemq.org/camel/
> > > > > >  >>  > Apache ServiceMix - http://servicemix.org/
> > > > > >  >>  > Apache Geronimo - http://geronimo.apache.org/
> > > > > >  >>  >
> > > > > >  >>  > Blog: http://bruceblog.org/
> > > > > >  >>  >
> > > > > >  >>  >
> > > > > >  >>
> > > > > >  >>  --
> > > > > >  >>  View this message in context:
> > > > > >  >>
> > > > > >
> >
> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15622032.html
> > > > > >  >>
> > > > > >  >>
> > > > > >  >> Sent from the ServiceMix - User mailing list archive at
> > Nabble.com.
> > > > > >  >>
> > > > > >  >>
> > > > > >  >
> > > > > >  >
> > > > > >  >
> > > > > >  > --
> > > > > >  > Cheers,
> > > > > >  > Guillaume Nodet
> > > > > >  > ------------------------
> > > > > >  > Blog: http://gnodet.blogspot.com/
> > > > > >  >
> > > > > >  >
> > > > > >
> > > > > >  --
> > > > > >  View this message in context:
> > > > > >
> >
> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15713239.html
> > > > > >
> > > > > >
> > > > > > Sent from the ServiceMix - User mailing list archive at
> Nabble.com.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > > --
> > > > > Cheers,
> > > > > Guillaume Nodet
> > > > > ------------------------
> > > > > Blog: http://gnodet.blogspot.com/
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Re: Can use cxf proxy outside cxf-se container?

Posted by Sebastian Gomez <sa...@gmail.com>.
Hi.

It looks like this problem is resolved, but I can't get it working.
I'm trying to call the cxf-se endpoint from servicemix-bean. I've had
a look at the examples but I haven't seen any that declare the proxy
in the xbean of the servicemix-bean. I've tried doing

               <bean:endpoint service="Z:X" endpoint="X" bean="#X">
  	</bean:endpoint>
	
                <bean id="X" class="aaa.bbb.ccc.D">
		<property name="Y">
			<cxfse:proxy service="test:Z" type = "aaa.bbb.ccc.E"/>
		</property>
	</bean>

having the service declared on a servicemix-cxf-bc SU, but the problem
comes when I have to declare both the bean and the cxfse namespaces. I
get the following exception:

Bean 'X'; nested exception is org.springframework.beans.factory.BeanDefini
tionStoreException: Unrecognized xbean namespace mapping: http://servicemix.apac
he.org/cxfse/1.0</loc-message>

Any idea of what I am incorrectly?

Thanks in advance.

Sebastian Gomez.

On Wed, Mar 12, 2008 at 4:07 PM, Freeman Fang <fr...@gmail.com> wrote:
> Hi Callum,
>
> Thanks, I will take care of this patch.
>
> Regards
>
> Freeman
>
>
>
> callum wrote:
> > I needed to use the cxf proxy within a BeanComponent service unit, and
> > followed the pattern in the CxfSeComponent and Jsr181Component for making
> > the ComponentContext available (as suggested by Guillaume).
> >
> > I can confirm it works.  The patch is attached to SM-1271.  Obviously it
> > would better if the functionality was centralized somewhere, but this
> > approach got me moving again.
> >
> > Regards,
> > Callum
> >
> >
> > rgavlin wrote:
> >
> >
> > > Thanks.
> > >
> > > - Ron
> > >
> > >
> > > gnodet wrote:
> > >
> > >
> > > > https://issues.apache.org/activemq/browse/SM-1243
> > > >
> > > > As I said, we should make the #context available in all components
> > > > and make jsr181 / bean / cxf-se more homogeneous wrt to pojo
> injection,
> > > > but that's a different issue.
> > > >
> > > > On Wed, Feb 27, 2008 at 2:30 PM, rgavlin <rg...@yahoo.com> wrote:
> > > >
> > > >
> > > > >  Hi Guillaume,
> > > > >
> > > > >  Is there a JIRA for this issue that references your committed
> patch? I
> > > > > am
> > > > >  interested in seeing how the problem was resolved.
> > > > >
> > > > >  Thanks,
> > > > >
> > > > >  - Ron
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >  gnodet wrote:
> > > > >  >
> > > > >  > Well, it seems the proxy factory can accept other ways
> > > > >  > to pass the context but due to a bug, these are not used at all.
> > > > >  > Unfortunately, there is a small bug which prevents this use.
> > > > >  > I've just fixed it so could you try building a snapshot of the
> cxf-se
> > > > >  > component, install it, and try again using without the
> > > > >  >    context="#context"
> > > > >  > attribute at all ?
> > > > >  >
> > > > >  > On Thu, Feb 21, 2008 at 11:50 PM, Garry <gm...@hotmail.com>
> wrote:
> > > > >  >>
> > > > >  >>  Well, I can only agree with you guys that consistency
> > > > >  >>  across the proxies would be great. I'm sure I don't
> > > > >  >>  understand all the issues involved, but it would be
> > > > >  >>  most convenient if the proxy context-injection
> > > > >  >>  happened automatically and the user didn't have to
> > > > >  >>  configure it at all.
> > > > >  >>
> > > > >  >>  I'm getting my cxf-se information from this document
> > > > >  >>  http://servicemix.apache.org/servicemix-cxf-se.html.
> > > > >  >>  It says:
> > > > >  >>
> > > > >  >>   You can use it from one of you client bean, or from
> > > > >  >>   inside another component, and call the JBI endpoint
> > > > >  >>   as a plain Java object.
> > > > >  >>
> > > > >  >>   From a cxfse Service Unit, it could be used as
> > > > >  >>   following: ...
> > > > >  >>
> > > > >  >>  which lead me to believe the example would work
> > > > >  >>  equally well (without change) in a non-cxfse container.
> > > > >  >>  Perhaps you could add a sentence making it clear the
> > > > >  >>  technique shown in the example works *only* in the
> > > > >  >>  cxf-se component?  Might save the next person some
> > > > >  >>  time ...
> > > > >  >>
> > > > >  >>  Thanks, Garry
> > > > >  >>
> > > > >  >>
> > > > >  >>
> > > > >  >>
> > > > >  >>
> > > > >  >>  bsnyder wrote:
> > > > >  >>  >
> > > > >  >>  > On Thu, Feb 21, 2008 at 10:18 AM, Guillaume Nodet
> > > > > <gn...@gmail.com>
> > > > >  >>  > wrote:
> > > > >  >>  >> 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.
> > > > >  >>  >
> > > > >  >>  > Yeah it would be a nicer solution if we could do this for all
> > > > >  >>  > components so that it's consistent and not implemented in
> many
> > > > > places.
> > > > >  >>  >
> > > > >  >>  > Bruce
> > > > >  >>  > --
> > > > >  >>  > perl -e 'print
> > > > >  >>  >
> > > > > unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> > > > >  >>  > );'
> > > > >  >>  >
> > > > >  >>  > Apache ActiveMQ - http://activemq.org/
> > > > >  >>  > Apache Camel - http://activemq.org/camel/
> > > > >  >>  > Apache ServiceMix - http://servicemix.org/
> > > > >  >>  > Apache Geronimo - http://geronimo.apache.org/
> > > > >  >>  >
> > > > >  >>  > Blog: http://bruceblog.org/
> > > > >  >>  >
> > > > >  >>  >
> > > > >  >>
> > > > >  >>  --
> > > > >  >>  View this message in context:
> > > > >  >>
> > > > >
> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15622032.html
> > > > >  >>
> > > > >  >>
> > > > >  >> Sent from the ServiceMix - User mailing list archive at
> Nabble.com.
> > > > >  >>
> > > > >  >>
> > > > >  >
> > > > >  >
> > > > >  >
> > > > >  > --
> > > > >  > Cheers,
> > > > >  > Guillaume Nodet
> > > > >  > ------------------------
> > > > >  > Blog: http://gnodet.blogspot.com/
> > > > >  >
> > > > >  >
> > > > >
> > > > >  --
> > > > >  View this message in context:
> > > > >
> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15713239.html
> > > > >
> > > > >
> > > > > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > > --
> > > > Cheers,
> > > > Guillaume Nodet
> > > > ------------------------
> > > > Blog: http://gnodet.blogspot.com/
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
> >
>
>

Re: Can use cxf proxy outside cxf-se container?

Posted by Freeman Fang <fr...@gmail.com>.
Hi Callum,

Thanks, I will take care of this patch.

Regards

Freeman

callum wrote:
> I needed to use the cxf proxy within a BeanComponent service unit, and
> followed the pattern in the CxfSeComponent and Jsr181Component for making
> the ComponentContext available (as suggested by Guillaume).
>
> I can confirm it works.  The patch is attached to SM-1271.  Obviously it
> would better if the functionality was centralized somewhere, but this
> approach got me moving again.
>
> Regards,
> Callum
>
>
> rgavlin wrote:
>   
>> Thanks.
>>
>> - Ron
>>
>>
>> gnodet wrote:
>>     
>>> https://issues.apache.org/activemq/browse/SM-1243
>>>
>>> As I said, we should make the #context available in all components
>>> and make jsr181 / bean / cxf-se more homogeneous wrt to pojo injection,
>>> but that's a different issue.
>>>
>>> On Wed, Feb 27, 2008 at 2:30 PM, rgavlin <rg...@yahoo.com> wrote:
>>>       
>>>>  Hi Guillaume,
>>>>
>>>>  Is there a JIRA for this issue that references your committed patch? I
>>>> am
>>>>  interested in seeing how the problem was resolved.
>>>>
>>>>  Thanks,
>>>>
>>>>  - Ron
>>>>
>>>>
>>>>
>>>>
>>>>  gnodet wrote:
>>>>  >
>>>>  > Well, it seems the proxy factory can accept other ways
>>>>  > to pass the context but due to a bug, these are not used at all.
>>>>  > Unfortunately, there is a small bug which prevents this use.
>>>>  > I've just fixed it so could you try building a snapshot of the cxf-se
>>>>  > component, install it, and try again using without the
>>>>  >    context="#context"
>>>>  > attribute at all ?
>>>>  >
>>>>  > On Thu, Feb 21, 2008 at 11:50 PM, Garry <gm...@hotmail.com> wrote:
>>>>  >>
>>>>  >>  Well, I can only agree with you guys that consistency
>>>>  >>  across the proxies would be great. I'm sure I don't
>>>>  >>  understand all the issues involved, but it would be
>>>>  >>  most convenient if the proxy context-injection
>>>>  >>  happened automatically and the user didn't have to
>>>>  >>  configure it at all.
>>>>  >>
>>>>  >>  I'm getting my cxf-se information from this document
>>>>  >>  http://servicemix.apache.org/servicemix-cxf-se.html.
>>>>  >>  It says:
>>>>  >>
>>>>  >>   You can use it from one of you client bean, or from
>>>>  >>   inside another component, and call the JBI endpoint
>>>>  >>   as a plain Java object.
>>>>  >>
>>>>  >>   From a cxfse Service Unit, it could be used as
>>>>  >>   following: ...
>>>>  >>
>>>>  >>  which lead me to believe the example would work
>>>>  >>  equally well (without change) in a non-cxfse container.
>>>>  >>  Perhaps you could add a sentence making it clear the
>>>>  >>  technique shown in the example works *only* in the
>>>>  >>  cxf-se component?  Might save the next person some
>>>>  >>  time ...
>>>>  >>
>>>>  >>  Thanks, Garry
>>>>  >>
>>>>  >>
>>>>  >>
>>>>  >>
>>>>  >>
>>>>  >>  bsnyder wrote:
>>>>  >>  >
>>>>  >>  > On Thu, Feb 21, 2008 at 10:18 AM, Guillaume Nodet
>>>> <gn...@gmail.com>
>>>>  >>  > wrote:
>>>>  >>  >> 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.
>>>>  >>  >
>>>>  >>  > Yeah it would be a nicer solution if we could do this for all
>>>>  >>  > components so that it's consistent and not implemented in many
>>>> places.
>>>>  >>  >
>>>>  >>  > Bruce
>>>>  >>  > --
>>>>  >>  > perl -e 'print
>>>>  >>  >
>>>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>>>  >>  > );'
>>>>  >>  >
>>>>  >>  > Apache ActiveMQ - http://activemq.org/
>>>>  >>  > Apache Camel - http://activemq.org/camel/
>>>>  >>  > Apache ServiceMix - http://servicemix.org/
>>>>  >>  > Apache Geronimo - http://geronimo.apache.org/
>>>>  >>  >
>>>>  >>  > Blog: http://bruceblog.org/
>>>>  >>  >
>>>>  >>  >
>>>>  >>
>>>>  >>  --
>>>>  >>  View this message in context:
>>>>  >>
>>>> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15622032.html
>>>>  >>
>>>>  >>
>>>>  >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>  >>
>>>>  >>
>>>>  >
>>>>  >
>>>>  >
>>>>  > --
>>>>  > Cheers,
>>>>  > Guillaume Nodet
>>>>  > ------------------------
>>>>  > Blog: http://gnodet.blogspot.com/
>>>>  >
>>>>  >
>>>>
>>>>  --
>>>>  View this message in context:
>>>> http://www.nabble.com/Can-use-cxf-proxy-outside-cxf-se-container--tp15604370s12049p15713239.html
>>>>
>>>>
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>>         
>>>
>>> -- 
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>>
>>>
>>>       
>>     
>
>