Problem and question: Java webstarted app looking for its classes in base folder instead of ./lib.
As suggested in similar question at Java Web Start applications a
Thanks everyone for suggestions. It was Andrew hint to 'index the jars' which pointed me to the right direction...
Namely, the jars (produced my current IDE of choice, Netbeans) were indexed. However, the META-INF/INDEX.LIST within the main jar contained the references to other jars as if they were in current folder, next to the main jar.
JarIndex-Version: 1.0
WebStartSample.jar
webstartsample
SampleJavaLibrary.jar
newpackage
That resulted in jnlpClassLoader(), using the main index, and looking for jars in codebase url, while they actually resided under ./lib url subfolder.
This is how the correct index (recreated manually) looks:
JarIndex-Version: 1.0
WebStartSample.jar
webstartsample
lib/SampleJavaLibrary.jar
newpackage
To make the problem worst, such webstarted application would not fail, they would just look for classes/jars in wrong places first, and then eventually find them, presumably already loaded bu jnlp loader as described in original question.
Briefly, this IS related to Netbeans build and packaging procedure.
My immediate fix was disabling the jar indexing, and that resulted in correct and minimal network traffic, and greatly improved application initialization.
To do it in Netbeans, go to Tools->Options->Miscellaneous->Ant->Properties and add jar.index=false
Proper fix would be to make Netbeans index the jar correctly but that is the another question.
Again, thanks all for suggestions.
ps.