From: Brian Z. <bri...@ya...> - 2001-10-08 19:44:19
|
How about try: import pkgA f = pkgA.Foo() -Brian ----- Original Message ----- From: "Chris Gokey" <cg...@gc...> To: <jyt...@li...> Cc: "Dave Kendig" <dk...@gc...> Sent: Friday, October 05, 2001 9:02 AM Subject: [Jython-users] class conflict > Hi everyone, > > I'm seeing some strange behavior when running jython servlets from > Tomcat 4. Not sure where the source of the error is but I'll try to > explain. > > I have 2 classes and they both have the same name but our in different > packages, ie., something like this: > > pkgA.Foo > pkgB.Foo > > These two classes are different implementation-wise, but they both have > the same name. > > The code I have very explicity refers to pkgA.Foo: > > from pkgA import Foo > f = Foo() > > but for some reaon it is using pkgB.Foo. > > Now, since this is all loaded under the Tomcat virtual machine, it it > possible that pkgA.Foo did get loaded into memory, so somehow maybe it > overwrote the pkgB.Foo when it was loaded by another application? > > I noticed this behavior because I was getting all kinds of errors when > the application was loading and executing the wrong Foo. Then when I > restarted the Tomcat server everything worked fine. > > I'm wondering is it possible to explicitly use a class from a particular > package like this: > > str = java.lang.String() > > This can be done in Java, can this be done in python? > > Hopefully this makes some sense to someone :) > > Chris > > > > -- > __________________________________________________ > /\ > > \ > \_| Christopher D. Gokey, SSAI, NASA/GCMD | > | 18 Martin Road, Shelburne Falls, MA 01370 | > | Phone: Voice (413) 625-8129 / FAX 208-248-9055 | > | cg...@gc... / http://gcmd.nasa.gov | > | ICQ #52132386, AOL IM: chrisgokey | > | _____________________________________________|_ > \_/______________________________________________/ > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |