Description
Java:
204 public int process() { |
205 int numErrors = 0; |
206 GrouperSession.startRootSession(); |
207 Subject svcAccountSubject = SubjectFinder.findByIdAndSource(UtilConstants.SERVICE_ACCOUNT_ID, "app", true); |
208 final GrouperSession session = GrouperSession.start(svcAccountSubject); |
209 UNCUtilityGrouperEngineIdentifier engineIdentifier = new UNCUtilityGrouperEngineIdentifier("App Utilities - OBIEEGroupUpdater"); |
210 GrouperContext.createNewDefaultContext( |
211 engineIdentifier, false, true); |
212 |
213 final SourceManager mgr = SourceManager.getInstance(); |
214 final Source personSrc = mgr.getSource("pid"); |
215 |
216 for (Operation operation : operations) { |
217 numErrors += operation.process(session, personSrc); |
218 } |
219 |
220 session.stop(); |
221 |
222 return numErrors; |
223 } |
Error:
Exception in thread "main" java.lang.IllegalStateException: There is no open GrouperSession detected. Make sure to start a grouper session (e.g. GrouperSession.startRootSession() if you want to use a root session ) before calling this method |
at edu.internet2.middleware.grouper.GrouperSession.staticGrouperSession(GrouperSession.java:1229) |
at edu.internet2.middleware.grouper.GrouperSession.staticGrouperSession(GrouperSession.java:1179) |
at edu.internet2.middleware.grouper.subj.SourcesXmlResolver.find(SourcesXmlResolver.java:341) |
at edu.internet2.middleware.grouper.subj.CachingResolver.find(CachingResolver.java:177) |
at edu.internet2.middleware.grouper.subj.ValidatingResolver.find(ValidatingResolver.java:128) |
at edu.internet2.middleware.grouper.SubjectFinder.findByIdAndSource(SubjectFinder.java:675) |
at edu.internet2.middleware.grouper.SubjectFinder.findByIdAndSource(SubjectFinder.java:646) |
at edu.example.its.idm.grouper.util.obiee.OBIEEGroupUpdater$OperationData.process(OBIEEGroupUpdater.java:207) |
at edu.example.its.idm.grouper.util.obiee.OBIEEGroupUpdater.main(OBIEEGroupUpdater.java:187) |
|