Announcement Announcement Module
Collapse
No announcement yet.
Shutting Down an RMI-exported. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shutting Down an RMI-exported.

    I've got an application that exports a single service via RMI.

    Code:
    <beans>
    	<bean id="someService" class="andrew.demo.services.SomeServiceImpl"/>
    	
    	<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
    	
    		<property name="serviceName" value="SomeService"/>
    		<property name="service" ref="someService"/>
    		<property name="serviceInterface" value="andrew.demo.services.SomeService"/>
    		<!-- defaults to port 1099 -->
    		</bean>
    	
    </beans>
    Then to deploy this to the RMI registry...I have a Deploy class that looks like the following...

    Code:
    public class Deploy {
    
    	/**
    	 * @param args
    	 */
    	public static void main(String[] args) {
    		ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
    		System.out.println("ApplicationContext loaded.");
    	}
    
    }
    When that executes....that class blocks (i.e. it does not terminate). And the service is accessible, everythings fine...

    However...how do i get the application to shutdown...i've tried removing the entry from the rmiregistry....terminating the registry... yet the main method that started the application context appears to keep running.

    Thanks in advance,
    Andrew

  • #2
    It appears that the JVM that started the main method does die eventually after you kill the RMIRegistry...but it takes several minutes.

    I'd still love an explaination of what's going on here...

    Comment

    Working...
    X