From: John D. <Joh...@qs...> - 2001-08-27 04:40:55
|
Folks I'm writing a script to load all the classes in a java application, and have struck a problem when a subpackage has the same name (but with different case) as a class. For example, in package QSI.Payment we have sub-package cardenquiry, and class CardEnquiry. Then, when I try to import the class, I get the following stack trace: //c/src/server-release-1-2-patches$ jython Jython 2.1a3 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import QSI.Payment.cardenquiry.CardNumberEnquiry Traceback (innermost last): File "<console>", line 1, in ? java.lang.NoClassDefFoundError: QSI/Payment/cardenquiry (wrong name: QSI/Payment/CardEnquiry) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) at java.net.URLClassLoader.defineClass(URLClassLoader.java:248) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at org.python.core.SyspathJavaLoader.loadClass(SyspathJavaLoader.java) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at org.python.core.Py.findClassEx(Py.java) at org.python.core.SysPackageManager.findClass(SysPackageManager.java) at org.python.core.PackageManager.findClass(PackageManager.java) at org.python.core.SysPackageManager.findClass(SysPackageManager.java) at org.python.core.PyJavaPackage.__findattr__(PyJavaPackage.java) at org.python.core.PyObject.impAttr(PyObject.java) at org.python.core.imp.import_next(imp.java) at org.python.core.imp.import_logic(imp.java) at org.python.core.imp.import_name(imp.java) at org.python.core.imp.importName(imp.java) at org.python.core.ImportFunction.load(__builtin__.java) at org.python.core.ImportFunction.__call__(__builtin__.java) at org.python.core.PyObject.__call__(PyObject.java) at org.python.core.__builtin__.__import__(__builtin__.java) at org.python.core.imp.importOne(imp.java) at org.python.pycode._pyx1.f$0(<console>:1) at org.python.pycode._pyx1.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java) at org.python.core.PyCode.call(PyCode.java) at org.python.core.Py.runCode(Py.java) at org.python.core.Py.exec(Py.java) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java ) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java ) at org.python.util.InteractiveConsole.push(InteractiveConsole.java) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java) at org.python.util.jython.main(jython.java) java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: QSI/Payment/cardenquiry (wrong name: QSI/Payment/CardEnquiry) >>> It appears that jython is trying to import each of the packages first. Can anyone point me in the right direction on this? Am I missing something simple? Cheers ............... JohnD do { nothing() } while ( ! hearFromMe ); John Dickson Architect QSI Payments, Inc Ph: +61-7-3224 9806 Fax: +61-7-3210 2566 Email: mailto:joh...@qs... URL: http://www.qsipayments.com/ _____________________________________________ QSI Payments, Inc Level 22 300 Adelaide Street BRISBANE, QLD, AUSTRALIA 4000 This message or any part of it is intended solely for the named addressee and contains privileged and confidential information. If you receive this message in error please notify QSI Payments, Inc by replying to the sender and removing the message from your computer. |