Closed tzjan closed 7 months ago
@tzjan thanks for reporting and analyzing. We will have a look. You may also provide a PR.
Question: Did you ever encounter this problem with earlier versions of OWS?
@janakmulani I can reproduce the error with OWS 1.8.0 and 1.9.1.
@tzjan Thanks for the feedback and the PR.
Thanks for the quick feedback
running: OpenWebstart 1.9.1 (icedtea-web-2.0.0-alpha29)
After an application update with a version increase of all our JNLP resources (including the extension), we have got the following NPE:
The code tries to lookup the new version 6.2.4 of the extension JNLP file
http://localhost:8080/webapp/jnlp.extension/common.jnlp
in the cache.recently_used.cache
contains 2 entries:The NPE is thrown at line
246
inCacheImpl.java
because one Cache entry doesn't contain a version information.https://github.com/AdoptOpenJDK/IcedTea-Web/blob/a3d166d595328bc6080667ef49c395054eed7ea6/core/src/main/java/net/adoptopenjdk/icedteaweb/resources/cache/CacheImpl.java#L241-L247
So why does 2 versions of the extension JNLP exists in the cache? It shouldn't because the extension is defined my JNLP file with a version number:
To understand this I rolled back to the former application version 6.2.3 and cleared the cache.
At first the following entry will be created in
private void initializeExtensions()
by/IcedTea-Web/core/src/main/java/net/sourceforge/jnlp/runtime/classloader/JNLPClassLoader.java
.recently_used.cache:
Looks fine. Later 'http://localhost:8080/webapp/jnlp.extension/common.jnlp' will be looked up again, but without version, see stack trace: https://github.com/AdoptOpenJDK/IcedTea-Web/blob/a3d166d595328bc6080667ef49c395054eed7ea6/core/src/main/java/net/adoptopenjdk/icedteaweb/jnlp/element/resource/ExtensionDesc.java#L134
This adds a versionless entry to the cache:
Unless the version is not changed this works fine, but when it changes
all.sort(versionComparator)
fails.Despite of having such a deep understanding of the application, I think 2 things should be changed:
The sorting should be fixed. I don't have a clue how it should be handled. A unversioned cache request, should only return unversioned candidates? A versioned cache request, should only return versioned candidates?
The 2nd lookup should use a version, if there is one. For this I can provide a pull request for a change, which works for me.
When only the 2nd one is applied the error is still there, when the cache looks like above.
Do you have any idea how this can be fixed?