public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/20508] New: gij prints too much information if an incorrect class is given
@ 2005-03-17  5:04 mckinlay at redhat dot com
  2005-03-17 20:29 ` [Bug libgcj/20508] " pinskia at gcc dot gnu dot org
  2005-03-17 23:48 ` mark at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: mckinlay at redhat dot com @ 2005-03-17  5:04 UTC (permalink / raw)
  To: java-prs

When the name of a non-existant class is given to gij, the error given is far
too verbose:

$ gij Blah
Exception in thread "main" java.lang.NoClassDefFoundError: Blah
   at gnu.java.lang.MainThread.run (MainThread.java:98)
Caused by: java.lang.ClassNotFoundException: Blah not found in
gnu.gcj.runtime.SystemClassLoader{urls=[file:./],
parent=gnu.gcj.runtime.VMClassLoader{urls=[core:/], parent=null}}
   at java.net.URLClassLoader.findClass (URLClassLoader.java:923)
   at java.lang.ClassLoader.loadClass (ClassLoader.java:309)
   at java.lang.Class.forName (natClass.cc:88)
   at gnu.java.lang.MainThread.run (MainThread.java:94)

This is a lot more information than the user needs. Compare this with Sun's VM:

$ java Blah
Exception in thread "main" java.lang.NoClassDefFoundError: Blah

We should not wrap the ClassNotFoundException in MainThread.run, and the stack
trace code should supress stack trace printing when main() has not yet been
called (or, at least, for this special case - when the exception is thrown from
MainThread.run).

-- 
           Summary: gij prints too much information if an incorrect class is
                    given
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20508


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/20508] gij prints too much information if an incorrect class is given
  2005-03-17  5:04 [Bug libgcj/20508] New: gij prints too much information if an incorrect class is given mckinlay at redhat dot com
@ 2005-03-17 20:29 ` pinskia at gcc dot gnu dot org
  2005-03-17 23:48 ` mark at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-17 20:29 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-17 05:05 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-03-17 05:05:19
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20508


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgcj/20508] gij prints too much information if an incorrect class is given
  2005-03-17  5:04 [Bug libgcj/20508] New: gij prints too much information if an incorrect class is given mckinlay at redhat dot com
  2005-03-17 20:29 ` [Bug libgcj/20508] " pinskia at gcc dot gnu dot org
@ 2005-03-17 23:48 ` mark at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: mark at gcc dot gnu dot org @ 2005-03-17 23:48 UTC (permalink / raw)
  To: java-prs


------- Additional Comments From mark at gcc dot gnu dot org  2005-03-17 10:30 -------
Note that I made it more verbose then it was in the past on purpose.
But not for this case. See an example of a stacktrace were (most) of this
"extra" information is useful:
http://gcc.gnu.org/ml/java-patches/2005-q1/msg00337.html
This really helps when debugging strange reasons for your main class not wanting
to start correctly.

When cleaning this up be careful to at least keep the root cause and the
classloaders and search paths used. And when the root cause is some (chained)
ExceptionInInitializerError inside some super or interface class needed by the
main class you really want the stacktrace to track down why/what happened where.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20508


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-03-17 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-17  5:04 [Bug libgcj/20508] New: gij prints too much information if an incorrect class is given mckinlay at redhat dot com
2005-03-17 20:29 ` [Bug libgcj/20508] " pinskia at gcc dot gnu dot org
2005-03-17 23:48 ` mark at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).