title: spring autowiring fails with @Transactional
body: <p>I want to use @Transactional annotation in the save() method of UserService(concrete class) as follows:</p>
  
  <pre><code>@Service
  public class UserService {
  
      @Transactional
      public Long save(User userCommand, BindingResult result) {
      ...
      }
  
  }
  </code></pre>
  
  <p>I will use this service in MyRealm by autowiring.</p>
  
  <pre><code>public class MyRealm extends AuthorizingRealm {
  
      @Autowired
      private UserService userService;
  
  }
  </code></pre>
  
  <p>However, it fails with the following error:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Can not set n.r.c.s.user.UserService field n.r.c.s.realm.MyRealm.userService to com.sun.proxy.$Proxy48
  </code></pre>
  
  <p>Of course, it works if I remove the @Transational annotation.</p>
  
  <p>My transaction manager setting is as follows:</p>
  
  <pre><code>&lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  </code></pre>
  
  <p>Please, let me know what's wrong with my code?</p>
  
  <p>Do I need to set up something like proxy?</p>