Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java ia NOT reading the latest .class

Status
Not open for further replies.

mydavor

Programmer
Mar 21, 2004
41
AU
symantec.itools.awt.shape.HorizontalLine horizontalLine1 = new symantec.itools.awt.shape.HorizontalLine();

This line of Java code produces the error below. Oddly enough, when I comment the line out or try to debug inserting a few printlns it still reports the error in the very SAME line (392), like it is using .java/.class from some other directory not the .class from the jar in the current directory, CLASSPATH and common/lib.
I am positive that the most recent .class is in TOMCAT's application classes directory, and generaly only 2 such files make problems, no others have problems with debugging.
Does anyone know why is it referring to some oldish .java (I cleaned the PC of any remnants and rebuilt everything from scrach many times) OR how can I solve this problem - especially because I have all symantec class hierarchy correct in a jar ??

java.lang.NoClassDefFoundError: symantec/itools/beans/VetoableChangeSupport (wrong name: com/symantec/itools/beans/VetoableChangeSupport)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

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

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

at DPAddressClass.<init>(DPAddressClass.java:392)

at DPProjectDetailClass.init(DPProjectDetailClass.java:146)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)
 
view the contents of the jar ( jar -tvf myfile.jar ) and check that VetoableChangeSupport is in the directory structure : com/symantec/itools/beans/ NOT symantec/itools/beans/

If you can view the source make sure the package name is :

package com.symantec.itools.beans;

NOT

package symantec.itools.beans;

Because the error is saying that the class VetoableChangeSupport package is incorrect (ie its missing the com) - read the error carefully and you will see this.
 
OK, I'll certainly do it.

BUT my other problem is more sinister than that: I have commented the offending lines out, they are not essential, put a few printlns and recompiled that and all other files and when I run it, it behaves like it is using the very same old .java and .class file.
Where is it getting the old code from, my new code has no call to HorizontalLine, and has nothing on line 392 ?
(on line 146 is an obvious call to the constructor of DPAddressClass)
Of course, I rebuilt it number of times, carefully replaced .class in \classes and .jars in \lib, restarted Tomcat each time, cleaned up %CATALINA_HOME%, restarted all again, restarted PC. Where is it getting the old code and the line 392 ?
 
Delete the %CATALINA_HOME%\work directory contents.

Check your entire PC for versions of the offending classes.
 
Well, this was certainly a clean up. I found the classes even in same caches.
But what actually helped is renaming the offending class, and all its references and recompiling it from scratch again. The other offending file got sorted out after this.
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top