Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

My GUI be affected by RMI???!!!

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I define a 'DataAccess' interfce first,then use a local data access class and another RMI interface implements or extends it. In the 'main' method, choose to use local or RMI according to arguments, then cast it to DataAccess, then use it as parameter to initial GUI. GUI use JFrame and some JOptionPane to show message to user.
Now no problem for use the local data class, but when I use the RMI, the Frame window has a column at the bottom of the window, show 'Java applet window', all the JOptionPanes be shown by 'showConfirmDialog' are same, and all the JOptionPanes be shown by 'showMessageDialog' dispear.
The only different are four lines on the main method, to choose local or RMI, but why the windows be different.
The code are as follow (I delete the try-catch block):
public static void main( String[] args ) {
remote();
//local();
}
static void local() {
DataAccess data = new LocalData();
ClientGUI tm = new ClientGUI ( data );
tm.show();
}
static void remote() {
System.setSecurityManager( new RMISecurityManager() );
String url = "rmi://localhost:1099/";
ServerData c1 = (ServerData) Naming.lookup( url + "DataServer" );
DataAccess data = (DataAccess) c1;
ClientGUI tm = new ClientGUI ( data );
tm.show();
}
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it has to do with RMISecurityManager and the policy file.
There are a few posts here that already address the solution to this problem. Try doing search on Applet. I just forgot the answer, otherwise I would type it here
Mark
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic