Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Get the Type of Exception JVM

Thread view: 
CezarAntonio - 16 Apr 2007 17:33 GMT
Hi, i'm a brazilian student.
I'm need,  in my student  project, capture the type of Exception
throwable for JVM.
For example :

if when compiling any source,
the jvm to return that "a signal ; it is required " or outher comum
error,
i'm need to identify this error and save in table of mysql.

I'm use Runtime.exec , i'm use the code the Michel Daconta em your
article:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
for capture the text  message throwable for JVM , but i'm liked to
know if exist  outher way to identify the error.

Sorry for my language.

Cézar
Tim Hemig - 17 Apr 2007 00:11 GMT
> Hi, i'm a brazilian student.
> I'm need,  in my student  project, capture the type of Exception
[quoted text clipped - 5 lines]
> error,
> i'm need to identify this error and save in table of mysql.

If you mean the errors from the compiler while compiling the source, that
are no exceptions like the thrown Exception while the runtime of your
compiled programm itself.

for compiler errors I see no other way than parsing the output with the help
of another programm, or cunsulting the dokumentation of javac, perhaps the
compiler has some more machine-readable output.

for Exeptions in runtime you just have to catch the Events, ask with the
help of 'if(var instanceof Class)' for the Type and write a method, that
puts Exceptions into a Database. Bu be carefull with writing into the
database - an Exception, that should be written into the database could
cause more Exceptions and so on, leading to an infinite recursion.

Hope i got the right opinion of your problem so far,

Tim
Greg R. Broderick - 17 Apr 2007 00:16 GMT
> Hi, i'm a brazilian student.
> I'm need,  in my student  project, capture the type of Exception
[quoted text clipped - 5 lines]
> error,
> i'm need to identify this error and save in table of mysql.

Exception (and its subclasses) is just another Class in Java, so you can do
instance.getClass() to get the specific subclass of exception that has been
thrown, within a try/catch block.

Cheers!

Signature

---------------------------------------------------------------------
Greg R. Broderick            gregb+usenet200612@blackholio.dyndns.org

A. Top posters.
Q. What is the most annoying thing on Usenet?
---------------------------------------------------------------------

CezarAntonio - 24 Apr 2007 14:40 GMT
Very good.
Thank's for retry.
I'm try here.

Cézar


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.