PreviousNextTracker indexSee it online !

(193/240) 3912 - Crashes with JDK9

jEdit 5.3pre1 does no longer work with early access releases of JDK9. Last known good is 1.9.0-ea-b52. Since there have been changes to class and resource loading in JDK9, this is most likely going to be a permanent problem and requires changes in jEdit. The most severe problem seems to be with icon loading, especially on the Event Dispatch Thread (EDT), aka "AWT-EventQueue-0". If this takes time to fix properly, could someone please implement some workaround to get jEdit 5.3pre1 up and running again (sans icons)?

Here are some of the exceptions:


10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: Icon not found: 32x32/apps/jedit.png
10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: java.net.MalformedURLException: unknown protocol: jeditresource
10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: at java.net.URL.<init>(URL.java:597)
10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: at java.net.URL.<init>(URL.java:487)
10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: at java.net.URL.<init>(URL.java:436)
10:47:49 [AWT-EventQueue-0] [error] GUIUtilities: at org.gjt.sp.jedit.GUIUtilities.loadIcon(GUIUtilities.java:158)



10:47:49 [AWT-EventQueue-0] [error] BeanShellFacade: java.lang.NullPointerException
10:47:49 [AWT-EventQueue-0] [error] BeanShellFacade: at org.gjt.sp.jedit.GUIUtilities.getEditorIcon(GUIUtilities.java:181)
10:47:49 [AWT-EventQueue-0] [error] BeanShellFacade: at org.gjt.sp.jedit.gui.tray.JEditSwingTrayIcon.<init>(JEditSwingTrayIcon.java:60)



10:47:50 [main] [error] JARClassLoader: java.net.MalformedURLException: unknown protocol: jeditresource
10:47:50 [main] [error] JARClassLoader: at java.net.URL.<init>(URL.java:597)
10:47:50 [main] [error] JARClassLoader: at java.net.URL.<init>(URL.java:487)
10:47:50 [main] [error] JARClassLoader: at java.net.URL.<init>(URL.java:436)
10:47:50 [main] [error] JARClassLoader: at org.gjt.sp.jedit.JARClassLoader.getResource(JARClassLoader.java:175)

10:47:50 [main] [error] String: Unable to access resource: /console/commands/ant.xml


10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: Exception in thread "AWT-EventQueue-0"
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: java.lang.NullPointerException
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.GUIUtilities.getEditorIcon(GUIUtilities.java:181)
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.View.<init>(View.java:1336)
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.jEdit.newView(jEdit.java:2553)
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.PerspectiveManager$PerspectiveHandler.endElement(PerspectiveManager.java:363)

10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.util.XMLUtilities.parseXML(XMLUtilities.java:140)
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.SettingsXML.load(SettingsXML.java:155)
10:47:53 [AWT-EventQueue-0] [error] AWT-EventQueue-0: at org.gjt.sp.jedit.PerspectiveManager.loadPerspective(PerspectiveManager.java:107)

Submitted will69 - 2015-03-25 10:25:08.523000 Assigned
Priority 5 Labels JDK9
Status open Group severe bug
Resolution remind

Comments

2015-04-09 14:25:47.979000
will69

Java 1.9 requires a service provider to register an URL stream handler. See [java.net.spi.URLStreamHandlerProvider](http://download.java.net/jdk9/docs/api/java/net/spi/URLStreamHandlerProvider.html) and [bug #8064924](https://bugs.openjdk.java.net/browse/JDK-8064924) as well as [changeset 11480:a4e47f145dda](http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a4e47f145dda).

The two attached files can be used to add such a provider and make jEdit work with Java 1.9 again. Older versions of Java will continue to work with this change.

Until one of the developers includes this change, you can put the files in their designated places parallel to jedit.jar (see file header) and patch as follows:

javac -cp jedit.jar org/gjt/sp/jedit/proto/jeditresource/Provider.java
jar uvf jedit.jar META-INF org

2015-04-09 14:29:51.401000
will69

See attached files…

Provider.java (656B)

java.net.spi.URLStreamHandlerProvider (106B)

2015-05-17 19:58:01.134000
ezust

I am confused about the 2nd attachment, is it really a one-liner?
Could you please submit a proper patch to the jedit patches tracker as a separate ticket to address this issue?

2015-05-20 09:12:30.663000
kpouer

I just installed jdk 9: jdk-9-ea-bin-b64-windows-x64-13_may_2015.tar.gz
and have no problems, was jEdit fixed, or maybe a change was done in JDK 9 ?

2015-05-20 22:24:34.716000
ezust

Nothing was done to jEdit to fix this issue, so since your newer early access works, I can assume this was an issue that was fixed in JDK and we can close this ticket, unless someone else can reproduce it?

2015-05-20 22:24:52.817000
ezust

- **status**: open --> pending-works-for-me

2015-05-21 14:52:51.698000
will69

Yes, it is a one-liner. It's just a direct referral mechanism. By putting that one liner (2nd file) into the special META-INF folder, you tell Java where to find the provider (1st file) and the provider supplies an instance of the actual URL stream handler for "jeditresource:". This is probably faster than the old way of searching the URL stream handler among all files on the class path.

I might do a patch. I never did one, though, and it might take some time.

2015-05-21 15:05:51.764000
will69

Apparently somebody got cold feet and Chris Hegarty put some old code back in, see [bug #8075139](https://bugs.openjdk.java.net/browse/JDK-8075139). Both the new service provider mechanism and the old way of searching through classes work with Java 1.9.0-ea-b64.

2015-05-21 15:20:54.583000
will69

You might still want to use the new service provider mechanism since it eliminates the need to search all classes for the "jeditresource:" URL stream handler and might improve startup time. It will also be compatible with modules, which is why they did the change in the first place. Your call.

2016-05-05 10:24:53.928000
kerik-sf

- **assigned_to**: Eric Le Lay

2016-05-05 10:24:54.265000
kerik-sf

I'll test the addition of the META-INF file as an optimization.

2016-05-08 14:39:55.777000
kerik-sf

- **status**: pending-works-for-me --> open-remind
- **assigned_to**: Eric Le Lay --> nobody

2016-05-08 14:39:56.327000
kerik-sf

URLStreamHandlerProvider is new in java9, so we can't compile it with java7, which is current minimal version.

However, the Provider class you wrote works fine.
We would activate it by adding
~~~
<service type="java.net.spi.URLStreamHandlerProvider"
provider="org.gjt.sp.jedit.proto.jeditresource.Provider"/>
~~~

to the jar task in `build.xml` so the URLStreamHandlerProvider file is not required.

So I mark it as open-remind and tagged with JDK9, for when we move to this version.

Thanks,