0

I have the following Spring Bean defined:

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TicketGrantingTicketExpirationPolicy"
      c:maxTimeToLive="${tgt.maxTimeToLiveInSeconds:32400}" c:timeToKill="${tgt.timeToKillInSeconds:32400}" c:timeUnit-ref="SECONDS" />

That corresponds to this bean. With the above configuration, I get the following exception:

SEVERE: Exception starting filter springSecurityFilterChain
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grantingTicketExpirationPolicy' defined in ServletContext resource [/WEB-INF/spring-configuration/ticketExpirationPolicies.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.ConstructorResolver.autowireConstructor(ConstructorResolver.java:250)
    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)
    <long stack trace omitted for brevity>
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

So all I did was copy from this example file and change:

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TicketGrantingTicketExpirationPolicy"
      c:maxTimeToLive="${tgt.maxTimeToLiveInSeconds:28800}" c:timeToKill="${tgt.timeToKillInSeconds:7200}" c:timeUnit-ref="SECONDS" />

To:

<bean id="grantingTicketExpirationPolicy" class="org.jasig.cas.ticket.support.TicketGrantingTicketExpirationPolicy"
      c:maxTimeToLive="${tgt.maxTimeToLiveInSeconds:32400}" c:timeToKill="${tgt.timeToKillInSeconds:32400}" c:timeUnit-ref="SECONDS" />

Where am I going wrong?

smeeb
  • 27,777
  • 57
  • 250
  • 447
  • 1
    So, what happens if you don't change anything? Does it work then? – Hille Feb 02 '15 at 22:39
  • Thanks @Hille (+1) - this is CAS so it uses Maven Overlay. If I dont provide a XML Spring Beans file it will use a default. If I provide my own file then it has to define all the beans supported by the default. – smeeb Feb 03 '15 at 13:10

1 Answers1

-1

the constructor with the params you are using might not exist. Look at the TicketGrantingTicketExpirationPolicy for available constructors and adjust accordingly.

fateddy
  • 6,887
  • 3
  • 22
  • 26
  • I did - thats why I posted a link to it. My question is: I am using the provided constructor, so what is going wrong here? – smeeb Feb 03 '15 at 13:11