quality@glassfish.java.net

Re: File locking tool project (was Re: Project query)

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Wed, 28 May 2008 23:38:14 -0500

The problems are due to the space in the JAVA_HOME symbol value. When
JAVA_HOME is substituted in the classpath expression the command-line
interpreter treats the space as an argument separator, rather than part
of the classpath value.

Try enclosing any value that can contain a blank in double-quote marks,
like this:

java -classpath "c:\Program Files\";"%JAVA_HOME%/lib/tools.jar"
util.ZipFileMonitor -host localhost -port 9009 -filter Enterprise

and see if that helps.

- Tim

KANIKA GUPTA wrote:
> Hi
>
> we tried the command-line but get the following errors:
>
> Try 1:
> C:\Program Files>java -classpath c:\program
> files\;%JAVA_HOME%/lib/tools.jar util.ZipFileMonitor -host localhost
> -port 9009 -filter Enterprise
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> files\;C:\Program
> Caused by: java.lang.ClassNotFoundException: files\;C:\Program
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> Try 2:
> C:\Program Files>java -classpath .;%JAVA_HOME%/lib/tools.jar
> util.ZipFileMonitor -host localhost -port 9009 -filter Enterprise
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> Files\Java\jdk1/6/0_0
> 6\bin/lib/tools/jar
> Caused by: java.lang.ClassNotFoundException:
> Files\Java\jdk1.6.0_06\bin.lib.tool
> s.jar
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> Try 3:
> C:\Program Files>java -classpath
> .\ZipFileMonitor.jar;%JAVA_HOME%/lib/tools.jar
> util.ZipFileMonitor -host localhost -port 9009 -filter Enterprise
> Exception in thread "main" java.lang.NoClassDefFoundError:
> Files\Java\jdk1/6/0_0
> 6\bin/lib/tools/jar
> Caused by: java.lang.ClassNotFoundException:
> Files\Java\jdk1.6.0_06\bin.lib.tool
> s.jar
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
> The File Locking Diagnostic Tool is saved in c:\program files and i
> have installed jdk1.6...
> and the JAVA_HOME is set as C:\Program Files\Java\jdk1.6.0_06\bin
>
> Please help, where we might be going wrong...
>
> */Tim Quinn <Timothy.Quinn_at_Sun.COM>/* wrote:
>
>
>
> KANIKA GUPTA wrote:
>
>> Hi
>>
>> We are working on the project: "File Locking Diagnostic Tool"
>>
>> I was following the blog:
>> http://blogs.sun.com/quinn/entry/tool_for_diagnosing_failed_glassfish
>>
>> To run the tool we need to follow the following commands:
>> |java -classpath
>> <path-to-the-utility-jar>;%JAVA_HOME%/lib/tools.jar
>> util.ZipFileMonitor -host yourhost -port 9009 -filter xyz
>>
>> We can't exactly figure out what it means to actually run the same...
>> Have been able to set up the debugging options in the glassfish
>> admin, but can't figure out the above to continue... I mean is it
>> one single command or a group...
>>
>> Please help...
>> |
>>
>> Kanika
> Hi, Kanika.
>
> Did you try that as a single command and have problems?
>
> That's a standard (single) java command line. Make sure you have
> defined the environment variable JAVA_HOME to point to the
> directory that contains the Java JDK you want to use. Any version
> from 1.5 onward should be fine.
>
> The class path is <path-to-the-utility-jar>;%JAVA_HOME%/lib/tools.jar
>
> The main class to execute is util.ZipFileMonitor
>
> The rest of the command line contains arguments to the file
> monitor utility: what host you have GlassFish running on, what
> port you configured for the debugger in GlassFish, and the file
> filter you want the file monitor utility to use. These arguments
> are explained in the blog.
>
> Let us know if you have further questions.
>
> - Tim
>
>
>
>
> Kanika
>