You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "ilya.sterin" <st...@gmail.com> on 2009/03/21 20:52:42 UTC
Bug in Jsr250BeanPostProcessor?
For my service I have defined multiple bindings, soap and xml as ...
<jaxws:endpoint id="rfdFormArchiver" implementor="#formArchiverImpl"
address="/soap/RFDFormArchiver"
serviceName="s:RFDFormArchiver_Service"
endpointName="s:RFDFormArchiver_Port"
xmlns:s="urn:ihe:iti:rfd:2007"
bindingUri="http://schemas.xmlsoap.org/soap/"
wsdlLocation="classpath:/RFDFormArchiver.wsdl"/>
<jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
address="/xml/RFDFormArchiver"
bindingUri="http://cxf.apache.org/bindings/xformat">
because we also support wsa, I have...
<cxf:bus>
<cxf:features>
<wsa:addressing
xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
</cxf:features>
</cxf:bus>
I've noticed that when addressing is enabled in the bus, the xml binding
fails with a cast exception. So I figured it was expecting some addressing
definitions in the xml post and the easiest way to resolve would be to just
define a different bus for the xml endpoint.
So I tried...
<cxf:bus name="xmlBus"/>
and then use this name as...
<jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
address="/xml/RFDFormArchiver"
bindingUri="http://cxf.apache.org/bindings/xformat"
bus="xmlBus">
I'm first not sure if this will even work, but before I can even get to
testing it, I get an exception during startup.
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor': Injection of
resource methods failed; nested exception is
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique
bean of type [org.apache.cxf.Bus] is defined: expected single matching bean
but found 2: [cxf, addrBus]
This is because the Jsr250BeanPostProcessor bean is using @Resource without
specifying it's name as "cxf", which is the default cxf bus.
First, am I doing anything out of the ordinary, meaning, can you not have 2
busses that are bound to two different endpoints?
And if so, how would I got about doing this, being that the current release
is preventing me from defining multiple busses. Is there a way I can embed
a bus definition inside the jaxws:endpoint definition?
Thanks.
Ilya
--
View this message in context: http://www.nabble.com/Bug-in-Jsr250BeanPostProcessor--tp22639711p22639711.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Bug in Jsr250BeanPostProcessor?
Posted by Ilya Sterin <st...@gmail.com>.
Daniel, thanks, that's what I did. It works and does it's just. I
still think that doing autowiring in spring is not the best idea,
especially if you want other defining same beans of a particular type.
I might be wrong though, the intention might be to prevent someone
from defining multiple buses.
Thanks for the response.
Ilya
On Mon, Mar 23, 2009 at 5:12 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> I'm 99.9% positive that doing a separate bus in the same spring context won't
> work. You should be able to do it with separate spring contexts, but I'm not
> sure how easy that is to do with your application.
>
> That said, the easiest way to go about this is NOT to enable ws-addressing on
> the bus, but instead enable it on the jaxws:endpoint itself for the services
> you DO want it enabled on:
>
> <jaxws:endpoint id="rfdFormArchiver" implementor="#formArchiverImpl"
> address="/soap/RFDFormArchiver"
> serviceName="s:RFDFormArchiver_Service"
> endpointName="s:RFDFormArchiver_Port"
> xmlns:s="urn:ihe:iti:rfd:2007"
> bindingUri="http://schemas.xmlsoap.org/soap/"
> wsdlLocation="classpath:/RFDFormArchiver.wsdl">
>
> <jaxws:features>
> <wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
> </jaxws:features>
> </jaxws:endpoint>
>
>
> Dan
>
>
> On Sat March 21 2009 3:52:42 pm ilya.sterin wrote:
>> For my service I have defined multiple bindings, soap and xml as ...
>>
>> <jaxws:endpoint id="rfdFormArchiver" implementor="#formArchiverImpl"
>> address="/soap/RFDFormArchiver"
>> serviceName="s:RFDFormArchiver_Service"
>> endpointName="s:RFDFormArchiver_Port"
>> xmlns:s="urn:ihe:iti:rfd:2007"
>> bindingUri="http://schemas.xmlsoap.org/soap/"
>> wsdlLocation="classpath:/RFDFormArchiver.wsdl"/>
>> <jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
>> address="/xml/RFDFormArchiver"
>> bindingUri="http://cxf.apache.org/bindings/xformat">
>>
>> because we also support wsa, I have...
>>
>> <cxf:bus>
>> <cxf:features>
>> <wsa:addressing
>> xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
>> </cxf:features>
>> </cxf:bus>
>>
>> I've noticed that when addressing is enabled in the bus, the xml binding
>> fails with a cast exception. So I figured it was expecting some addressing
>> definitions in the xml post and the easiest way to resolve would be to just
>> define a different bus for the xml endpoint.
>>
>> So I tried...
>>
>> <cxf:bus name="xmlBus"/>
>>
>> and then use this name as...
>>
>> <jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
>> address="/xml/RFDFormArchiver"
>> bindingUri="http://cxf.apache.org/bindings/xformat"
>> bus="xmlBus">
>>
>> I'm first not sure if this will even work, but before I can even get to
>> testing it, I get an exception during startup.
>>
>> org.springframework.beans.factory.BeanCreationException: Error creating
>> bean with name 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor':
>> Injection of resource methods failed; nested exception is
>> org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique
>> bean of type [org.apache.cxf.Bus] is defined: expected single matching bean
>> but found 2: [cxf, addrBus]
>>
>>
>> This is because the Jsr250BeanPostProcessor bean is using @Resource without
>> specifying it's name as "cxf", which is the default cxf bus.
>>
>> First, am I doing anything out of the ordinary, meaning, can you not have 2
>> busses that are bound to two different endpoints?
>>
>> And if so, how would I got about doing this, being that the current release
>> is preventing me from defining multiple busses. Is there a way I can embed
>> a bus definition inside the jaxws:endpoint definition?
>>
>> Thanks.
>>
>> Ilya
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
Re: Bug in Jsr250BeanPostProcessor?
Posted by Daniel Kulp <dk...@apache.org>.
I'm 99.9% positive that doing a separate bus in the same spring context won't
work. You should be able to do it with separate spring contexts, but I'm not
sure how easy that is to do with your application.
That said, the easiest way to go about this is NOT to enable ws-addressing on
the bus, but instead enable it on the jaxws:endpoint itself for the services
you DO want it enabled on:
<jaxws:endpoint id="rfdFormArchiver" implementor="#formArchiverImpl"
address="/soap/RFDFormArchiver"
serviceName="s:RFDFormArchiver_Service"
endpointName="s:RFDFormArchiver_Port"
xmlns:s="urn:ihe:iti:rfd:2007"
bindingUri="http://schemas.xmlsoap.org/soap/"
wsdlLocation="classpath:/RFDFormArchiver.wsdl">
<jaxws:features>
<wsa:addressing xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
</jaxws:features>
</jaxws:endpoint>
Dan
On Sat March 21 2009 3:52:42 pm ilya.sterin wrote:
> For my service I have defined multiple bindings, soap and xml as ...
>
> <jaxws:endpoint id="rfdFormArchiver" implementor="#formArchiverImpl"
> address="/soap/RFDFormArchiver"
> serviceName="s:RFDFormArchiver_Service"
> endpointName="s:RFDFormArchiver_Port"
> xmlns:s="urn:ihe:iti:rfd:2007"
> bindingUri="http://schemas.xmlsoap.org/soap/"
> wsdlLocation="classpath:/RFDFormArchiver.wsdl"/>
> <jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
> address="/xml/RFDFormArchiver"
> bindingUri="http://cxf.apache.org/bindings/xformat">
>
> because we also support wsa, I have...
>
> <cxf:bus>
> <cxf:features>
> <wsa:addressing
> xmlns:wsa="http://cxf.apache.org/ws/addressing"/>
> </cxf:features>
> </cxf:bus>
>
> I've noticed that when addressing is enabled in the bus, the xml binding
> fails with a cast exception. So I figured it was expecting some addressing
> definitions in the xml post and the easiest way to resolve would be to just
> define a different bus for the xml endpoint.
>
> So I tried...
>
> <cxf:bus name="xmlBus"/>
>
> and then use this name as...
>
> <jaxws:endpoint id="rfdFormArchiverXml" implementor="#formArchiverImpl"
> address="/xml/RFDFormArchiver"
> bindingUri="http://cxf.apache.org/bindings/xformat"
> bus="xmlBus">
>
> I'm first not sure if this will even work, but before I can even get to
> testing it, I get an exception during startup.
>
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor':
> Injection of resource methods failed; nested exception is
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique
> bean of type [org.apache.cxf.Bus] is defined: expected single matching bean
> but found 2: [cxf, addrBus]
>
>
> This is because the Jsr250BeanPostProcessor bean is using @Resource without
> specifying it's name as "cxf", which is the default cxf bus.
>
> First, am I doing anything out of the ordinary, meaning, can you not have 2
> busses that are bound to two different endpoints?
>
> And if so, how would I got about doing this, being that the current release
> is preventing me from defining multiple busses. Is there a way I can embed
> a bus definition inside the jaxws:endpoint definition?
>
> Thanks.
>
> Ilya
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog