Results 1 to 2 of 2

Thread: Shutting Down an RMI-exported.

  1. #1

    Default 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. #2

    Default

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

Posting Permissions

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