From: marcel l. <m_...@ya...> - 2007-12-01 19:57:08
|
Hi there, I ran into an issue with Jython's "convenience" java methods. Consider this example: [mliker@jbox1 ~]$ ./rlwrap jython/jython Jython 2.2.1 on java1.4.2_08 Type "copyright", "credits" or "license" for more information. >>> from weblogic.jndi import Environment >>> server, user, password = 'server', 'user', 'password' >>> env = Environment(providerUrl = 't3://' + server + ':80', securityPrincipal = user, securityCredentials = password) >>> env.getInitialContext().lookup("javax.jms.QueueConnectionFactory") weblogic.jms.client.JMSXAConnectionFactory@1d226a7 however: [mliker@box1 ~]$ ./rlwrap jython/jython Jython 2.2.1 on java1.4.2_08 Type "copyright", "credits" or "license" for more information. >>> from weblogic.jndi import Environment >>> server, user, password = 'server', 'user', 'password' >>> env = Environment(providerUrl = 't3://' + server + ':80', securityPrincipal = user, securityCredentials = password) >>> env.initialContext.lookup("javax.jms.QueueConnectionFactory") Traceback (innermost last): File "<console>", line 1, in ? AttributeError: 'NoneType' object has no attribute 'lookup' while in jython2.2 it works as expected: [mliker@box1 ~]$ ./rlwrap jython2.2/jython Jython 2.2 on java1.4.2_08 Type "copyright", "credits" or "license" for more information. >>> from weblogic.jndi import Environment >>> server, user, password = 'server', 'user', 'password' >>> env = Environment(providerUrl = 't3://' + server + ':80', securityPrincipal = user, securityCredentials = password) >>> env.initialContext.lookup("javax.jms.QueueConnectionFactory") weblogic.jms.client.JMSXAConnectionFactory@adff2f Is this a feature or a bug? If somebody could also shed some light on how does jython provide these "convenience" methods as I have come across instances where not all java methods would have a jython "convenience" method Marcel Looking for a X-Mas gift? Everybody needs a Flickr Pro Account. http://www.flickr.com/gift/ |