Announcement Announcement Module
Collapse
No announcement yet.
Unable to autowire velocity engine Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 10:22 AM.
Working...
X