在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

View: New views
5 Messages — Rating Filter:   Alert me  

在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

by yqayaoyao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<bean id="incAffirmanceService"
class="com.inc.wapaffirmance.webservice.AffirmanceServiceImpl">
                <property name="dao" ref="incWapTelecomAffirmanceDaoImpl"></
property>
        </bean>
        <jaxws:endpoint id="incWSAffirmanceService"
                implementor="#incAffirmanceService"
                address="/incAffirmanceService">
        </jaxws:endpoint>
这个类中有个属性wsContext
@Resource
        private WebServiceContext wsContext;


这种方式是不能启动的,原因是spring在装配时不能发现cxf容器中的WebServiceContext的实例,这问题如何解决.
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: 在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

by willem.jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

WebServiceContext 是由CXF 负责注入的。
你可以试着把Spring 的 annotation injection 功能关闭再跑一下。

姜宁 (Willem)
------------------
Apache CXF, Apache Camel committer
http://willemjiang.blogspot.com/

On 8月4日, 下午5时57分, yqayaoyao <yqayao...@...> wrote:

> <bean id="incAffirmanceService"
> class="com.inc.wapaffirmance.webservice.AffirmanceServiceImpl">
>                 <property name="dao" ref="incWapTelecomAffirmanceDaoImpl"></
> property>
>         </bean>
>         <jaxws:endpoint id="incWSAffirmanceService"
>                 implementor="#incAffirmanceService"
>                 address="/incAffirmanceService">
>         </jaxws:endpoint>
> 这个类中有个属性wsContext
> @Resource
>         private WebServiceContext wsContext;
>
> 这种方式是不能启动的,原因是spring在装配时不能发现cxf容器中的WebServiceContext的实例,这问题如何解决.
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: 在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

by yqayaoyao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

但是incWapTelecomAffirmanceDaoImpl是用service
("incWapTelecomAffirmanceDaoImpl")进行实例化的,如果关闭同样会出错
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: 在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

by willem.jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

哪这就不好办了。
因为Spring也实现了JSR 250 中的有关@Resource 功能, 只是WebServiceContext的实例只能从CXF中获得。

你试一下能不能用其他方式实例化 incWapTelecomAffirmanceDaoImpl

姜宁 (Willem)
------------------
Apache CXF, Apache Camel committer
http://willemjiang.blogspot.com/
http://www.fusesource.org

On 8月5日, 上午9时05分, yqayaoyao <yqayao...@...> wrote:
> 但是incWapTelecomAffirmanceDaoImpl是用service
> ("incWapTelecomAffirmanceDaoImpl")进行实例化的,如果关闭同样会出错
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---


Re: 在cxf web service类中同时注入spring bean和javax.xml.ws.WebServiceContext

by willem.jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

这个问题有解决方法了, 最近DanKulp 回答这方面问题[1].

[1] http://www.nabble.com/Porblem-injecting-the-WebServiceContext-into-Spring-bean-td24951419.html

姜宁 (Willem)
------------------
Apache CXF, Apache Camel committer
http://willemjiang.blogspot.com/
http://www.fusesource.org

On 8月5日, 上午9时52分, 姜宁 <willem.ji...@...> wrote:

> 哪这就不好办了。
> 因为Spring也实现了JSR 250 中的有关@Resource 功能, 只是WebServiceContext的实例只能从CXF中获得。
>
> 你试一下能不能用其他方式实例化 incWapTelecomAffirmanceDaoImpl
>
> 姜宁 (Willem)
> ------------------
> Apache CXF, Apache Camel committerhttp://willemjiang.blogspot.com/http://www.fusesource.org
>
> On 8月5日, 上午9时05分, yqayaoyao <yqayao...@...> wrote:
>
>
>
> > 但是incWapTelecomAffirmanceDaoImpl是用service
> > ("incWapTelecomAffirmanceDaoImpl")进行实例化的,如果关闭同样会出错
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“cxf-zh”论坛。
 要在此论坛发帖,请发电子邮件到 cxf-zh@...
 要退订此论坛,请发邮件至 cxf-zh-unsubscribe@...
 更多选项,请通过 http://groups.google.com/group/cxf-zh?hl=zh-CN 访问该论坛
----
Apache CXF 首页 http://cwiki.apache.org/confluence/display/CXF/Index
-~----------~----~----~----~------~----~------~--~---