Re: [Py4j-users] Py4j and error - "Trying to call a package"
Status: Beta
Brought to you by:
barthe
From: Barthelemy D. <ba...@cs...> - 2012-06-15 08:54:55
|
Hi, Sorry about the delay in responding and thanks for using Py4J! The first line looks good except that you need to use the fully qualified name of the class containing the static method (unless the class is in the java.lang package). For example: lp = gateway.jvm.package1.package2.ConvertFunction.convert("") The error you are seeing seems to point into that direction as well. Barthélémy On 2012-06-13, at 6:25 AM, Disley, Jareth wrote: > Hello, > > I am having an issue calling a static method within a Java class and package from within Python. > > The background is that the method is declared static and has no constructor. I believe that the class / package has been imported correctly. > > I have tried all of the following approaches: > > Ip = gateway.jvm.class.ConvertFunction.convert(“10.10.0.0”) > > Klass = gateway.jvm.class.ConvertFunction() > Ip =Klass.convert(“10.10.0.0”) > > Klass = gateway.jvm.class.ConvertFunction > Ip =Klass.convert(“10.10.0.0”) > > Every time I get the “Trying to call a package” error. Which one of these methods is correct? > > Regards > Jareth Disley > > > -- > > > Queen's Award for Enterprise and Innovation 2011 > > Roke Manor Research Ltd > Romsey, Hampshire, SO51 0ZN, United Kingdom > http://www.roke.co.uk > > Part of the Chemring Group > Registered in England & Wales at: > Chemring Group PLC, Chemring House, 1500 Parkway, > Whiteley, Fareham, Hampshire PO15 7AF, England. > Registered No: 267550 > > The information contained in this e-mail and any attachments is > proprietary to Roke Manor Research Ltd and must not be passed to any > third party without permission. This communication is for information > only and shall not create or change any contractual relationship. > > Please consider the environment before printing this email > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > Py4j-users mailing list > Py4...@li... > https://lists.sourceforge.net/lists/listinfo/py4j-users |