Wednesday August 16, 2006 ![]() |
JMX, SNMP, Java, etc...Daniel Fuchs blogs on JMX, SNMP, Java, etc... |
... or at least two hours of it ;-) ... Life Is A MiracleSometimes I feel like life is such a precious thing, and every
breath you take is like a little miracleon its own.
As years go by, we tend
to get used to it and take it for granted... But when you start thinking
about the billions of cells, organic chemicals, atoms, and complex mechanisms
involved in just drawing a simple breath... Waouh... what a wonder!... As I have already hinted about in one of my previous entries, I've been busy preparing an advanced JMX Example for JDK 6 - but this is a topic for another blog. What is the topic of this blog however, is the strange idea I had to test that new JMX example on my own home PC. I am used to Solaris and Unix Systems, but for me, Windows is more like uncharted territory... Working From HomeLike many Sun engineers, I occasionally take the opportunity to spend a few hours working from home (essentially reading my mail) before driving to work. I'm only doing this once in a while, but it's incredible how much more enjoyable it is to be sitting at home in front of your email, with an orange juice and some jam on a toast, rather than be sitting in your car with all of the morning jam around you ;-) So as it happens - after having spent some time downloading and
installing the latest bits of NetBeans IDE and JDK 6 on my home PC, I set out to test my example.
But on my home PC, things were different: NetBeans would simply start
or not start - never giving any error message, but the options I gave were
apparently thoroughly ignored. Then I suddenly noticed the presence of an
executable named How to start NetBeans 5.0 with JDK 6 on Windows PlatformSo that's going to be my tip #1: if you're trying to start NetBeans 5.0 with
JDK 6 on a Windows platform, use OK, that one was easy to figure out. I'd probably found it sooner if I had
read the docs ;-). My guess is that the The real trouble came when I tried to start my example with a secure configuration: As I had expected, the JVM refused to start, giving the following message:
Error: Password file read access must be restricted: src/etc/password.properties
But how do you restrict file access on Windows XP Home Edition?Well, if you're in a hurry, you may want to jump directly to the solution, or jump back to the trivial tasks at the beginning of this article. If however you're ready to spend a few of these miraculous breaths with me, then please keep on reading ;-) As I was saying, the JVM error message didn't surprise me: I was expecting it. It is even something I had documented in the example. And I had even put a link to a document that explained how to secure a password file on Microsoft Windows Systems. So I dutifully clicked on that link and started following the instructions. The catch is: these instructions actually apply to Windows XP Professional Edition. On Windows XP Home Edition, they do not work. There's no way you can make the damned Security tab appear. Like many Windows XP users, I didn't know that there was an actual difference between XP Home and XP Pro. I thought it was just a question of pricing and support. It's not. So my first idea was that to make the security tab appear, you had to have several users configured on the machine. So I dutifully added a new guest user.
At that point, I had finally figured out that there was indeed a difference between Home and Pro, and that I was only running the Home Edition. So I started searching for pages explaining how to secure a file on Microsoft Windows XP Home Edition. I found out several documents explaining that this feature was not part of XP Home, then found some links on some commercial products offering to add that feature on top of XP Home, then found a link which proposed to download and use an NT binnary to do the trick - with the scary advice to make sure to create a System Restore point before proceeding. Well, that's my home PC! Pas question de le bousiller! So finally I did what I should have done right from start: I asked my
colleagues :-). And Mandy actually came back with a very simple solution: use
Using 'cacls' to secure a fileIt stands in one line:
cacls path-to-file /P username:R
That's it! Just open a command window ( And you know what? There's even a cherry on the cake: it seems that this
simple Breathing again...Well now that the problem is solved, let's perform some small miracles, and breathe again ;-))) Once I had figured out how to start things that needed starting, testing the example itself was a piece of cake. Ah! If only all OS commands were portable like Java APIs :-) -- daniel Post Scriptum: There's still a catch though: AFAIK
Tags:
Posted by dfuchs ( Aug 16 2006, 08:53:32 PM CEST ) Permalink Comments [5] |
I have downloaded the latest Sun JDK on windows - but for the life of my I cannot figure out if it is working. I neede it for something else and I am perplexed as to how it is to work.
My grip is that many of these advanced tools take long to get up and running for other applications - and they should not - complete lack of user configurability.
Posted by Frustrated newbie on November 04, 2007 at 06:36 AM CET #
I have xp pro and an NTFS file system, but this didn't help. Anyone else have any other suggestions?
Posted by John Windberg on November 22, 2007 at 01:02 AM CET #
Hi John,
Do you mean that cacls didn't work, or that the out-of-the-box connector still complains about the password file permission not being correctly set?
I believe the M&M faq has now been updated with detailed instructions on how to set the password file permissions.
See:
http://java.sun.com/javase/6/docs/technotes/guides/management/security-windows.html
Hope this helps,
-- daniel
Posted by daniel on November 22, 2007 at 10:32 AM CET #
The cacls did work, as far as I can tell.
The out-of-the-box connector still complains.
Thanks for the link, I'll go read it and find out if it helps.
Posted by John Windberg on November 22, 2007 at 04:18 PM CET #
URL: http://blogs.sun.com/jmxetc/entry/the_hidden_command_that_would URL: http://blogs.sun.com/jmxetc/entry/the_hidden_command_that_would
Posted by Rimbochi on July 14, 2008 at 06:42 AM CEST #