Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Fwd: GROUPER_HOME clarfication and gsh.groovy not finding loaderRunOneJob(jobname);

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Fwd: GROUPER_HOME clarfication and gsh.groovy not finding loaderRunOneJob(jobname);


Chronological Thread 
  • From: Jeffrey Williams <>
  • To: Shilen Patel <>
  • Cc: "Waldbieser, Carl" <>, "" <>
  • Subject: Re: [grouper-users] Fwd: GROUPER_HOME clarfication and gsh.groovy not finding loaderRunOneJob(jobname);
  • Date: Mon, 10 Jul 2017 13:13:58 -0400
  • Ironport-phdr: 9a23:0kwcMxP+sQsA63yk3Rsl6mtUPXoX/o7sNwtQ0KIMzox0K/X5rarrMEGX3/hxlliBBdydsK0UzbeO+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6aijSI4DUTAhTyMxZubqSwQ9aKzpf/6+fnwJ3SZwhOzAK0fb52ZEGtrQTVu88+jZZhJ+A8xgaf8VVSfOED525mK0iejl7D58O0/Zdm6GwEufw+9spEUKzSYqIzQvpVAClwYDN939HiqRSWFVjH3XAbSGhD10MQWwU=

Thanks for the update, Shilen.  I'll be looking forward to that patch. :)

-Jeff

On Mon, Jul 10, 2017 at 9:50 AM, Shilen Patel <> wrote:
For what it's worth, Groovy will soon be built in to Grouper and all the old gsh commands will work exactly the same way.  It's already in the codebase and just pending some testing and the release of a patch for 2.3.

Thanks!

 - Shilen 



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: "Waldbieser, Carl" <>
Date: 7/10/17 9:32 AM (GMT-05:00)
To: Jeffrey Williams <>
Cc:
Subject: Re: [grouper-users] Fwd: GROUPER_HOME clarfication and gsh.groovy not finding loaderRunOneJob(jobname);

Jeffrey,

I'm no groovy expert, but in the jython shell, there are certain names that are placed in the global namespace automatically, and others that need to be imported (and possibly qualified depending on how the name is imported).  I expect the groovy shell has similar mechanisms in principal.  The way these shells work is to use the existing REPL, import some Internet2 Grouper modules, and optionally import some wrapper convenience functions.

For example, in the jython Grouper shell wrapper, I need to execute the following code:

  # First, import `GrouperLoader` into the global namespace
  from edu.internet2.middleware.grouper.app.loader import GrouperLoader
  # Next, call the static method on the class.
  GrouperLoader.runJobOnceForGroup(session, group)

Thanks,
Carl Waldbieser
ITS Systems Programmer
Lafayette College

----- Original Message -----
From: "Jeffrey Williams" <>
To:
Sent: Monday, July 10, 2017 9:08:51 AM
Subject: [grouper-users] Fwd: GROUPER_HOME clarfication and gsh.groovy not finding loaderRunOneJob(jobname);

Hi All,

Would anyone know what would make loaderRunOneJob available in gsh, but not
in gsh.groovy?

A little background:

I've been working on updating our 2.2.0 environment with the TIER Grouper
2.3.0 container using the April 2017 TIER Grouper Deployment Guide and ran
into an issue setting up groovygsh4grouper.  It seemed straightforward, but
I ran into a discrepancy in how GROUPER_HOME should be defined.  While not
explicit in the guide, it seems that the author wants it to be set to:

export GROUPER_HOME = /opt/grouper/X.Y.Z

However, when I run the following, I receive this error:

 $GROUPER_HOME/grouper.apiBinary-2.3.0/bin/gsh.groovy
The GROUPER_HOME environment variable is not defined correctly
or could not be determined
This script must be located in <GROUPER_HOME> or <GROUPER_HOME>/bin

That looks like it's expecting GROUPER_HOME to be set to something more
like:

export GROUPER_HOME = /opt/grouper/X.Y.Z/grouper.apiBinary-X.Y-Z

...and when I do that and adjust my commands accordingly, gsh.groovy starts
with seemingly no issue and runs the test commands in the guide handily.  I
did the following symlinks in the hopes it'll make config porting over
upgrades less manual:

bash-4.2# ls -all /opt/grouper
total 4
drwxr-xr-x.  3 root root   45 Jun 23 21:05 .
drwxr-xr-x. 10 root root  119 May 18 15:14 ..
drwxr-xr-x. 13 root root 4096 Jun 23 21:08 2.3.0
lrwxrwxrwx.  1 root root   31 Jun 23 21:05 home ->
latest/grouper.apiBinary-2.3.0/
lrwxrwxrwx.  1 root root    5 Jun 23 19:52 latest -> 2.3.0

export GROUPER_HOME = /opt/grouper/home

I didn't see a setting in bin/.groovy/groovysh.profile to adjust its
expectations on how GROUPER_HOME is defined to put it more in line with the
guide.

Recently, I wanted to test a loader job using gsh.groovy and received the
following:

#also, the steps for testing the new loader job using gsh.groovy left out
the initial startRootSession();  Probably second nature to those more
familiar with gsh, but for a first-timer, it sent me to the main docs to
see what I was missing
*groovy:000> grouperSession = GrouperSession.startRootSession();*
===> 38319284921b4c508e939fcf43d24ca4,'GrouperSystem','application'
groovy:000> job = GroupFinder.findByName(grouperSession,
"loader:thisLoaderGroupName");
===> Group[name=loader:thisLoaderGroupName,uuid=9195e687db2048ef8
37284781155ebd1]
groovy:000> lo
long    log
groovy:000> loaderRunOneJob(job);
ERROR groovy.lang.MissingMethodException:
No signature of method: groovysh_evaluate.loaderRunOneJob() is applicable
for argument types: (edu.internet2.middleware.grouper.Group) values:
[Group[name=loader:thisLoaderGroupName,uuid=9195e687db2048ef
837284781155ebd1]]

I can drop into classic gsh and was able to run the loader to completion:

gsh 0% grouperSession = GrouperSession.startRootSession();
edu.internet2.middleware.grouper.GrouperSession:
994c0c91b6f446e2a4fe39a949823832,'GrouperSystem','application'
gsh 1% job = GroupFinder.findByName(grouperSession,
"loader:thisLoaderGroupName");
group: name='loader:thisLoaderGroupName'
displayName='loader:thisLoaderGroupName'
uuid='9195e687db2048ef837284781155ebd1'
gsh 4% loaderRunOneJob(job);

...***...

loader ran with subject problems, inserted 1 memberships, deleted 0
memberships, total membership count: 5325, unresolvable subjects: 3734

I'm sure if how I've set GROUPER_HOME has impacted loader commands in
gsh.groovy or not.  Does anyone have any insight into what I may be running
into here?

Thanks!


--
Jeffrey Williams, SQL Server 2012 MCSA, Windows Server 2012 MCSA
Identity Management Specialist
Identity Architecture, ITS
University of North Carolina at Greensboro
256-TECH (256-8324)



--
Jeffrey Williams, SQL Server 2012 MCSA, Windows Server 2012 MCSA
Identity Management Specialist
Identity Architecture, ITS
University of North Carolina at Greensboro
256-TECH (256-8324)



Archive powered by MHonArc 2.6.19.

Top of Page