This discussion is archived
2 Replies Latest reply: Aug 6, 2013 1:19 AM by fb13a297-ad02-4562-999e-b51dc2b7b7d5 RSS

sun.awt.AppContext is null with jre7u25 applet

940107 Newbie
Currently Being Moderated

Our applet worked well until java u25 update.


The problem comes when we call javax.imageio.ImageIO :


at Source)

Caused by: java.lang.NullPointerException

at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)

at javax.imageio.ImageIO.<clinit>(Unknown Source)

... 3 more

Exception in thread "Thread-126"

Date : Mon Jun 24 18:56:37 CEST 2013

java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO


In ImageIO, the first static declaration is : private static final IIORegistry theRegistry = IIORegistry.getDefaultInstance();


IIORegistry.getDefaultInstance() is doing :


  AppContext context = AppContext.getAppContext();
  IIORegistry registry = (IIORegistry)context.get(IIORegistry.class);

But AppContext.getAppContext returns null !!

In standalone application AppContext.getAppContext = sun.awt.AppContext[threadGroup=system] and we don't have the problem.

In applet (jnlp), AppContext.getAppContext is always null.

Does anyone know a workaround ?

Is it a known bug with jre7u25 ?

thank you