This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI Registry unable to create because of no admin rights on machine  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I do not have admin rights on my machine. I have written a simple java source code which trying to create a registry for RMI calls. But the code is breaking because of lack of admin rights. Is there any way through which i can create registry even if i have no admin rights?

Following is additional information :

Code snippet :

Exception : Jun 11, 2013 4:57:49 PM java.util.prefs.WindowsPreferences openKey
WARNING: Could not open windows registry node Software\JavaSoft\Prefs\com\nec\jp\dianascope\prefs at root 0x80000002. Windows RegOpenKey(...) returned error code 5.
Exception in thread "main" java.lang.SecurityException: Could not open windows registry node Software\JavaSoft\Prefs\com\nec\jp\dianascope\prefs at root 0x80000002: Access denied
at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:513)
at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:480)
at java.util.prefs.WindowsPreferences.openKey(WindowsPreferences.java:466)
at java.util.prefs.WindowsPreferences.putSpi(WindowsPreferences.java:612)
at java.util.prefs.AbstractPreferences.put(AbstractPreferences.java:251)
at com.nec.jp.dianascope.util.PreferencesUtil.setRmiPortPreference(PreferencesUtil.java:35)
at com.nec.jp.dianascope.CoreServer.main(CoreServer.java:5562)


 
Bartender
Posts: 3317
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags (← click) when posting code as it makes it easier for people to read your code. I've added them for you this time.

I don't think this is related to RMI but rather to using the preferences api to store data in the registry. What does your PreferencesUtil class do?
 
Anu Gaur
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Snippet for PreferencesUtil.java method - setRmiPortPreference()


So this is basically getting the node from system where in it is failing because of lack of admin rights. Is it correct?

Also, i tried by comment out of this method call, but still it failed on next line where in it is trying to create the registry.

Please suggest.
 
Rancher
Posts: 1878
15
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if this helps
http://www.rmiproxy.com/doc/guide/RMIProxy_Guide.html
 
Tony Docherty
Bartender
Posts: 3317
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

So this is basically getting the node from system where in it is failing because of lack of admin rights. Is it correct?


That's what it looks like to me.

Also, i tried by comment out of this method call, but still it failed on next line where in it is trying to create the registry.


You'll need to post the full error message and stack trace you are getting for the new failure. The one you posted earlier is from using the preferences api.
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!