loading all class path entries( +pom dependencies ) for web sphere server using FastClasspathScanner

3 views
Skip to first unread message

mahesh boggala

unread,
Jul 21, 2017, 11:18:46 AM7/21/17
to FastClasspathScanner-Users
Hi Lukehutch ,

we are trying to use FastClasspathScanner to read all class path entries in web sphere  application server.
but observed that it returning only below 8 web sphere related jars as a result from scanResult

we added few maven dependencies in pom.xml (including fast-classpath-scanner)and expecting to get those jars also as part of scanResult.
below is the code used. any thing wrong from my side? even registered WebsphereLibertyClassLoaderHandler.
appreciate your help.

ScanResult output:

 C:\My Program Files\IBM\Websphere855\profiles\NBO_FOO\properties
 C:\My Program Files\IBM\Websphere855\properties
 C:\My Program Files\IBM\Websphere855\lib\startup.jar
 C:\My Program Files\IBM\Websphere855\lib\bootstrap.jar
 C:\My Program Files\IBM\Websphere855\lib\lmproxy.jar
 C:\My Program Files\IBM\Websphere855\lib\urlprotocols.jar
 C:\My Program Files\IBM\Websphere855\deploytool\itp\batchboot.jar
 C:\My Program Files\IBM\Websphere855\deploytool\itp\batch2.jar


code used:

FastClasspathScanner fastClasspathScanner = new FastClasspathScanner();
WebsphereLibertyClassLoaderHandler websphereLibertyClassLoaderHandler =new WebsphereLibertyClassLoaderHandler();
fastClasspathScanner.registerClassLoaderHandler(websphereLibertyClassLoaderHandler.getClass());
ScanResult scanResult = fastClasspathScanner.scan();

List<File> list = scanResult.getUniqueClasspathElements();
List<String> result = scanResult.getNamesOfAllClasses();
List<String> s = scanResult.getNamesOfAllStandardClasses();


Thank you,
Mahesh.

mahesh boggala

unread,
Jul 21, 2017, 4:44:39 PM7/21/17
to FastClasspathScanner-Users
Hi Luke,
attached  verbose log.

My requirement is to scan  ".class" files from only  Service-30.0.0-SNAPSHOT.jar.
i see above jar file displayed in verbose log but its not getting as response from Scan Result.

Thanks,
Mahesh.
verbose-log.txt

Luke Hutchison

unread,
Sep 3, 2017, 7:07:20 AM9/3/17
to FastClasspathScanner-Users
Hi Mahesh,

Sorry for the delayed response, I forgot to post here that I created a bug for this:


Please test with version 2.4.5 of FastClasspathScanner, it adds support for com.ibm.ws.classloader.CompoundClassLoader, which may be the only one you need to support to get your code working. Please let me know if this fixes the issue for you.

Also, re. your code snipped -- you don't need to register any of the ClassLoaderHandlers included with FCS, they are registered automatically for you.


Luke Hutchison

unread,
Sep 3, 2017, 7:51:20 AM9/3/17
to FastClasspathScanner-Users
Hi Mahesh,

All four of the ClassLoaders that your code was not able to find are now supported in version 2.4.6 of FastClasspathScanner, just released. Please let me know if it works for you.

Thanks,
Luke

Luke Hutchison

unread,
Sep 3, 2017, 11:10:14 AM9/3/17
to FastClasspathScanner-Users
Sorry, try 2.4.7, not 2.4.6. (Had to do a bugfix release, the patch in 2.4.6 was wrong.)
Reply all
Reply to author
Forward
0 new messages