JDK-8204862 : Java atk wrapper does not load any more
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 10.0.1,11
  • Priority: P3
  • Status: Closed
  • Resolution: External
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2018-06-11
  • Updated: 2018-06-13
  • Resolved: 2018-06-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11Resolved
Description
ADDITIONAL SYSTEM INFORMATION :
Linux Debian, the issue starts with openjdk 9, and happens with 10 and 11 too.

A DESCRIPTION OF THE PROBLEM :
Hello,

On Debian-based systems (ubuntu notably), the java atk wrapper can not be loaded any more, and thus applications are completely inaccessible.

Things used to work in openjdk8 this way:

- conf/accessibility.properties contains
assistive_technologies=org.GNOME.Accessibility.AtkWrapper
- $JVM/jre/lib/ext contains links to java-atk-wrapper.jar and libatk-wrapper.so

But apparently the ext mechanism was removed in openjdk9, thus breaking this completely. Apparently it is replaced by the platform loader, but how can we make the platform loader load java-atk-wrapper.jar?

Samuel

REGRESSION : Last worked in version 8u172

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Have conf/accessibility.properties contain

assistive_technologies=org.GNOME.Accessibility.AtkWrapper

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Java applications should start fine.
ACTUAL -
Whatever the application, we get the following stack trace:

Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
	at java.desktop/java.awt.Toolkit.newAWTError(Toolkit.java:472)
	at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:488)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
	at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1608)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
	at java.desktop/java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:532)
	at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:613)
	at java.desktop/java.awt.Window.getToolkit(Window.java:1375)
	at java.desktop/java.awt.Window.init(Window.java:518)
	at java.desktop/java.awt.Window.<init>(Window.java:549)
	at java.desktop/java.awt.Frame.<init>(Frame.java:423)
	at java.desktop/javax.swing.JFrame.<init>(JFrame.java:224)
	at show_java.<init>(show_java.java:5)
	at show_java.main(show_java.java:9)
Caused by: java.lang.ClassNotFoundException: org.GNOME.Accessibility.AtkWrapper
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:374)
	at java.desktop/java.awt.Toolkit.fallbackToLoadClassForAT(Toolkit.java:485)
	... 18 more

While there is java-atk-wrapper.jar in /usr/share/java.

---------- BEGIN SOURCE ----------
Any java application has the issue.
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Setting

export CLASSPATH=/usr/share/java/java-atk-wrapper.jar

makes the atk wrapper loadable, but that's not something we can do on the whole distribution :)

FREQUENCY : always



Comments
This is a consequence of the JPMS. ATK will need to be reimplemented as a Service Provider, to be loaded by java.util.ServiceLoader. In order to do this it must provide an SPI which extends javax.accessibility.AccessibilityProvider See https://docs.oracle.com/javase/10/docs/api/java/awt/Toolkit.html#getDefaultToolkit() and https://docs.oracle.com/javase/10/docs/api/javax/accessibility/AccessibilityProvider.html
13-06-2018

is it introduced in 11 / 10.0.1 ?
13-06-2018

Sharing additional information with complete reproduction scenario/steps as shared by the submitter confirming that the issue reproduces for him and started appearing with open jdk 9 and onward.. ================================================================================= I can reproduce it with my Debian buster system and Ubuntu 16.04 for instance. Just to make sure: Ubuntu 16.04 uses openjdk-8 by default. The problem appeared with openjdk-9. Just to be sure on the reproduction scenario with ubuntu 16.04: - downloaded ubuntu-16.04.4-desktop-amd64.iso from http://releases.ubuntu.com/16.04/ - Installed with default parameters - sudo apt-get install openjdk-9-jdk - sudo mkdir /usr/lib/jvm/java-9-openjdk-amd64/conf - sudo ln -s /etc/java-9-openjdk/accessibility.properties /usr/lib/jvm/java-9-openjdk-amd64/conf/ - /usr/lib/jvm/java-9-openjdk-amd64/bin/javac test.java - /usr/lib/jvm/java-9-openjdk-amd64/bin/java test (the mkdir and ln -s lines are what ubuntu was supposed to have done to properly enable the java atk wrapper with assistive_technologies=org.GNOME.Accessibility.AtkWrapper) ====================================================== Ubuntu 18.04 reported the issue with openjdk-11 too.
13-06-2018

As per description, on Debian-based systems, like Ubuntu, the Java atk wrapper fails to load making applications completely inaccessible. Checked this with attached test case and respective Oracle JDK versions, but couldn't reproduce the issue as reported. Results: =========== 8u172: OK 10.0.1: Ok OpenJDk 10.0.1: OK 11 ea b17: OK Writing back to the submitter with results requesting detailed information.
12-06-2018