Opinion on grouper/shib options

O'Dowd, Josh Josh.O'Dowd at mso.umt.edu
Mon Sep 14 12:48:34 EDT 2015


Just in case I was having a brain thing, I removed the explicit call to setId in the bean's constructor, and restarted...  I got the following exception:

2015-09-14 10:34:06,132 - ERROR [net.shibboleth.utilities.java.support.service.AbstractReloadableService:181] - Service 'shibboleth.AttributeResolverService': Initial load failed
net.shibboleth.utilities.java.support.service.ServiceException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grouperWS' defined in file [/opt/shibboleth-idp/conf/attribute-resolver-spring.xml]: Invocation of init method failed; nested exception is net.shibboleth.utilities.java.support.component.ComponentInitializationException: Component identifier can not be null
        at net.shibboleth.ext.spring.service.ReloadableSpringService.doReload(ReloadableSpringService.java:334)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grouperWS' defined in file [/opt/shibboleth-idp/conf/attribute-resolver-spring.xml]: Invocation of init method failed; nested exception is net.shibboleth.utilities.java.support.component.ComponentInitializationException: Component identifier can not be null
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
Caused by: net.shibboleth.utilities.java.support.component.ComponentInitializationException: Component identifier can not be null
        at net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent.doInitialize(AbstractIdentifiedInitializableComponent.java:65)

-Josh

-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Cantor, Scott
Sent: Monday, September 14, 2015 10:25 AM
To: Shib Users
Subject: Re: Opinion on grouper/shib options

On 9/14/15, 12:16 PM, "users on behalf of O'Dowd, Josh" <users-bounces at shibboleth.net on behalf of Josh.O'Dowd at mso.umt.edu> wrote:

>>
>>We have special bean processors that take care of that which you can find in the various Spring files (see the top of system/conf/global.xml for example).
>
>Sorry Scott, I am not sure what you are correcting me on, here.  My original course of action was to just declare a bean for my DataConnector in the conf/global.xml, and having just an empty constructor in that class.  Not only did it not instantiate, but the attribute-resolver complained that the data source ref id that I was referring to(the new bean's id), did not exist.

If it's in that file, I don't think you should have had to call setId. The bean's ID in the Spring file should be auto-set to be the component's ID in an internal IdP sense by this thing in global-system.xml:

 <!-- This BeanPostProcessor auto-sets identifiable beans with the bean name (if not already set). -->
    <bean id="shibboleth.IdentifiableBeanPostProcessor"
        class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />

That prevents a weird situation where a custom bean has to look like this:

<bean id="foo" p:id="foo" ... />

(or a case of needing to explicitly call setId in code, which is what I thought I saw you say)


>It was not until I wired the bean in a separate spring xml, and included that file location in the services.xml list for 'shibboleth.AttributeResolverResources', that 'all the little lights came on' and the resolver was attempting to initialize the connector.  On first try, with the empty constructor, the id property of the connector was null so I was getting an ComponentInitializationException.  That's when I added the #setId call to the connector's constructor, and the resolver is now working without error.

I thought we auto-injected that BeanPostProcessor into the service contexts, but I'm not seeing it, so that probably explains why it broke there. If you add that same bit of boilerplate at the top of your custom beans resource file, you're good to go without having to remember to call setId.

-- Scott

-- 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list