quality@glassfish.java.net

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

From: KANIKA GUPTA <kaniks4u_at_yahoo.com>
Date: Fri, 30 May 2008 20:03:26 -0700 (PDT)

Hi

i got it
thank you
i mssed on the classpath being set to the path of the tool...

Kanika

--- On Fri, 5/30/08, Tim Quinn &lt;Timothy.Quinn_at_Sun.COM&gt; wrote:
From: Tim Quinn &lt;Timothy.Quinn_at_Sun.COM&gt;
Subject: Re: File locking tool project (was Re: Project query)
To: quality_at_glassfish.dev.java.net
Date: Friday, May 30, 2008, 2:58 AM




  
It looks as if your class path does not include the JAR file you should
have downloaded from the link in my blog entry about the tool.&nbsp; Once
you download that JAR (if you have not already done so) include the JAR
in the classpath.



- Tim



KANIKA GUPTA wrote:
Hi

  

Tried the double quotes but i'm still getting the errors as:

  

C:\Program Files&gt;java -classpath
c:\Users\Kanika\Work\;"%JAVA_HOME%/lib/tools.ja

r" util.ZipFileMonitor -host localhost -port 9009 -filter Enterprise

Exception in thread "main" java.lang.NoClassDefFoundError:
util/ZipFileMonitor

Caused by: java.lang.ClassNotFoundException: util.ZipFileMonitor

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader$1.run(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.security.AccessController.doPrivileged(Native Method)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader.findClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClassInternal(Unknown Source)

  

I changed the location of my tool jar...

Should i reinstall java in c:\ and not in c:\program files\

  

Or is there any other solution...

  

  Tim Quinn &lt;Timothy.Quinn_at_Sun.COM&gt; wrote:
  

    
The problems are due to the space in the JAVA_HOME symbol value.&nbsp; 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&gt;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

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader$1.run(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.security.AccessController.doPrivileged(Native Method)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader.findClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClassInternal(Unknown Source)

      

Try 2:

C:\Program Files&gt;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

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader$1.run(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.security.AccessController.doPrivileged(Native Method)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader.findClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClassInternal(Unknown Source)

      

Try 3:

C:\Program Files&gt;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

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader$1.run(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.security.AccessController.doPrivileged(Native Method)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.net.URLClassLoader.findClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at java.lang.ClassLoader.loadClass(Unknown Source)

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 &lt;Timothy.Quinn_at_Sun.COM&gt;
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
&lt;path-to-the-utility-jar&gt;;%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.&nbsp; Make sure you have
defined the environment variable JAVA_HOME to point to the directory
that contains the Java JDK you want to use.&nbsp; Any version from 1.5
onward should be fine.&nbsp;

        

The class path is
&lt;path-to-the-utility-jar&gt;;%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:&nbsp; 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.&nbsp; These arguments are explained in the
blog.

        

Let us know if you have further questions.

        

- Tim

        

      
      

      

      

Kanika
       
    
    

  
  

  

  

Kanika