Announcement Announcement Module
Collapse
No announcement yet.
Set port in RmiServiceExporter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


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

      Comment

      Working...
      X