Results 1 to 1 of 1

Thread: Unable to autowire velocity engine

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Default Unable to autowire velocity engine

    Using Spring-3.1.0 and Velocity-1.6.3

    Keep getting proxy error when trying to autowire velocityEngine... have tried to use proxy-target-class="true" but that causes HibernateSessionImpl to fail with CGLIB... any help would be great....

    config.xml
    Code:
      <aop:aspectj-autoproxy/>
      <tx:annotation-driven>
    
       <bean id="velocityEngne" class="org.springframework.ui.velocity.VelocityEngineFactoryBean"
                p:resourceLoaderPath="classpath:com/acme/template"
                p:preferFileSystemAccess="false"/>

    Service class
    Code:
    @Component
    @Transactional
    public class ServiceImpl implements Service
    {
    
      @Autowired
      private VelocityEngine velocityEngine
    
    }

    causes this error...
    Code:
    Caused by: java.lang.IllegalArgumentException: Can not set org.apache.velocity.app.VelocityEngine field com.acme.service.Service.velocityEngine to $Proxy74
    Last edited by arreyf; Apr 26th, 2012 at 09:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •