title: No default constructor found; nested exception is java.lang.NoSuchMethodException
body: <p>It throws NoSuchMethodException while deploying, constructor param is already set in xml config file though. 
  What am i missing? Git repo is <a href="https://github.com/webyildirim/trafikhaberci" rel="nofollow">here</a> 
  Regards</p>
  
  <p>security-configuration.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
         xmlns:sec="http://www.springframework.org/schema/security"
         xmlns:context="http://www.springframework.org/schema/context"
         xsi:schemaLocation="http://www.springframework.org/schema/security/oauth2 http://www.springframework.org/schema/security/spring-security-oauth2.xsd
  
          http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
          http://www.springframework.org/schema/context
          http://www.springframework.org/schema/context/spring-context.xsd
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
  &lt;context:annotation-config/&gt;
  &lt;context:component-scan base-package="com.trafficalarm.rest.security" /&gt;
  
      &lt;bean id="roleHierarchy"
            class="org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl"&gt;
          &lt;property name="hierarchy"&gt;
              &lt;value&gt;
                  ROLE_ADMIN &gt; ROLE_USER
                  ROLE_USER &gt; ROLE_GUEST
              &lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="roleVoter" class="com.trafficalarm.rest.security.HierarchicalJsr250Voter"&gt;
          &lt;constructor-arg ref="roleHierarchy" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Access voters --&gt;
      &lt;bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased"
            xmlns="http://www.springframework.org/schema/beans"&gt;
          &lt;property name="decisionVoters"&gt;
              &lt;list&gt;
                  &lt;ref bean="roleVoter"/&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;sec:global-method-security jsr250-annotations="enabled" access-decision-manager-ref="accessDecisionManager"/&gt;
  
      &lt;oauth:expression-handler id="oauthExpressionHandler"/&gt;
  
      &lt;oauth:web-expression-handler id="oauthWebExpressionHandler"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>HierachicalJsr250Voter.java</p>
  
  <pre><code>package com.trafficalarm.rest.security;
  
  import java.util.Collection;
  
  import org.springframework.security.access.ConfigAttribute;
  import org.springframework.security.access.annotation.Jsr250SecurityConfig;
  import org.springframework.security.access.annotation.Jsr250Voter;
  import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
  import org.springframework.security.core.Authentication;
  import org.springframework.security.core.GrantedAuthority;
  import org.springframework.stereotype.Component;
  //import org.springframework.util.Assert;
  
  @Component
  public class HierarchicalJsr250Voter extends Jsr250Voter {
  
      private RoleHierarchy roleHierarchy = null;
  
      public HierarchicalJsr250Voter(RoleHierarchy roleHierarchy) {
          //Assert.notNull(roleHierarchy, "RoleHierarchy must not be null");
          this.roleHierarchy = roleHierarchy;
      }
  
      @Override
      public int vote(Authentication authentication, Object object, Collection&lt;ConfigAttribute&gt; definition) {
          boolean jsr250AttributeFound = false;
  
          for (ConfigAttribute attribute : definition) {
              if (Jsr250SecurityConfig.PERMIT_ALL_ATTRIBUTE.equals(attribute)) {
                  return ACCESS_GRANTED;
              }
  
              if (Jsr250SecurityConfig.DENY_ALL_ATTRIBUTE.equals(attribute)) {
                  return ACCESS_DENIED;
              }
  
              if (supports(attribute)) {
                  jsr250AttributeFound = true;
                  // Attempt to find a matching granted authority
                  for (GrantedAuthority authority : extractAuthorities(authentication)) {
                      if (attribute.getAttribute().equals(authority.getAuthority())) {
                          return ACCESS_GRANTED;
                      }
                  }
              }
          }
  
          return jsr250AttributeFound ? ACCESS_DENIED : ACCESS_ABSTAIN;
      }
  
      Collection&lt;? extends GrantedAuthority&gt; extractAuthorities(Authentication authentication) {
          return roleHierarchy.getReachableGrantedAuthorities(authentication.getAuthorities());
      }
  }
  </code></pre>
  
  <p>Exception stacktrace is</p>
  
  <pre><code>    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hierarchicalJsr250Voter' defined in file [F:\yildirimBck\sts-bundle\pivotal-tc-server-developer-3.0.0.RELEASE\base-instance\wtpwebapps\trafficalarm\WEB-INF\classes\com\trafficalarm\rest\security\HierarchicalJsr250Voter.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.trafficalarm.rest.security.HierarchicalJsr250Voter]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.trafficalarm.rest.security.HierarchicalJsr250Voter.&lt;init&gt;()
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4760)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5184)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:581)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1686)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.trafficalarm.rest.security.HierarchicalJsr250Voter]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.trafficalarm.rest.security.HierarchicalJsr250Voter.&lt;init&gt;()
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)
      ... 26 more
  Caused by: java.lang.NoSuchMethodException: com.trafficalarm.rest.security.HierarchicalJsr250Voter.&lt;init&gt;()
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.getDeclaredConstructor(Unknown Source)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
      ... 27 more
  
  Apr 07, 2015 6:20:26 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  </code></pre>