gcj/136: static linking yields circularity in Class.forName
Tom Tromey
tromey@cygnus.com
Mon Jan 17 14:16:00 GMT 2000
>Number: 136
>Category: gcj
>Synopsis: static linking yields circularity in Class.forName
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 17 14:16:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Tom Tromey
>Release: current cvs
>Organization:
>Environment:
>Description:
With the addition of dynamic loading for classes
(and uncommenting of some classloader code), statically
linked gcj applications which use Class.forName will
encounter circularity problems.
The basic problem is that the default ClassLoader is
a URL ClassLoader, which itself uses Class.forName to
find the correct protocol handler. Since forName tries
to create the system ClassLoader if it doesn't already
exist, and since with static linking the "file" URL
handler won't be linked in automatically (since nothing
explicitly references it), circularity results.
A workaround is to explicitly require the file URL
handler to be linked in (eg, using -u)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Java-prs
mailing list