• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is local mode giving me a StubNotFoundException!!!  RSS feed

Charu Krishnan
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client class taht handles the GUI issues and two seperate database interface classes for different connection types. Both implement the same interface DataClient. This allowed me to declare a single DataClient variable in the GUI class taht is transperant to the connection type.
When I run the application in local mode I get an error "Local Database connection failed" unable to find Data_stub. Somehow my local mode is also going thru RMI which I did not intend it to and is looking for the stuff. Is there something wrong with my design.
When I run the local mode I don't start the server or anything as expected and just run my GUI with the single parameter (for local mode). Can't understand where stub is comming into teh picture. Quite confused.
Please any comments or solutions
public class DataClientLocal implements DataClient {
private Data dbInstance;
public DataClientLocal(String dbName) {

try {
dbInstance = new Data(dbName);
catch(Exception ex) {
System.out.println("Local Database connection failed" + ex);

Similarly class DataClientRMI for RMI implementation

public interface DataClient extends Remote
//implement all the data class methods throwning remote and database exceptions.
public class Data extends UnicastRemoteObject implements DataClient
//I do not subclass Data
In my GUI
private DataClient myData = null;
If (localmode)
myData = new DataClientLocal(%databasename);
myData = newDataClientRMI(%hostname , %portno);

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!