[weld-dev] jandex not used on JNLP applications (Windows)

Robert Marcano robert at marcanoonline.com
Thu Jan 15 09:17:26 EST 2015


Greetings, I am new to using Weld on an Java SE environment, trying to 
optimized the container initialization, I got help on the developer IRC 
channel telling me to add jandex as a dependency. I found that jandex 
indexes could be embedded on jars so I did that. for some reason I got 
worse times after adding the dependency. The problem is that Oracle 
WebStart implementation doesn't store cached Jar files with the jar 
extension anymore.

JandexIndexBeanArchiveHandler is looking for path with the .jar ending 
to detect if it is a Jar or directory path [1]. Changing that line to:

> if (urlPath.toLowerCase().endsWith(".jar") || new File(urlPath).isFile())

This solve the problem and now the embedded jandex indexes are used (log 
confirmed) on Oracle WebStart implementation. I am not sure about just 
using:

> if (new File(urlPath).isFile())

I think that checking for the .jar ending is redundant, opinions before 
submitting a patch?

Note: I still have a problem with IcedTea NetX where 
JandexIndexBeanArchiveHandler get the http url of the jar file, it 
doesn't get a path to the local cached file. Any guide of where I should 
look at on Weld source code is welcome.


[1] 
https://github.com/weld/core/blob/master/environments/common/src/main/java/org/jboss/weld/environment/deployment/discovery/jandex/JandexIndexBeanArchiveHandler.java#L122


More information about the weld-dev mailing list