Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
12.3
Description
I've found out that my platfom application does not work at all with HTTP protocol when run on JDK 16. The error thrown is:
INFO [org.netbeans.modules.autoupdate.updateproviders.AutoupdateCatalogFactory]: Unknown protocol: http
java.lang.IllegalStateException: Unknown protocol: http
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandlersStreamHandlerProxy.java:373)
at java.base/java.net.URL.<init>(URL.java:701)
Caused: java.net.MalformedURLException: Unknown protocol: http
at java.base/java.net.URL.<init>(URL.java:706)
at java.base/java.net.URL.<init>(URL.java:568)
at java.base/java.net.URL.<init>(URL.java:515)
[catch] at org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider(AutoupdateCatalogFactory.java:98)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.netbeans.core.startup.layers.BinaryFS$AttrImpl$MethodAndParams.invoke(BinaryFS.java:730)
at org.netbeans.core.startup.layers.BinaryFS$AttrImpl.getValue(BinaryFS.java:660)
at org.netbeans.core.startup.layers.BinaryFS$BFSBase.getAttribute(BinaryFS.java:506)
No URL with http(s): protocol can be even parsed.
I managed to isolate the issue - it is caused by Apache Felix library included in NB platform that provides org.osgi.framework.launch.FrameworkFactory token.
The bug does not occur in NetBeans IDE, which has a direct dependency (Needs: declaration) on org.netbeans.netbinox module from its ide.kit module. In NetBeans, Netbinox loads and installs its URLStreamHandlerFactory (org.eclipse.osgi.framework.internal.protocol.StreamHandlerFactory)
In a platform app that does not load (need) Netbinox, the Felix library installs its own URLStreamHandleFactory ( org.apache.felix.framework.URLHandlers), that creates proxies. So USHF for http is actually created, but it afterwards throws MalformedURLException on any http: url spec.
The bug does not occur on earlier JDKs.
Attachments
Issue Links
- relates to
-
NETBEANS-5500 URLStreamFactory registration violates JDK9+ reflection restrictions
- Open
- links to