• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with binding...

 
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am new to RMI and just playing around with a toy example, but I am having problems! So wondering if anyone can steer me in the right direction?

I am following an example from the book Core Java, Vol. 2: Advanced Features 8th Edition (page 849) http://www.amazon.com/Core-Java-Vol-Advanced-Features/dp/0132354799/ref=sr_1_1?ie=UTF8&qid=1298533409&sr=8-1

The code is quite simple, I am just trying to start up the server, here's the code:



But when I try this, I get the error below. I have turned off Windows firewall. I understand when you don't specify a URL or port that the localhost will be used and port 1099 - I've checked that port 1099 is not in use, and my IP address is indeed 172.16.160.17 as per the error message. So I'm a bit unsure of how to resolve this issue. Any ideas?


 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need a security policy file such as:
grant {
permission java.security.AllPermission "", "";
};

You'll also need a classpath so the RMI Registry can find your generated stub.
 
Sean Keane
Ranch Hand
Posts: 590
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I created a file called security.policy in the same folder as my .class file that contained:



I then ran the following command



and got the exact same error, any suggestions?
 
Edward Harned
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It still looks like a security problem.

The registry also needs a security policy file as well as a classpath. The registry is realty a Java application too.
-J-Djava.security.policy=
-J-Dclasspath=

These problems happen to everyone. Once you get everything set up, it will all work fine.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic