title: Cannot resolve reference to bean while setting bean property
body: <p>Can you help resolving the below error as i am setting the REST example for the first time.
  I am getting error while Tomcat 6 is started SEVERE:</p>
  
  <blockquote>
    <p>Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name'restContainer': Cannot resolve reference to
    bean 'probablyPrimeSerivce' while setting bean property 'serviceBeans'
    with key [0]; nested exception is
    rg.springframework.beans.factory.NoSuchBeanDefinitionException: No
    bean named 'probablyPrimeSerivce' is defined</p>
  </blockquote>
  
  <p>My beans.xml  </p>
  
  <pre><code>  &lt;beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xmlns:cxf="http://cxf.apache.org/core" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://cxf.apache.org/jaxrs 
    http://cxf.apache.org/schemas/jaxrs.xsd 
    http://cxf.apache.org/core 
    http://cxf.apache.org/schemas/core.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd"&gt; 
  
    &lt;import resource="classpath:META-INF/cxf/cxf.xml"/&gt; 
    &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml"/&gt; 
  
  
     &lt;context:component-scan base-package="com" /&gt;
  
  
    &lt;jaxrs:server id="restContainer" address="/"&gt; 
      &lt;jaxrs:serviceBeans&gt; 
      &lt;ref bean="probablyPrimeSerivce"/&gt; 
      &lt;/jaxrs:serviceBeans&gt; 
   &lt;/jaxrs:server&gt; 
  
  
  &lt;/beans&gt; 
  </code></pre>
  
  <p>================================================</p>
  
  <p>My ProbablyPrimeSerivce class</p>
  
  <pre><code>@Service("probablyPrimeSerivce")
  @Path("/prime")
  public class ProbablyPrimeSerivce {
  
  @GET
  @Path("/{number}")
  @Produces("text/plain")
  public boolean  isPrime(@PathParam("number") int number){
      return true;
  }
  }
  </code></pre>
  
  <p>====================================</p>
  
  <p><img src="https://i.stack.imgur.com/7TGg8.jpg" alt="enter image description here"></p>