Return to Jive Software

This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3,107 Views 8 Replies Last post: Oct 9, 2008 4:15 PM by Ray Harvey RSS
Ray Harvey Beginner 402 posts since
Dec 3, 2007
Currently Being Moderated

Oct 9, 2008 9:57 AM

Updating Profile in 2.5.1

In the middle of converting SSO I wrote in 1.10x. Running into an issue with getting an instance of the profile. Essentially I update the profile through my SSO implimentaion.

 

The following code is raising a NullPointerException.

 

Map<Long, ProfileFieldValue> profile = profileManager.getProfile(user);

 

The extension is defined below.

 

public ProfileManager getProfileManager()
    {
        return profileManager;
    }

 

    public void setProfileManager(ProfileManager profileManager)
    {
        this.profileManager = profileManager;
    }

 

    public ProfileFieldManager getProfileFieldManager()
    {
        return profileFieldManager;
    }


Where am I going wrong is there an article on this outside of the Javadocs.

 

Thaanks

Tags: profile, sso, profilemanager
Erik Onnen Jive Employee 60 posts since
Oct 4, 2007
Currently Being Moderated
Oct 9, 2008 2:19 PM in response to: Ray Harvey
Re: Updating Profile in 2.5.1

Ray,

 

Are you injecting the profile manager via spring into your SSO solution (Filter?)? If you have a debugger attached to your environment, you might try putting a break point on the setter (or adding a log message otherwise) for the ProfileManager to make sure the system is injecting it properly. If that setter is not invoked, you are likely missing a spring configuration directive for your SSO module.

 

-erik

Erik Onnen Jive Employee 60 posts since
Oct 4, 2007
Currently Being Moderated
Oct 9, 2008 2:54 PM in response to: Ray Harvey
Re: Updating Profile in 2.5.1

Ray, those setters are fine for injection, but you won't have them "autowired" in a plugin/SSO situation. You will need to define a spring configuration that injects the manager as part of your SSO implementation. I'll post a link to how to configure this via a plugin or jiveHome/etc file.

Steve Traut Jive Employee 83 posts since
Jun 14, 2007
Currently Being Moderated
Oct 9, 2008 3:31 PM in response to: Ray Harvey
Re: Updating Profile in 2.5.1

Ray, did you create a Spring configuration file that describes your SSO provider's dependencies, such as its dependency on the ProfileManager?

Steve Traut Jive Employee 83 posts since
Jun 14, 2007
Currently Being Moderated
Oct 9, 2008 4:29 PM in response to: Ray Harvey
Re: Updating Profile in 2.5.1

Cool. Yep, the example on how to set up an SSO filter includes an XML stanza that shows properties defined for each of the injected dependencies (managers and agents). That stanza tells Spring what will be required at run time. We have another, similar example in the topic on adding DB access to a plugin. It's not SSO or authentication, but it is about making Spring aware of a component and its dependencies.

 

If you're deploying your SSO provider inside a plugin, then you'll want to include a spring.xml file in the plugin (the spring.xml file goes at the root of the deployed JAR). There's higher-level information about plugin deployment in Building Plugins. If instead you're adding your SSO provider to the classpath manually, outside the plugin framework, then you'll need to put your spring.xml file in the jiveHome/etc directory of your Clearspace instance.

 

For other info, you might find our (small, but growing) Spring FAQ useful. Also, check out the Spring documentation on its inversion of control (IoC) container (which is what's behind dependency injection).

 

Finally, we have two samples you might be interested in (both in our public Subversion project). One is Erik's on doing SSO; the other does Spring stuff for database access.

More Like This

  • Retrieving data ...

Bookmarked By (0)