Announcement Announcement Module
Collapse
No announcement yet.
how to Create Remoting Bean Programatically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to Create Remoting Bean Programatically

    Hello everyone, I have tried to expose and capture my services through RmiServiceExporter / RmiProxyFactoryBean. I can explain but can not catch the right way.

    look here:
    so you can faithless

    Code:
    RmiServiceExporter exporter = new RmiServiceExporter();
    exporter.setServiceName("ServicoImp");
    exporter.setService( event.getApplicationContext().getBean( "servico" ) );
    exporter.setServiceInterface(Servico.class);	
    exporter.afterPropertiesSet();
    and i can give that's

    Code:
    RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
    factory.setServiceUrl( String.format("rmi://%s:1099/ServicoImp" ,  "192.168.10.86") );
    factory.setServiceInterface(Servico.class);
    factory.setBeanClassLoader(appContext.getClassLoader());
    factory.afterPropertiesSet();
    factory.getObject();  // i can give here,  but this is out context
    but the bean does not seem to be in the context
    when I try to get the bean this way:

    Code:
    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(apps);
    ctx.addApplicationListener( new MyCaptureSpringBeanApplicationListener() );
    ctx.start();
    
    Servico servico = (Servico)  ctx.getBean("servicoImp");


    I'm not just 'cause there is a proxy object.
    someone can tell me anything about it?

    thanks a lot
Working...
X