CAS 3.3.4 & attributeRepository

12 messages Options
Embed this post
Permalink
Pavlos Drandakis-2

CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
Hi all,

I am trying to deploy CAS server 3.3.4 using my old (CAS 3.3.3)
deployerConfigContext.xml but I am getting these exceptions:

Error creating bean with name 'attributeRepository' defined in
ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error
setting property values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'query' of bean class
[org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao]: Bean
property 'query' is not writable or has an invalid setter method. Does
the parameter type of the setter match the return type of the getter?

Error creating bean with name 'attributeRepository' defined in
ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error
setting property values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'ldapAttributesToPortalAttributes' of bean class
[org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao]: Bean
property 'ldapAttributesToPortalAttributes' is not writable or has an
invalid setter method. Does the parameter type of the setter match the
return type of the getter?

This is what I have in my deployerConfigContext.xml about
attributeRepository:

<bean id="attributeRepository"
class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
                <property name="baseDN" value="dc=X,dc=Y" />
                <property name="query" value="(uid={0})" />
                <property name="contextSource" ref="contextSource"/>
                <property name="ldapAttributesToPortalAttributes">
                        <map>
                                <entry key="attribute1"
value="attribute1" />
                        </map>
                </property>
</bean>


As far as I can tell, this happens because of the new Person Directory
API, that is used in this release... If true, what should be the
appropriate configuration for attributeRepository bean?

Thanks,
Pavlos

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
This JavaDoc should help:
http://developer.jasig.org/projects/person-directory/1.5.0-RC6/apidocs/org/jasig/services/persondir/support/ldap/LdapPersonAttributeDao.html

Cheers,
Scott

On Thu, Oct 15, 2009 at 10:23 AM, Pavlos Drandakis <[hidden email]> wrote:
Hi all,

I am trying to deploy CAS server 3.3.4 using my old (CAS 3.3.3) deployerConfigContext.xml but I am getting these exceptions:

Error creating bean with name 'attributeRepository' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'query' of bean class [org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao]: Bean property 'query' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Error creating bean with name 'attributeRepository' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'ldapAttributesToPortalAttributes' of bean class [org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao]: Bean property 'ldapAttributesToPortalAttributes' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

This is what I have in my deployerConfigContext.xml about attributeRepository:

<bean id="attributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
              <property name="baseDN" value="dc=X,dc=Y" />
              <property name="query" value="(uid={0})" />
              <property name="contextSource" ref="contextSource"/>
              <property name="ldapAttributesToPortalAttributes">
                      <map>
                              <entry key="attribute1" value="attribute1" />
                      </map>
              </property>
</bean>


As far as I can tell, this happens because of the new Person Directory API, that is used in this release... If true, what should be the appropriate configuration for attributeRepository bean?

Thanks,
Pavlos

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Marvin Addison

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
> This JavaDoc should help:
> http://developer.jasig.org/projects/person-directory/1.5.0-RC6/apidocs/org/jasig/services/persondir/support/ldap/LdapPersonAttributeDao.html

Actually, the API docs are no help at all.  I've studied the javadocs
carefully, and I've been poring over the person directory _source_ in
a trial-and-error attempt to port our LdapPersonAttributeDao
configuration to from 3.3.3 to 3.3.4.  I'm getting pretty frustrated
as the interface has changed substantially and the documentation is
poor at best.  Clearly we need to provide some example configurations
for 1.5.0.  I'll add a 1.5.0 LDAP example to
http://www.ja-sig.org/wiki/display/CASUM/Attributes once I figure it
out.  IF I figure it out.  *grumble*

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Pavlos Drandakis-2

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
Hi Marvin,

after a lot of trial-and-error attempts, here is what I figured out
about the new config options.
I am not sure if it is the "right" configuration, but it seems to work...

<bean id="attributeRepository"
               
class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
                <property name="baseDN" value="ou=people,dc=X,dc=Y" />
                <property name="contextSource" ref="contextSource"/>
                <property name="queryTemplate" value="{0}"/>

                <property name="queryAttributeMapping">
                        <map>
                                <entry key="username" value="uid"/>
                        </map>
                </property>

                <property name="resultAttributeMapping">
                        <map>
                                <entry key="ldapAttribute"
value="applicationAttribute"/>
                        </map>
                </property>
        </bean>

Hope it helps,
Pavlos

Marvin Addison wrote:

>> This JavaDoc should help:
>> http://developer.jasig.org/projects/person-directory/1.5.0-RC6/apidocs/org/jasig/services/persondir/support/ldap/LdapPersonAttributeDao.html
>>    
>
> Actually, the API docs are no help at all.  I've studied the javadocs
> carefully, and I've been poring over the person directory _source_ in
> a trial-and-error attempt to port our LdapPersonAttributeDao
> configuration to from 3.3.3 to 3.3.4.  I'm getting pretty frustrated
> as the interface has changed substantially and the documentation is
> poor at best.  Clearly we need to provide some example configurations
> for 1.5.0.  I'll add a 1.5.0 LDAP example to
> http://www.ja-sig.org/wiki/display/CASUM/Attributes once I figure it
> out.  IF I figure it out.  *grumble*
>
> M
>  

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
In reply to this post by Marvin Addison
I actually did manage to figure it out, I think.  I'll grab a copy and paste it into this thread. When I sent the link I hadn't realized how much they changed it.


On Wed, Oct 21, 2009 at 9:23 AM, Marvin Addison <[hidden email]> wrote:
Actually, the API docs are no help at all.  I've studied the javadocs
carefully, and I've been poring over the person directory _source_ in
a trial-and-error attempt to port our LdapPersonAttributeDao
configuration to from 3.3.3 to 3.3.4.  I'm getting pretty frustrated
as the interface has changed substantially and the documentation is
poor at best.  Clearly we need to provide some example configurations
for 1.5.0.  I'll add a 1.5.0 LDAP example to
http://www.ja-sig.org/wiki/display/CASUM/Attributes once I figure it
out.  IF I figure it out.  *grumble*

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Marvin Addison

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
In reply to this post by Pavlos Drandakis-2
> I am not sure if it is the "right" configuration, but it seems to work...
>
> <bean id="attributeRepository"
>
> class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
>               <property name="baseDN" value="ou=people,dc=X,dc=Y" />
>               <property name="contextSource" ref="contextSource"/>
>               <property name="queryTemplate" value="{0}"/>
>
>               <property name="queryAttributeMapping">
>                       <map>
>                               <entry key="username" value="uid"/>
>                       </map>
>               </property>
>
>               <property name="resultAttributeMapping">
>                       <map>
>                               <entry key="ldapAttribute"
> value="applicationAttribute"/>
>                       </map>
>               </property>
>       </bean>
>
> Hope it helps

Actually, that helped signficantly.  Stepping through a unit test was
leading me to realize that "username" is the default key in the query
part.  In any case I got it working and I'll update the Attributes
page with this info.  Hopefully a brave soul can figure out how the
JDBC DAO has changed and provide an example of it as well.

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Scott Battaglia-2

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
Here's one for AD, and it also use abstract beans just for fun:

        <bean id="abstractAttributeRepository" class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao" abstract="true">
                <property name="queryAttributeMapping">
                        <map>
                                <entry key="username" value="sAMAccountName" />
                        </map>
                </property>
                <property name="resultAttributeMapping">
                        <map>
                                <entry key="givenName" value="givenName"/>
                                <entry key="distinguishedName" value="distinguishedName" />
                                <entry key="mail" value="mail" />
                                <entry key="employeeID" value="employeeID" />
                                <entry key="displayName" value="displayName" />
                                <entry key="sn" value="sn" />
                                <entry key="description" value="description" />
                        </map>
                </property>
        </bean>

        <bean id="studentAttributeRepository" parent="abstractAttributeRepository"
                p:baseDN="ou=Users,dc=student,dc=ad,dc=university,dc=edu"
                p:contextSource-ref="contextSourceSTUDENT" />




On Wed, Oct 21, 2009 at 9:43 AM, Marvin Addison <[hidden email]> wrote:
> I am not sure if it is the "right" configuration, but it seems to work...
>
> <bean id="attributeRepository"
>
> class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
>               <property name="baseDN" value="ou=people,dc=X,dc=Y" />
>               <property name="contextSource" ref="contextSource"/>
>               <property name="queryTemplate" value="{0}"/>
>
>               <property name="queryAttributeMapping">
>                       <map>
>                               <entry key="username" value="uid"/>
>                       </map>
>               </property>
>
>               <property name="resultAttributeMapping">
>                       <map>
>                               <entry key="ldapAttribute"
> value="applicationAttribute"/>
>                       </map>
>               </property>
>       </bean>
>
> Hope it helps

Actually, that helped signficantly.  Stepping through a unit test was
leading me to realize that "username" is the default key in the query
part.  In any case I got it working and I'll update the Attributes
page with this info.  Hopefully a brave soul can figure out how the
JDBC DAO has changed and provide an example of it as well.

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user


-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Marvin Addison

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
I posted the new config to
http://www.ja-sig.org/wiki/display/CASUM/Attributes.  Feedback
welcome.

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Scott Battaglia-2

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
It looks good.  The only thing I would say is we might want to add the AD example for our Microsoft-using friends! (or at least note to replace uid with the other field).  I can do that later if you don't get a chance to.

Cheers,
Scott


On Wed, Oct 21, 2009 at 10:12 AM, Marvin Addison <[hidden email]> wrote:
I posted the new config to
http://www.ja-sig.org/wiki/display/CASUM/Attributes.  Feedback
welcome.

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
HansDB

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
In reply to this post by Marvin Addison
Some javascript/style in this post has been disabled (why?)
One brave soul as ordered ;-)
I wish I'd seen this thread sooner, since I've been using Person Directory 1.5(RC5) in combination with CAS 3.3.3 for almost 2 months now.

This JDBC DAO does the trick for me, I'm not sure how different it is compared to the old one.

    <bean id="attributeRepository" class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
        <constructor-arg index="0" ref="dataSource" />
        <constructor-arg index="1" value="SELECT * FROM my_table WHERE {0}" />
        <property name="queryAttributeMapping">
            <map>
                <entry key="username" value="my_table_column" />
            </map>
        </property>
        <property name="resultAttributeMapping">
            <map>
                <entry key="jdbcAttribute" value="applicationAttribute" />
            </map>
        </property>
    </bean>
Just to be clear: the-value attribute of each entry in the queryAttributeMap should be "something" in your table and/or query. Not the other way round.

The information on the wiki (http://www.ja-sig.org/wiki/display/PDM15/Person+Directory+1.5+Manual) helped a lot when I tried to figure out how to get the new version working. (Some of the things I was trying to do weren't possible in the older version, so I had to figure out the new one)

Regards,

Hans

Marvin Addison schreef:
I am not sure if it is the "right" configuration, but it seems to work...

<bean id="attributeRepository"

class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
              <property name="baseDN" value="ou=people,dc=X,dc=Y" />
              <property name="contextSource" ref="contextSource"/>
              <property name="queryTemplate" value="{0}"/>

              <property name="queryAttributeMapping">
                      <map>
                              <entry key="username" value="uid"/>
                      </map>
              </property>

              <property name="resultAttributeMapping">
                      <map>
                              <entry key="ldapAttribute"
value="applicationAttribute"/>
                      </map>
              </property>
      </bean>

Hope it helps
    

Actually, that helped signficantly.  Stepping through a unit test was
leading me to realize that "username" is the default key in the query
part.  In any case I got it working and I'll update the Attributes
page with this info.  Hopefully a brave soul can figure out how the
JDBC DAO has changed and provide an example of it as well.

M

  
-- 
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Marvin Addison

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
> One brave soul as ordered ;-)
> I wish I'd seen this thread sooner, since I've been using Person Directory
> 1.5(RC5) in combination with CAS 3.3.3 for almost 2 months now.
>
> This JDBC DAO does the trick for me, I'm not sure how different it is
> compared to the old one.

Thanks Hans!  I'll get this up on the Wiki in addition to Scott's AD
example in the near future.  I'll also provide a link to the Person
Directory Wiki page you referenced; wish I'd had that available when I
started.

M

--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Johan Reinalda

Re: CAS 3.3.4 & attributeRepository

Reply Threaded More More options
Print post
Permalink
Thanks to ALL of you for this great thread!

I just yesterday started wandering into the 3.3.4 world (with MS-AD LDAP as
the backend) and had seen the first problems. Low and behold, the answers
are on the list today!

Thank you for all your hard work!

Johan
Thundebird School of Global Management.


----- Original Message -----
From: "Marvin Addison" <[hidden email]>
To: <[hidden email]>
Sent: Wednesday, October 21, 2009 9:25 AM
Subject: Re: [cas-user] CAS 3.3.4 & attributeRepository


>> One brave soul as ordered ;-)
>> I wish I'd seen this thread sooner, since I've been using Person
>> Directory
>> 1.5(RC5) in combination with CAS 3.3.3 for almost 2 months now.
>>
>> This JDBC DAO does the trick for me, I'm not sure how different it is
>> compared to the old one.
>
> Thanks Hans!  I'll get this up on the Wiki in addition to Scott's AD
> example in the near future.  I'll also provide a link to the Person
> Directory Wiki page you referenced; wish I'd had that available when I
> started.
>
> M
>
> --
> You are currently subscribed to [hidden email] as:
> [hidden email]
> To unsubscribe, change settings or access archives, see
> http://www.ja-sig.org/wiki/display/JSG/cas-user 


--
You are currently subscribed to [hidden email] as: [hidden email]
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user