The ctor arguments you’re calling don’t exist. You want to set properties 
instead for that class:

https://github.com/Jasig/person-directory/blob/master/person-directory-impl/src/main/java/org/jasig/services/persondir/support/jdbc/NamedParameterJdbcPersonAttributeDao.java





From: Manfredo Hopp [mailto:[email protected]]
Sent: Wednesday, August 26, 2015 12:20 PM
To: [email protected]
Subject: Re: [cas-user] Resolving attirbutes dao results in "no value 
specified for parameter 2"



Hi test with  NamedParameterJdbcPersonAttributeDao results in :





2015-08-26 16:07:34,851 ERROR 
[org.springframework.web.context.ContextLoader] - <Context initialization 
failed>

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'centralAuthenticationService' defined in ServletContext resource 
[/WEB-INF/spring-configuration/applicationContext.xml]: Cannot resolve 
reference to bean 'authenticationManager' while setting constructor 
argument; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'authenticationManager' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 
'primaryPrincipalResolver' while setting constructor argument with key 
[<primaryAuthenticationHandler>]; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'primaryPrincipalResolver' defined in ServletContext resource 
[/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 
'attributeRepository' while setting bean property 'attributeRepository'; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'attributeRepository' defined in 
ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve 
reference to bean 'singleRowJdbcPersonAttributeDao' while setting bean 
property 'personAttributeDaos' with key [0]; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'singleRowJdbcPersonAttributeDao' defined in ServletContext 
resource [/WEB-INF/deployerConfigContext.xml]: Could not resolve matching 
constructor (hint: specify index/type/name arguments for simple parameters 
to avoid type ambiguities)

          at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:326)

          at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107)

          at 
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:623)

          at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)

          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1075)

          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:979)

          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)

          at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)

          at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)

          at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)

          at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)

          at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)





ConfigContext:



          <bean id="singleRowJdbcPersonAttributeDao"

                    
class="org.jasig.services.persondir.support.jdbc.NamedParameterJdbcPersonAttributeDao">

                      <constructor-arg index="0" ref="dataSourceSarauth" />

                      <constructor-arg index="1"

                                  value="(SELECT id , a , b , c,  email 
FROM usr WHERE {0}

 UNION

 (SELECT d , a , b , c,  email FROM regpend WHERE {0} )" />

                      <property name="queryAttributeMapping">

                                  <map>

                                              <entry key="username" 
value="id" />

                                  </map>

                      </property>

                      <property name="resultAttributeMapping">

                                  <map>

                                              <entry key="id" value="id" />

....





Regards Manfredo



2015-08-24 3:57 GMT-03:00 Misagh M <[email protected] 
<mailto:[email protected]> >:

Try using NamedParameterJdbcPersonAttributeDao  instead.

On Wednesday, August 19, 2015 at 3:26:37 PM UTC-7, Manfredo Hopp wrote:

See my previous mail which describes details of this issue.



Same result for  version 1.7.0 (latest?)



Regards Manfredo



2015-08-19 17:45 GMT-03:00 Misagh Moayyed <[email protected] 
<mailto:[email protected]> >:

This “may” be an issue with person directory. Don’t know yet, but your other 
option for now would be to have 2 DAOs and merge the result together 
finally.



What version of person directory is this by the way? Can you dulicate the 
problem with the latest?



From: Manfredo Hopp [mailto:[email protected]]
Sent: Wednesday, August 19, 2015 11:26 AM
To: [email protected] <mailto:[email protected]>
Subject: [cas-user] Resolving attirbutes dao results in "no value specified 
for parameter 2"



Hello I am using singleRowJdbcPersonAttributeDao to resolve principal 
attributes defined as:



singleRowJdbcPersonAttributeDao

                    
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">

                      <constructor-arg index="0" ref="dataSourceA" />

                      <constructor-arg index="1"

                      value="(SELECT a, b,  c , d

                                              FROM u WHERE {0}

                                  UNION

                                              (SELECT a, b ,c d

                                              FROM r WHERE {0})" />

                      <property name="queryAttributeMapping">

                                  <map>

                                              <entry key="username" 
value="id" />

                                  </map>

                      </property>



And get SQLException->No value specified for parameter 2



NO replacement for second {0}, so I am not able to use this query.



Is there any reason for the behaviour of this implementation?



Regards Manfredo


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



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

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




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

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

Reply via email to