title: How to send a spring bean from EJB project to Spring MVC project
body: <p>In my project there are two independent modules those are EJB with dao layer and Spring mvc with controller. Beans are there in the commons project, the commons project jar is there in the EJB and MVC projects. There is a bean called user.java, for this user bean i am setting some values in the ejb and i connot able to get in the spring mvc controller.</p>
  
  <p>It is show an Exception </p>
  
  <pre><code>Caused by: java.lang.ClassCastException: com.ex.beans.User cannot be cast to com.ex.beans.User
  </code></pre>
  
  <p>How can i solve this problem.</p>
  
  <p><strong>appService.java:-</strong> in EJB</p>
  
  <pre><code>User user=appDAO.getUser(username);
  return user;
  </code></pre>
  
  <p><strong>In MVC</strong></p>
  
  <pre><code>User user=appService.getUser(username);
  </code></pre>