Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH


Chronological Thread 
  • From: "David A. Kovacic" <>
  • To: Jonathan Keller <>
  • Cc: , "" <>
  • Subject: Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH
  • Date: Mon, 21 Jun 2021 14:30:07 -0400

Doh! I see what I was doing wrong.  The CLASSPATH definition needs to be outside the GSH script file and needs an export command to carry the definition into the execution of the script like so:

podman exec -it grouper-all bash -c "export CLASSPATH=/opt/tomee/lib/servlet-api.jar ; gsh <path to GSH script>"

On 6/21/21 2:20 PM, David A. Kovacic wrote:
Well now the error has changed to:

groovy:000> CLASSPATH=/opt/tomee/lib/servlet-api.jar
Unknown property: tomee

I've tried adding the CLASSPATH at the start of the GSH script, and after the imports and neither worked...

On 6/17/21 5:17 PM, Jonathan Keller wrote:
Yep!  Due to the way that the template seems to reference Servlet API classes during execution, I found I needed to add this to the classpath when not running on the UI server.  On there, this seemed to be already present.

CLASSPATH=/opt/tomee/lib/servlet-api.jar

--
Jonathan Keller
Application Architect - Administrative IT

On Jun 17, 2021, at 11:50 AM, David A. Kovacic <> wrote:

The groovy script seems to have failed:  The imports and create GrouperSession s... seem to have worked but the following comands are giving a "definition not found error":

groovy:000> GrouperSession s = GrouperSession.startRootSession();
===> 7733c440b1144f00a986befb9bbb3e28,'GrouperSystem','application' groovy:000> Stem stem = StemFinder.findByName(s, ":");
===> Stem[displayName=,name=,uuid=91aa5a37cc6145968295bd5e9ad79701,creator=cc0c3db0ccb84923ad9833d1d2821ef2] groovy:000> GrouperRequestContainer.assignUseStaticRequestContainer(true);
ERROR java.lang.NoClassDefFoundError:
javax/servlet/http/HttpServletRequest
groovy:000> GrouperRequestContainer grouperRequestContainer = GrouperRequestContainer.retrieveFromRequestOrCreate();
ERROR java.lang.NoClassDefFoundError:
javax/servlet/http/HttpServletRequest

Any idea what we might be doing wrong?  This is under Grouper 2.5.44

Dave
On 6/15/21 7:02 PM, Jonathan Keller wrote:
If by command line you mean running a GSH script: Yes - I was setting up to do this.  We have not automated the running of the script on deployment, but the script to perform the GDG provisioning is part of the image.  But this is the relevant part.  I hope this helps your use case.  After this, the script proceeds to set up a number of stems within the GDG we also want to have as a standard.


import edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperRequestContainer;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.StemTemplateContainer;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperTemplateLogicBase;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.ServiceAction;
import edu.internet2.middleware.grouper.grouperUi.serviceLogic.UiV2Template;
GrouperSession s = GrouperSession.startRootSession();
// This block pulls the GDG template (known as tierStructure) and applies it to the database
// Template application commands like these must be run against the UI server
Stem stem = StemFinder.findByName(s, ":");
GrouperRequestContainer.assignUseStaticRequestContainer(true);
GrouperRequestContainer grouperRequestContainer = GrouperRequestContainer.retrieveFromRequestOrCreate();
StemTemplateContainer stemTemplateContainer = grouperRequestContainer.getStemTemplateContainer();
GrouperTemplateLogicBase templateLogic = UiV2Template.getTemplateLogic("tierStructure", stemTemplateContainer);
templateLogic.setStemId(stem.getUuid());
stemTemplateContainer.setCreateNoSubfolder(true);
List allServiceActions = templateLogic.getServiceActions();
for (ServiceAction serviceAction: allServiceActions) { serviceAction.getServiceActionType().createTemplateItem(serviceAction); }

--
Jonathan Keller
Application Architect - Administrative IT
<image001.jpg>

On Jun 15, 2021, at 10:38 AM, David A. Kovacic <> wrote:

AT CWRU, we are trying to make deployment of Grouper more consistent using  ansible playbooks.  We have a number of sub-folders we would like to add to the basic app, basis, etc structure and would like to do them all as one GSH script.  It looks like the current GDG template uses straight Java rather than Groovy.  Is there any way to run the GDG template directly from the command line?
-- David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech Case Western Reserve University
Email: Phone: 216.368.5892





--
David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech
Case Western Reserve University
Email: Phone: 216.368.5892





--
David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech
Case Western Reserve University
Email:
Phone: 216.368.5892




--
David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech
Case Western Reserve University
Email:
Phone: 216.368.5892



JPEG image

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature




Archive powered by MHonArc 2.6.24.

Top of Page