Results 1 to 3 of 3

Thread: Set port in RmiServiceExporter

  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Default Set port in RmiServiceExporter

    Hi,

    I export 3 beans as RMI services. I want to programmatically set the serviceport to something different than 1099 so I retrieve the beans from the ApplicationContext and call RmiServiceExporter#setRegistryPort
    But as the bean has already been initialized when I retrieve it I need to shutdown the registry (for all 3 beans), set the new port and restart. How can I do that? I already tried to call "destroy", set the port and then "afterPropertiesSet" but then I get an RMI exception that the "ObjectID" is already in use


    Regards,

    Carsten

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Can you post the relevant appContext configuration and stacktrace? If you want to set the bean programatically then try using a bean post processor so you can inject the port before the beans are injected into other beans.
    A FactoryBean might help if your object creation is complex.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Jan 2006
    Posts
    3

    Default

    Great, the post-processor did it! Thanks a lot. I registered one bean as post-processor and changed the rmi port.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •