title: HTTP Status 500 - Servlet.init() for servlet spring threw exception here is my code
body: <p>controller,service and dao are in different package UserSer interface and UserService class is on package com.service UserDa interface and UserDao class is on package com.dao and Controller is on Package com.controller please help me with this , if i am doing this all on the same package its working but for different package its not working </p>
  
  <p>thankyou </p>
  
  <pre><code>@Controller
  public class UserController {
  @Autowired
  public UserSer userSer;
  @RequestMapping(value="/get")
  public  void dummytest()
  {           
  System.out.println(userSer.SayHii());
  }
  }
  
  @Service("UserSer")
  public class UserService  implements UserSer{
  @Autowired
  public  UserDa userDa;  
  public String SayHii() {
  return userDa.Say();
  }
  }
  @Repository("UserDa")
  public class UserDao implements UserDa {
  public String Say()
  {
  return "hiiiiiiiiiiiii";
  }
  }
  
  
  
    web.xml
     * &lt;servlet&gt;
              &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
              &lt;servlet-class&gt;
                  org.springframework.web.servlet.DispatcherServlet
              &lt;/servlet-class&gt;
              &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
          &lt;/servlet&gt;
          &lt;servlet-mapping&gt;
              &lt;servlet-name&gt;spring&lt;/servlet-name&gt;
              &lt;url-pattern&gt;/&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;*
  spring-servlet.xml
  *&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:ctx="http://www.springframework.org/schema/context"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
   http://www.springframework.org/schema/mvc
   http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
   http://www.springframework.org/schema/context
   http://www.springframework.org/schema/context/spring-context-2.5.xsd
  "&gt;
  &lt;ctx:annotation-config&gt;&lt;/ctx:annotation-config&gt;
  &lt;mvc:annotation-driven/&gt;
  &lt;ctx:component-scan base-package="com.controller"&gt;&lt;/ctx:component-scan&gt;
  &lt;bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /&gt;
  &lt;bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /&gt; 
   &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/views/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  &lt;/bean&gt;*
  </code></pre>