From: Frank C. <fc...@pu...> - 2002-04-22 18:49:43
|
I am having a problem accessing a Java class from Jython. The class is in a package named: net.testnet Here's the class: package net.testnet; public class testit{ public testit() { System.out.println("I'm ready"); } public String drinkme() { return "That was good."; } } I compile testit and put it into testnetwork.jar. I DO NOT put testnetwork.jar onto the classpath when running Jython. I need Jython to recognize a jar file after Jython starts running. From the Jython 2.1 interpreter I run these commands: import sys sys.path.append('e:\\testnetwork\\lib\\testnetwork.jar') import net print dir(net.testnet) ['__name__', 'testit'] a=net.testnet.testit() AttributeError: java package 'net.testnet' has no attribute 'testit' Jython does not throw this AttributeError when testnetwork.jar IS on the classpath. The a object is instantiated correctly. Any ideas what is going wrong? -Frank -- Frank Cohen, CEO, PushToTest, www.pushtotest.com, phone: 408 374 7426 Come to PushToTest for free open-source Active Security solutions that test, monitor and automate Web Service systems for functionality, scalability and performance. |