Scripted Attribute Resolver ClassNotFoundException

cbaker craigb at
Tue May 31 14:30:04 EDT 2016

I'm trying to write a scripted attribute resolver that uses the java
BouncyCastle libraries to do some RSA encryption.  When trying to call
Java.type("org.bouncycastle.openssl.PEMParser") I get a
ClassNotFoundException in idp-process.  

I've included the appropriate jar files in
{shibhome}/edit-webapp/WEB-INF/lib and done a bin/ I've verified
that the appropriate Jar files are in the idp.war file.  

I'm using tomcat8 and idp 3.2.  

I attempted to put the same jars in tomcat's lib directory and while that
allowed me to get past this line without a ClassNotFoundException, java /
tomcat quickly takes up all system memory, so I'm assuming that's NOT the
right answer.  

Heres the contents of the offending AttributeDefiniton's <script> tag:

	var ByteArray = Java.type("byte[]");
	var System = Java.type("java.lang.System");
	var FileReader = Java.type("");

	var Security = Java.type("");
	var PrivateKey = Java.type("");

	var Cipher = Java.type("javax.crypto.Cipher");
	var BouncyCastleProvider =
	var PEMParser = Java.type("org.bouncycastle.openssl.PEMParser");

Curiously the nashorn interpreter doesn't throw an exception on the
BouncyCastleProvider line, which comes from the same set of jars.  I've also
been able to add other libs like svnkit to the war using the same
edit-webapp location and rebuilding, so I don't think I'm doing that part

Any thoughts?

-Craig B

View this message in context:
Sent from the Shibboleth - Users mailing list archive at

More information about the users mailing list