You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by "William L. Thomson Jr." <wl...@o-sinc.com> on 2017/11/27 18:43:16 UTC

Gentoo packaging: unknown protocol: nbres

I have seen this a fair amount from searching. Though no clear
resolution. Seems this happens under a variety of conditions. Not just
my building from source in insane ways :)

I have 
META-INF/namedservices/URLStreamHandler/nbresloc/java.net.URLStreamHandler
META-INF/namedservices/URLStreamHandler/nbres/java.net.URLStreamHandler

But seems those are not being used or something is off. Those exist
in other jars exactly like that. But I am adding that manually for now.
It is not coming from the NamedServiceProcessorfor some reason.
I assume it should based on folder name, namedservices.

The other does generate service files, ServiceProviderProcessor

Here is the useful parts of the exception stack trace, but removed replaced with ...

WARNING [org.netbeans.core.projects.cache]
org.xml.sax.SAXException: java.net.MalformedURLException: unknown protocol: nbres
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.startElement(ParsingLayerCacheManager.java:210)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
        at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:746)
....
Caused: java.lang.IllegalStateException: Can't overwrite cause with org.xml.sax.SAXException: java.net.MalformedURLException: unknown protocol: nbres
        at java.base/java.lang.Throwable.initCause(Throwable.java:462)
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.createRoot(ParsingLayerCacheManager.java:159)
Caused: java.io.IOException
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.createRoot(ParsingLayerCacheManager.java:169)
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.store(ParsingLayerCacheManager.java:106)
[catch] at org.netbeans.core.startup.layers.LayerCacheManager$1Updater.run(LayerCacheManager.java:146)


-- 
William L. Thomson Jr.

Re: [Gentoo packaging] SOLVED: unknown protocol: nbres

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
I was missing files in META-INF. Each file has one line, which follows
the file/files below the contents.

In addition to these files, each of which has
META-INF/namedservices/URLStreamHandler/nbresloc/java.net.URLStreamHandler
META-INF/namedservices/URLStreamHandler/nbres/java.net.URLStreamHandler
org.netbeans.core.startup.NbResourceStreamHandler

I also needed
META-INF/namedservices.index
org.openide.util.URLStreamHandlerRegistration

and
META-INF/namedservices/java.net.URLStreamHandlerFactory
org.netbeans.modules.openide.util.ProxyURLStreamHandlerFactory

Those last two kicked in the first two. I had a an error in those,
accidentally had just NbResourceStreamHandler. Once I added the other
two files. Then I got an error /NbResourceStreamHandler. Which seeing
the contents of the first two I saw the mistake. Now the following
error is gone :)

On Mon, 27 Nov 2017 13:43:16 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> WARNING [org.netbeans.core.projects.cache]
> org.xml.sax.SAXException: java.net.MalformedURLException: unknown
> protocol: nbres at
> org.netbeans.core.startup.layers.ParsingLayerCacheManager.startElement(ParsingLayerCacheManager.java:210)



-- 
William L. Thomson Jr.