From: Häyrinen, A. <ari...@jy...> - 2016-07-20 08:20:56
|
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 [ste...@ne...] Lähetetty: 20. heinäkuuta 2016 10:58 Vastaanottaja: Häyrinen, Ari; jyt...@li... 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: se...@ne... 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" <ari...@jy...<mailto:ari...@jy...>> Datum: Mittwoch, 20. Juli 2016 um 09:20 An: "jyt...@li...<mailto:jyt...@li...>" <jyt...@li...<mailto:jyt...@li...>> 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. |