Hi,
After quite some debugging and code digging - the ultimate documentation ;-) I found the reason why I was getting the following error message:
Cannot find TOMSnmpDevice
Although the source for this class was indeed defined in jde-db-source-directories, as required per the function documentation. Turns out that as a first step jde-show-class-source uses bsh to get the qualified class name, via the method call jde.util.JdeUtilities.getQualifiedName(className). This method uses the bsh classpath (initialized from jde-global-classpath) to expand the argument, so if that class (yes, it has to be compiled) is not in a jar or directory specified in the bsh classpach, getQualifiedName will fail and you will get the error message above.
If, on the other hand, the class is accessible through the bsh classpath, but the source is not accessible from in jde-db-source-directories, then the error message is:
Starting the BeanShell. Please wait...
JDE error: Could not find source for tom.TOMSnmpDevice. See `jde-db-source-directories' for more information.
All this information to provide background for a suggestion and a question:
1) I think that the documentation of jde-show-class-source should be more specific on the dependency on jde-global-classpath. Maybe the User Guide mentions it and if that is the case I apologize. But it took me quite a while to figure out that the problem was not with my `jde-db-source-directories', but with jde-global-classpath. A more descriptive error message would have been quite helpful.
2) Switching projects do not kill and restart bsh, which means that it will still use the classpath specified by the first project. So jde-show-class-source calls will fail if made on classes on the second project that are not part of the classpath of the first (even though jde-global-classpath is updated, the bsh classpath is not).
Is there any chance to change jde.util.JdeUtilities.getQualifiedName() to use the current value of jde-global-classpath instead of the bsh classpath? I think it would solve this problem - and other related problems as well.
Thanks,
Nascif
