OpenSAML dependency on Velocity breaks application

Brent Putman putmanb at georgetown.edu
Wed May 2 23:23:01 BST 2012



On 5/2/12 3:29 AM, Tom van den Berge wrote:
>
> You are using the singleton model in DefaultBootstrap:
> "Velocity.init();". Maybe you are using the separate instances model
> when you are using velocity templates, but not when initializing.

Yes, that's what I meant.  Other than in the DefaultBootstrap, we use
the separate instance model exclusively.


>  
>
>     It might be that newly created VelocityEngine instances just
>     inherit the properties from the global Velocity singleton if they are
>     otherwise unspecified, so maybe that is the (not very good) reason. 
>


Turns out that this is not true. Properties from the singleton are not
inherited by the VelocityEngine instances. The Velocity singleton and
any VelocityEngine instances are completely unconnected and unrelated.

Long ago, before the code was even released, we were using the Velocity
singleton model.  When during development we switched to the separate
instance model, the singleton init stuff in DefaultBootstrap was
apparently just not removed.  It was actually not doing anything useful
at all (effectively) in our codebase, so it's now been removed:

https://issues.shibboleth.net/jira/browse/JOST-188

So that would be in the next patch release, although I'm not certain
when that will be.  You can always pull the latest branch from svn and
do a source build if you like.


> I'm not sure what you mean with you last phrase, but that's probably
> because I'm not very familiar with OpenSAML. I would say if OpenSAML
> needs Velocity, it needs to take care of its own initialization, and
> obviously not break any application or library that is using OpenSAML.

We use a dependency injection model, so the things that use Velocity
have the VelocityEngine instance injected into them by the calling
code.  So it's up to that code (e.g. the Shibboleth IdP) to configure
and initialize the instance before use.

Thanks,
Brent



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20120502/ae85ef14/attachment-0001.html 


More information about the dev mailing list