This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 130618 - nbjcl protocol breaks 3rd party library
Summary: nbjcl protocol breaks 3rd party library
Status: RESOLVED DUPLICATE of bug 129772
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-20 10:42 UTC by sreimers
Modified: 2008-12-23 14:32 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sreimers 2008-03-20 10:42:17 UTC
Sorry to report this issue since I love the speed up, but a 3rd party library we are using (closed source) is especially
looking for the "file" or "jar" protocol using equals on string basis. This fails miserably with NetBeans 6.1 due to the
invention of nbjcl. Since the code in question is used to determine the location and existence of a license file we can
actually not upgrade our RCP platform from 6.0 to 6.1 versions. Is it possible to have any workaround for such use
cases? Perhaps declaring some URL's to not be "cached"? We are still hoping that the library provider will create a
patch for compatibility with NetBeans 6.1 but we so far have no reaction on our request.

Any ideas?
Comment 1 Lukas Hasik 2008-03-20 11:14:44 UTC
seems like duplicate of 129772. 
Please look at the comments in the duplicate issue and reopen this one if your questions haven't been answered.



*** This issue has been marked as a duplicate of 129772 ***
Comment 2 sreimers 2008-03-20 11:48:15 UTC
No this is not a duplicate. I read the issue before filing a new one. 

In this case the URL accessing code is inside a 3rd party library. I cannot change the code, there is no other API. It
is just used in some mechanism inside the library. This mechanism is now broken. No way for me to change this other than
trying here or the third party library vendor. 

So as you can easily see I have no option to circumvent the problem. So where do we go from here?
Comment 3 Jesse Glick 2008-03-20 21:46:25 UTC
Although he is no longer working on this code, Petr can comment whether any fix on the NB side is feasible.
Comment 4 Petr Nejedly 2008-03-31 10:22:31 UTC
1. There is always the possibility of switching back to jar: protocol and hijack the JDK's handler.
2. We can probably quite easily introduce a property that would disable the cache as whole.
3. We can also introduce a manifest tag that would disable the cache for single module.
4. You can probably load the library through your own class loader instead of usual module class path extension, but
I'm not sure how would you publish the library for other modules.

So if 4. is still not an option, 2, 1, 3 would be my order of preference.

Comment 5 sreimers 2008-03-31 16:44:20 UTC
Sorry, but 4 is not an option (as you already guessed). 

ad 1. sounds like a hack but should provide out of the box compatibility
ad 2. sounds reasonable (easy to implement, low risk) but would sacrifice the speed gain just because of one
"incompatible" library. 
ad 3. maybe most clean solution, but perhaps to late in 6.1 development cycle to introduce additional manifest tag

So my order of preferences would be 3, 1, 2.
Comment 6 sri 2008-03-31 20:20:19 UTC
any updates on nbjcl issue. i am stuck on this for a while and cannot seem to progress. any quick fix would really help.

thanks
sri
Caused by: java.io.FileNotFoundException: nbjcl:file:/C:/Temp2/MySuite/build/cluster/modules/moduleA.jar!/
        at org.netbeans.JarClassLoader$ResURLConnection.connect(JarClassLoader.java:844)
        at org.netbeans.JarClassLoader$ResURLConnection.getInputStream(JarClassLoader.java:869)
        at java.net.URL.openStream(URL.java:1009)
        at org.apache.openjpa.lib.util.J2DoPrivHelper$39.run(J2DoPrivHelper.java:825)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.openjpa.lib.meta.URLMetaDataIterator.getInputStream(URLMetaDataIterator.java:67)
        at org.apache.openjpa.lib.meta.ClassArgParser.parseTypeNames(ClassArgParser.java:243)
Comment 7 Jesse Glick 2008-04-02 17:51:37 UTC
Please do not reopen.

*** This issue has been marked as a duplicate of 129772 ***
Comment 8 sreimers 2008-04-02 19:39:49 UTC
Why does this got closed as duplicate? It definitly is not as the ongoing discussion showed.

Please provide more details!! 

Thanks 

Sven
Comment 9 Jesse Glick 2008-04-03 03:20:28 UTC
Same issue as #129772, just a different reason for wanting it fixed.
Comment 10 sreimers 2008-04-03 07:32:13 UTC
So I am depending on my 3rdparty software vendor to fix it in his closed source, commercial of the shelf application?

Sounds real bad for me.
Comment 11 Quality Engineering 2008-04-29 04:19:14 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #164 build
Changeset: http://hg.netbeans.org/main/rev/7ccf89a50f5f
User: Jesse Glick <jglick@netbeans.org>
Log: Using "jar" protocol instead of "nbjcl" protocol, delegating to the JRE's regular handler where necessary.
Corresponds to option #1 of issue #130618.
Comment 12 Quality Engineering 2008-12-23 14:32:10 UTC
This issue had *1 votes* before move to platform component