[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

weird Exception

this is the stack trace ,

Jan 19 22:22:24  0 (dir1.dir2.dir3.ProblemClass) Error while reading from the client java.lang.ExceptionInInitializerError
Jan 19 22:22:24  0 (dir1.dir2.dir3.ProblemClass) STACK TRACE
 java.lang.ExceptionInInitializerError
      at sun.io.ByteToCharConverter.getDefault(Compiled Code)

Jan 19 22:22:41  0 (dir1.dir2.dir3.ProblemClass) Error while reading from the client java.lang.NoClassDefFoundError: dir1/dir2/dir3/newdesign/SomeOtherClass
Jan 19 22:22:41  0 (dir1.dir2.dir3.ProblemClass) STACK TRACE
 java.lang.NoClassDefFoundError: dir1/dir2/dir3/newdesign/SomeOtherClass
      at sun.io.ByteToCharConverter.getDefault(Compiled Code)

i tried compiling with jdk 1.1.8 & jikes but still i keep getting this error.
morning it was okay

my developement pltaform is WinNT 4.0 ,Service pack 4
i reinstalled JDK 1.1.8 twice but the crux of the matter is that the normal GUI of the app works fine but it is the command line app on which i am working on which gives this problem ,this app also sends some commands across but gives this ... for others.

anybody can point me to the solution? this is the first time it came across.
sorry for the manual obfuscation.

a point , i caught this exception only when i wrote in code.
catch(Throwable t)
hoping for a solution tommorrow...
0
mbormann
Asked:
mbormann
  • 5
  • 3
  • 3
  • +1
1 Solution
 
JodCommented:
At forst glance it appears to be to do with Static initialisation.

Am I right in assuming that this is your problem class:

dir1.dir2.dir3.ProblemClass

and this is a new class you are working on or have changed:

dir1/dir2/dir3/newdesign/SomeOtherClass

Perhaps it cannot find this SomeOtherClass when doing intialisation in a Static member, variable or code block so try checking your statics first.

Does the command line app communicate with the GUI? Can the GUI find the class but the command line app cannot?



0
 
heyhey_Commented:
do you use RMI / socket based communication / Localization ?

when do you see this Exception ? on client startup or ?

can you post the real stacktrace
try
{
} catch (Throwable e)
{
 e.printStackTrace();
}

// inside the main or your Thread run() method

(I don't like the date&hour stuff)
0
 
mbormannAuthor Commented:
Jod ,
sorry I came late,the command line Appl is separate from GUI and just is a simulator of it,and the GUI has no relation with it.

I looked at the code with a jaundiced eye and it appears that I had inserted code like this in the Problem class

private static final String RECORD_DEMARCATOR = NAMES[ R_NUMBER ];
private static final int RECORD_DEMARCATOR_LEN = RECORD_DEMARCATOR.length();

this code had appeared b4 the initialisation of the static String NAMES[] in the static {}

Thanks very much !

Anyway my senior also had a problem where when u change those
public static final String XXX; we have to recompile ALL classes when we change their values.

Though I feel that it is a useless titbit for u as u r quite a wizard with the basics.

heyhey,
I can't debug like a GUI app ,I have to use the Logger .I also hate the date time stamps .

A request do any of you guys know of a debugger which can test remote socket based appls?

another titbit I learnt ,in ur main thread catch(Throwable t){} and NOT (Exception e)
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mbormannAuthor Commented:
I really really love this site coz it makes us closer.
If I was alone I am sure I would be less some hairs ,not to mention countless cups of tea/coffee/sandwiches/late nights/music/some nice pics.

Man I wish I get a chance to work with you guys.I did mention to you that 'rainmal' is a colleague now ,but this is just ephemeral ,isn't it?
You feel a nice sort of camaradarie working with like minded people.
Anyway work is calling,and it is a demanding mistress.
0
 
heyhey_Commented:
>> public static final String XXX;

that's what final is for :) - final is constant :)

>> catch(Throwable t){} and NOT (Exception e)


you should always use catch (Throwable t) in server side application, because you never know when your code will throw some NullPointerException for example ... and you don't want your server to die (at least without logging the Throwable stacktrace first :)
0
 
mbormannAuthor Commented:
can u shed some light on a good debugger ?
though i feel it would have been useless in this case
0
 
heyhey_Commented:
I still use the old Log.log() stuff ... never used Java debugger for the last one / two years :(
0
 
vladi21Commented:
VJ++ have some remote debugging support via DCOM :)
0
 
mbormannAuthor Commented:
no use to us,anyway u bother to look at PAQ's?
:)
0
 
vladi21Commented:
only for u :)
0
 
mbormannAuthor Commented:
wow ,i am flattered
:(
0
 
vladi21Commented:
:)
0
 
JodCommented:
:)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now