新人求助!

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

新人求助!

by cl-12 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


我们项目组刚刚开始使用CXF,我使用的相关版本是:
cxf :2.2.3
spring: 2.
我们要做的是这样一个流程,A 请求B的WebService然后B去调用C的WebService.
现在发现每当调用C的webSevice后有这样的提示:
八月 09 11:52:14,115703 [http-8080-Processor25] WARN
com.wedge.edp.framework.jbpm.config.SpringLocator  - 新的Spring容器引用覆盖原有
SpringLocator的引用
 28 八月 09 11:52:14,115703 [http-8080-Processor25] INFO
com.wedge.edp.framework.jbpm.config.SpringLocator  - Initialize the
reference to spring beanFactory :
org.springframework.beans.factory.support.DefaultListableBeanFactory@2c0d3e:
defining beans
[dataSource,sqlMapClient,jdbcTransactionManager,superDao,cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,SMSWebService,SealKeeperService,proxyFactory,DominoServiceClient,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor,SequenceDao,sequenceService,sessionService,sessionFactory,jbpmConfiguration,processTxAdvice,wedgeWorkflowJbpmService,wedgeWorkflowApplication,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor,org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#1,org.springframework.aop.aspectj.AspectJPointcutAdvisor,errorReportor,workflowContextAdvice,processApp,workflowTemplate,processDao,orgEngine,UserInfoDao,userInfoService,OperatorInfoDao,EmpLoyeeInfoDao,userMgrService,OrgInfoDao,orgInfoService,RoleInfoDao,MenuInfoDao,roleInfoService,DictTypeDao,DictEntryDao,dictTypeService,menuInfoService,LoginMgrDao,loginMgrService,personalInfoDao,personalOpInfoDao,personalService];
root of factory hierarchy
 这样我想肯定是不对的,请问这种问题应该怎么解决?
我的spring_beans:applicationContext如下:
    <jaxws:server id="SMSWebService"
serviceClass="com.wedge.edp.webService.SMSWebService"  address="/
SealKeeper">
    <jaxws:serviceBean>
    <ref bean="SealKeeperService"/><!-- 要暴露的 bean 的引用 -->
    </jaxws:serviceBean>
   </jaxws:server>
   <bean id="SealKeeperService"
class="com.wedge.edp.webService.Impl.SMSWebServiceImpl">
   </bean>
   <bean id="proxyFactory"
class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
    <property name="serviceClass"
value="com.wedge.edp.webServiceClient.DominoService"/>
    <property name="address" value="http://10.151.15.235/wservice/
TestWSDL.nsf/dows"/>
   </bean>
   <bean id="DominoServiceClient"
class="com.wedge.edp.webServiceClient.DominoService"
          factory-bean="proxyFactory" factory-method="create"/>
调用c的客户端程序为:
  public class DominoServiceImpl {
        ApplicationContext context = new ClassPathXmlApplicationContext
("applicationContext.xml");
        DominoService client = (DominoService) context.getBean
("DominoServiceClient");

        public DoAuthenticationResponse DoAuthentication
(DoAuthenticationRequest request){
                DoAuthenticationResponse response = client.doAuthentication
(request);
                return response;
        }
}

在B的服务端视这样写的:
public class SMSWebServiceImpl implements SMSWebService {

        private static SessionService sessionService = (SessionService)
BeanFactoryUtils.getBean("sessionService");
        @Resource
    private WebServiceContext context;
        public AuthenticationResponse authentication(
                        AuthenticationRequest AuthenticationRequest, Holder<String> userID,
                        Holder<String> sessionID) {

                MessageContext ctx = context.getMessageContext();
                HttpServletRequest request = (HttpServletRequest) ctx.get
(AbstractHTTPDestination.HTTP_REQUEST);

          AuthenticationResponse _return = new AuthenticationResponse
();
          DoAuthenticationRequest _request = new
DoAuthenticationRequest();
          _request.setMachineID(AuthenticationRequest.getMachineID());
          _request.setPassword(AuthenticationRequest.getPassword
().getValue());
          _request.setUser(AuthenticationRequest.getUser());
          DominoServiceImpl client = new DominoServiceImpl();
          DoAuthenticationResponse ret = client.DoAuthentication
(_request);
          _return.setErrorCode(ret.getErrorCode());
          if (ret.getErrorCode() != 0){

          _return.setMachineInfo(ret.getMachineInfo());
          String[] userInfo = ret.getUserName().split("/");
          _return.setUserName(userInfo[0]);
          String sessionId = sessionService.saveSession(request,
AuthenticationRequest.getUser(), ret.getRoleName(),userInfo[1]);
          sessionID.value = sessionId;
          }
                        return _return;
        }
每当程序走到  DoAuthenticationResponse ret = client.DoAuthentication
(_request);
就发现刚刚出现的spring容器被覆盖。这样正常吗?如果不正常请问下怎么解决?

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 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: 新人求助!

by willem.jiang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


为什么你不能向 SMSWebServiceImp 中注入 DominoServiceImpl, 这样在你就不需要在
DominoServiceImpl 中创建一个新的Spring Application Context了。

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

On 8月28日, 下午12时02分, cl <clsu...@...> wrote:

> 我们项目组刚刚开始使用CXF,我使用的相关版本是:
> cxf :2.2.3
> spring: 2.
> 我们要做的是这样一个流程,A 请求B的WebService然后B去调用C的WebService.
> 现在发现每当调用C的webSevice后有这样的提示:
> 八月 09 11:52:14,115703 [http-8080-Processor25] WARN
> com.wedge.edp.framework.jbpm.config.SpringLocator  - 新的Spring容器引用覆盖原有
> SpringLocator的引用
>  28 八月 09 11:52:14,115703 [http-8080-Processor25] INFO
> com.wedge.edp.framework.jbpm.config.SpringLocator  - Initialize the
> reference to spring beanFactory :
> org.springframework.beans.factory.support.DefaultListableBeanFactory@2c0d3e :
> defining beans
> [dataSource,sqlMapClient,jdbcTransactionManager,superDao,cxf,org.apache.cxf .bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanF actoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.a pache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.Reso urceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding. BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,or g.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLMana ger,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueMan ager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoin t.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache. cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHan dlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cx f.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apac he.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.soap .SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.ap ache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servl et.ServletTransportFactory,SMSWebService,SealKeeperService,proxyFactory,Dom inoServiceClient,org.springframework.aop.config.internalAutoProxyCreator,or g.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor ,SequenceDao,sequenceService,sessionService,sessionFactory,jbpmConfiguratio n,processTxAdvice,wedgeWorkflowJbpmService,wedgeWorkflowApplication,org.spr ingframework.aop.support.DefaultBeanFactoryPointcutAdvisor,org.springframew ork.aop.support.DefaultBeanFactoryPointcutAdvisor#1,org.springframework.aop .aspectj.AspectJPointcutAdvisor,errorReportor,workflowContextAdvice,process App,workflowTemplate,processDao,orgEngine,UserInfoDao,userInfoService,Opera torInfoDao,EmpLoyeeInfoDao,userMgrService,OrgInfoDao,orgInfoService,RoleInf oDao,MenuInfoDao,roleInfoService,DictTypeDao,DictEntryDao,dictTypeService,m enuInfoService,LoginMgrDao,loginMgrService,personalInfoDao,personalOpInfoDa o,personalService];
> root of factory hierarchy
>  这样我想肯定是不对的,请问这种问题应该怎么解决?
> 我的spring_beans:applicationContext如下:
>     <jaxws:server id="SMSWebService"
> serviceClass="com.wedge.edp.webService.SMSWebService"  address="/
> SealKeeper">
>         <jaxws:serviceBean>
>         <ref bean="SealKeeperService"/><!-- 要暴露的 bean 的引用 -->
>         </jaxws:serviceBean>
>    </jaxws:server>
>    <bean id="SealKeeperService"
> class="com.wedge.edp.webService.Impl.SMSWebServiceImpl">
>    </bean>
>    <bean id="proxyFactory"
> class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
>         <property name="serviceClass"
> value="com.wedge.edp.webServiceClient.DominoService"/>
>         <property name="address" value="http://10.151.15.235/wservice/
> TestWSDL.nsf/dows"/>
>    </bean>
>    <bean id="DominoServiceClient"
> class="com.wedge.edp.webServiceClient.DominoService"
>           factory-bean="proxyFactory" factory-method="create"/>
> 调用c的客户端程序为:
>   public class DominoServiceImpl {
>         ApplicationContext context = new ClassPathXmlApplicationContext
> ("applicationContext.xml");
>         DominoService client = (DominoService) context.getBean
> ("DominoServiceClient");
>
>         public DoAuthenticationResponse DoAuthentication
> (DoAuthenticationRequest request){
>                 DoAuthenticationResponse response = client.doAuthentication
> (request);
>                 return response;
>         }
>
> }
>
> 在B的服务端视这样写的:
> public class SMSWebServiceImpl implements SMSWebService {
>
>         private static SessionService sessionService = (SessionService)
> BeanFactoryUtils.getBean("sessionService");
>         @Resource
>     private WebServiceContext context;
>         public AuthenticationResponse authentication(
>                         AuthenticationRequest AuthenticationRequest, Holder<String> userID,
>                         Holder<String> sessionID) {
>
>                 MessageContext ctx = context.getMessageContext();
>                 HttpServletRequest request = (HttpServletRequest) ctx.get
> (AbstractHTTPDestination.HTTP_REQUEST);
>
>           AuthenticationResponse _return = new AuthenticationResponse
> ();
>           DoAuthenticationRequest _request = new
> DoAuthenticationRequest();
>           _request.setMachineID(AuthenticationRequest.getMachineID());
>           _request.setPassword(AuthenticationRequest.getPassword
> ().getValue());
>           _request.setUser(AuthenticationRequest.getUser());
>           DominoServiceImpl client = new DominoServiceImpl();
>           DoAuthenticationResponse ret = client.DoAuthentication
> (_request);
>           _return.setErrorCode(ret.getErrorCode());
>           if (ret.getErrorCode() != 0){
>
>                 _return.setMachineInfo(ret.getMachineInfo());
>                 String[] userInfo = ret.getUserName().split("/");
>                 _return.setUserName(userInfo[0]);
>                 String sessionId = sessionService.saveSession(request,
> AuthenticationRequest.getUser(), ret.getRoleName(),userInfo[1]);
>                 sessionID.value = sessionId;
>           }
>                         return _return;
>         }
> 每当程序走到  DoAuthenticationResponse ret = client.DoAuthentication
> (_request);
> 就发现刚刚出现的spring容器被覆盖。这样正常吗?如果不正常请问下怎么解决?
--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 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
-~----------~----~----~----~------~----~------~--~---