timd
Feb 23rd, 2005, 04:43 PM
Because I would like my client to choose a rmi objects host/port/servicename at runtime, client side I am trying to connect to server (spring enhanced) objects like this:
---------------------------------
RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
factory.setServiceInterface(IMyInterface.class);
factory.setServiceUrl("rmi://localhost:1099/MyServiceName");
IMyInterface bsi = (IMyInterface) factory.getObject();
bsi.doSomethingUsefull();
-------------------------------------
However I get back null from factory.getObject()... If I configure client side to use xml file and use FileSystemXmlApplicationContext everything works just fine.
------------------------------------
What am I doing wrong? Also, is there a better way to handle discovering client host/port/service (and connecting) at runtime (apart from generating temp xml files)?
---------------------------------
RmiProxyFactoryBean factory = new RmiProxyFactoryBean();
factory.setServiceInterface(IMyInterface.class);
factory.setServiceUrl("rmi://localhost:1099/MyServiceName");
IMyInterface bsi = (IMyInterface) factory.getObject();
bsi.doSomethingUsefull();
-------------------------------------
However I get back null from factory.getObject()... If I configure client side to use xml file and use FileSystemXmlApplicationContext everything works just fine.
------------------------------------
What am I doing wrong? Also, is there a better way to handle discovering client host/port/service (and connecting) at runtime (apart from generating temp xml files)?