Java Dynamic Management Kit 4.2 Tutorial

Running the Example with Authentication

The examplesDir/Context directory contains the applications which demonstrate the use of password authentication through the HTTP connector.

Compile all files in this directory with the javac command. For example, on the Solaris platform with the Korn shell, you would type:


$ cd examplesDir/Context/
$ javac -classpath classpath *.java
Instructions
  1. Launch the agent in a terminal window, and specify a list of login-password pairs, as in the following command:


    $ java -classpath classpath ContextAgent  jack jill  billy bob
    
  2. Wait for the agent to be completely initialized, then launch the manager in another window with the following command:


    $ java -classpath classpath ContextClient -ident andy bob
    

    The client application will try to establish a connection with the login andy and the password bob. The authentication mechanism will refuse the connection, an you will see the com.sun.jdmk.comm.UnauthorizedSecurityException raised by the connector server.

  3. Launch the manager again, this time with a valid identity:


    $ java -classpath classpath ContextClient -ident jack jill
    

    The connection is established and you see the output from management operation in both windows.

  4. Leave both applications running for the next example.