Re: What extra argument is needed for java method call?

Häyrinen, Ari <[email protected]> Wed, 20 Jul 2016 08:20:46 +0000
Newsgroups gmane.comp.lang.jython.user
Message-ID <[email protected]>
Thanks for reply!

I tried to instantiate it but I got "No visible constructors for class (org.dspace.eperson.service.GroupService) "
So it is private? Is setting respectJacaAccessibility to false only option?

python.security.respectJavaAccessibility = false

Sorry about newbie questions, my java knowledge is very poor.


________________________________
Lähettäjä: Stefan Eletzhofer [[email protected]]
Lähetetty: 20. heinäkuuta 2016 10:58
Vastaanottaja: Häyrinen, Ari; [email protected]
Aihe: Re: [Jython-users] What extra argument is needed for java method call?

Hi,

to me it looks like the GroupService wasn't instantiated.  The findByName() is not a class method.

The error message hints that way — self is an implicit 1st argument.

Mit freundlichen Grüßen // With best regards // Med vennlig hilsen

Stefan Eletzhofer
nexiles GmbH
Birkenweg 12/3
88250 Weingarten

tel: +49 (751) 270 856-50
fax: +49 (751) 270 856-51
mobile: +49 (151) 58 5 58 096
e-mail: [email protected]
internet: www.nexiles.com


Rechtsform / Legal form: Gesellschaft mit beschränkter Haftung / Limited Liability Company
Registergericht / Registration Court: Amtsgericht Ulm
Registernummer / Commercial Register No.: HRB 725682
Umsatzsteuernummer / VAT No.: DE 273776037
Geschäftsführer / Managing Directors: Stephan Eletzhofer, Günter Häußner, Michael Schilling, Jörg Szillat

Der Inhalt dieser E-Mail und ihrer Anhänge ist vertraulich. Die E-Mail ist ausschließlich für den Adressaten bestimmt.
Jeglicher Zugriff darauf durch andere Personen als den Adressaten ist untersagt.
Sollten Sie nicht der für die E-Mail bestimmte Adressat sein, ist Ihnen jede Vervielfältigung, Weitergabe oder Veröffentlichung
wie auch das Ergreifen oder Unterlassen von Maßnahmen im Vertrauen auf erlangte Information untersagt.

This email and any attachment is confidential and may be legally privileged. It is intended solely for the addressee.
Access to this email by anyone else is unauthorized.If you are not the intended recipient, any copying, distribution,
disclosure or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.


Von: "Häyrinen, Ari" <[email protected]<mailto:[email protected]>>
Datum: Mittwoch, 20. Juli 2016 um 09:20
An: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Betreff: [Jython-users] What extra argument is needed for java method call?


Hi,
there is a Java class called  "GroupServiceImpl":

    public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements GroupService

This class has mehod called "findByName":

    @Override
    public Group findByName(Context context, String name) throws SQLException {


So there are 2 arguments for that method.

I try to use this method like this (this is DSpace curator task):

class ConvertOldEmbargo(ScriptedTask):
    def init(self, curator, taskName):
        self.c = curator

    def performDso(self, dso):
        anonymous = GroupService.findByName(self.c.curationContext(), "Anonymous");

Jython complains:
TypeError: findByName(): expected 3 args; got 2

What is the third argument and how should I deliver it? Did I misunderstood something?

Any help much appreciated.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev

_______________________________________________
Jython-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jython-users