Bug#413116: jamvm issues with java.util.logging

Nicolas François nicolas.francois at centraliens.net
Fri Mar 16 01:47:14 CET 2007


Hello Michael,

On Thu, Mar 15, 2007 at 09:35:59AM +0100, Michael Koch wrote:
> 
> Well I consider "jamvm -cp Test.jar Test" and "jamvm -jar Test.jar" not
> working a major issue. If I wouldn't, we wouldn't need a fix for this.
> These two are the main usecases for every Java runtime and should just
> work.

I don't deny it's a bug;)

The (later) problem is caused by an exception thrown in LogManager.

jamvm do not support Exception before the end of the VM init.

I think this is a bug in jamvm, which considers it is still in the
initialization when it executes the main class (when the class comes from
a jar).

(I've not deeply investigated it, but it is probably the main thread which
is started too early, or jamvm should allow Exception even if the
initialization is not finished)
Feel free to clone and reassign the clone to jamvm.
I don't think this jamvm bug is critical.
It can be reproduced with:
=================================================
public class Test {
    public static void main(String argv[]) {
        try { throw new java.lang.Exception("foo"); }
        catch (Exception e) { System.out.println("catched"); }
    }
}
=================================================



As the original issue is solved by 0.92-4, I had a look at the diff
between 0.91-3 and 0.92-4. I don't think the upstream changes can be
backported to t-p-u.

In 0.91-3,
    new URL(url).openStream();
throws an exception when url is a non existent file. And no exceptions is
thrown with 0.92-4.

The changes involve java/net/URL* and gnu/java/net/loader/* (e.g.
gnu/java/net/loader/FileURLLoader.java do not throw an exception if the
file does not exist).

I don't think it's worth reviewing the upstream diff (diffstat indicate
~2kloc for the above mentioned files; which could probably be reduced, but
need a deep understanding of what is done), and LogManager can safely test
if the file exists and fall back with a default properties file if the
file is not found (see attached patch).

I consider this part of the patch as an hack, but it is safe, and fix the
`jamvm -jar Test.jar' use case.

Kind Regards,
-- 
Nekral
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classpath_logging_413116.2.patch
Type: text/x-diff
Size: 2138 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20070316/3610e55d/classpath_logging_413116.2.bin


More information about the pkg-java-maintainers mailing list