<div dir="ltr">Looks like this works...<div> sys.path.append('/usr/local/shibboleth-idp/lib/novl-ldap.jar')<br></div><div><br></div><div>...but I did assume that all of the jars in WEB-INF/lib would be in my classpath. Ah well.</div>
<div><br></div><div>Liam</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 1:57 PM, Liam Hoekenga <span dir="ltr"><<a href="mailto:liamr@umich.edu" target="_blank">liamr@umich.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I need to do a conditional LDAP query (to populate an attribute only for a specific SP).<div>So, I wrote a jython script. Novell has a jar that contains classes aimed at allowing LDAP queries from ECMA (rhino), which I've adjusted for jython).</div>
<div><br></div><div>It works when I run it by hand (e.g. "jython groupMembers.py"). I have to add the jar to my classpath, but afterwards, it works great.</div><div><br></div><div>I updated the script with the attribute generating bits, and I added the jar to the shibboleth lib directory and recreated the war file. I had assumed that anything in idp.war's WEB-INF/lib got added to the classpath (that certainly seemed to be true for the various jsr223 script engines, and jdbc connectors), but I get an error when the script tries to execute.</div>
<div><br></div><div>Any Suggestions?</div><div>Liam</div><div><br></div><div>---------------</div><div><br></div><div><div>13:39:42.048 - ERROR [edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.ScriptedAttributeDefinition:135] - ScriptletAttributeDefinition panoptoGroupMembership unable to execute script</div>
<div>javax.script.ScriptException: ImportError: No module named novell in <script> at line number 7</div><div><span style="white-space:pre-wrap">        </span>at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:202) ~[jython-2.7b1.jar:na]</div>
<div><span style="white-space:pre-wrap">        </span>at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42) ~[jython-2.7b1.jar:na]</div><div><span style="white-space:pre-wrap">        </span>at org.python.jsr223.PyScriptEngine.access$300(PyScriptEngine.java:20) ~[jython-2.7b1.jar:na]</div>
<div><span style="white-space:pre-wrap">        </span>at org.python.jsr223.PyScriptEngine$PyCompiledScript.eval(PyScriptEngine.java:231) ~[jython-2.7b1.jar:na]</div></div><div><br></div></div>
</blockquote></div><br></div>