java.util.logger.Logger.getAnonymousLogger()引发NullPointerException [英] java.util.logger.Logger.getAnonymousLogger() throws NullPointerException

查看:361
本文介绍了java.util.logger.Logger.getAnonymousLogger()引发NullPointerException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将Java插件升级到1.7.0_25,这导致了我几年前编写的applet(并一直保持至今)的致命错误.

I just upgraded my Java plugin to 1.7.0_25, which caused a fatal error with an applet I wrote several years ago (and have been maintaining since).

我早在applet的init()方法中调用

Early in the applet's init() method I call

logger = Logger.getAnonymousLogger();

此调用自Java 1.4.2开始一直运行,没有问题.现在,使用Java 1.7.0_25(至少在Windows 7上;我没有在此进行测试的Mac或Linux机器),第一次加载applet时,它就可以正常工作.但是,如果关闭了小程序的浏览器页面并再次加载了该页面,则该小程序将失败,并显示以下控制台消息:

This call has been running since Java 1.4.2 without a problem. Now, with Java 1.7.0_25 (on Windows 7 at least; I've no Mac or Linux machine to test with here), the first time the applet is loaded, it works just fine. However if the applet's browser page is closed and the page loaded again, the applet fails with the following console message:

basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 756747 us, pluginInit dt 76093467 us, TotalTime: 76850214 us java.lang.NullPointerException
    at java.util.logging.Logger.doSetParent(Unknown Source)
    at java.util.logging.Logger.getAnonymousLogger(Unknown Source)
    at java.util.logging.Logger.getAnonymousLogger(Unknown Source)
    at com.optix.applet.viewer.ObjectViewer.init(ObjectViewer.java:214)
    at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Ignored exception: java.lang.NullPointerException

要再次加载小程序,我必须关闭并重新启动浏览器.

To load the applet again, I must close and restart the browser.

自从Java 1.4引入java.util.logger以来,以前的任何Java版本都从未发生过这种情况.

This has never happened with any previous Java release since java.util.logger was introduced in Java 1.4.

应该没有权限问题:我已经向META-INF/MANFEST.MF添加了新属性

There should be no permissions problem: I've added to META-INF/MANFEST.MF the new attributes

Permissions: all-permissions
Codebase: *

http://docs中要求. oracle.com/javase/7/docs/technotes/guides/jweb/no_redeploy.html . 该小程序已使用当前的GoDaddy证书签名并加了时间戳.

as called for in http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/no_redeploy.html. The applet is signed with a current GoDaddy certificate and timestamped.

我发现如果我使用创建记录器

I found that if I create the logger with

logger = Logger.getLogger(String);

小程序每次都会加载.

对于此错误,我什么也找不到.有人看过吗?谁会知道是什么导致它在Java 1.7.0_25中出现,或者为什么该调用在浏览器会话中只能运行一次而不能再次运行?

I can find nothing on this error. Has anyone seen it? Would anyone know what caused it to appear with Java 1.7.0_25 or why the call would work once in a browser session but not a second time?

推荐答案

我在Linux上有完全相同的问题.

I have exactly the same problem on Linux.

这是来自Oracle的相关错误报告.

This is the relevant bug report from Oracle.

这篇关于java.util.logger.Logger.getAnonymousLogger()引发NullPointerException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆