Hi,

I want to add some libraries dynamically on the fly so that I can use those

methods of classes from the libraries.

For that, Ive made changes before initializing PySystemState (PySystemState.initialize())

for python.packages.paths key value to contain my own path (say, myproj.path) also

to the default java.class.path,sun.boot.class.path.

The value is set for myproj.path and exported to the system properties

using System.setProperty( myproj.path, c:\apps\MyProj-1.0.jar ).

SysPackageManager.java is picking up my jar file also as part of

addClasspath( registry.getProperty( myproj.path ) ) method and it proceeds

further also to process the jar file to get the packages and classes in it as shown below:

-----Clip-----

[jython] *sys-package-mgr*: processing new jar, 'C:\Software\lib\java\ant-apache-bsf.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Software\lib\java\ant-apache-log4j.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Software\lib\java\ant-apache-oro.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Software\lib\java\ant-apache-resolver.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Software\lib\java\ant-commons-logging.jar'

..

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\rt.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\sunrsasign.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\jsse.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\jce.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\charsets.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\APPS\MyProj-1.0.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\ext\dnsns.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\ext\ldapsec.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\ext\localedata.jar'

[jython] *sys-package-mgr*: processing new jar, 'C:\Program Files\Java\j2re1.4.2_12\lib\ext\sunjce_provider.jar'

……

-----Clip-----

But then, when the code calls the methods of the classes of MyProj-1.0.jar,

then it complains that it doesnt find them.

If the jar file is set to the classpath before starting jython, then interestingly everything

works fine without any problems.

So my doubt is why jython is unable to find the classes in the processed jar file C:\APPS\MyProj-1.0.jar.

I couldnt locate what is wrong there.

Any help on this is appreciated.

BR,

- Vamsi.