Announcement Announcement Module
No announcement yet.
Couldn't generate CGLIB subclass of class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Couldn't generate CGLIB subclass of class

    I am using Spring 2.0 with Hibernate 3.0 and JPA. I am also using annotations for JPA fields and Transactions. I am getting following error:
    org.springframework.aop.framework.AopConfigExcepti on: Couldn't generate CGLIB subclass of class [class]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
    Caused by:
    java.lang.IllegalArgumentException: Superclass has no null constructors but no arguments were given
    at net.sf.cglib.proxy.Enhancer.emitConstructors(Enhan
    at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer .java:499)
    at net.sf.cglib.transform.TransformingClassGenerator. generateClass(
    at net.sf.cglib.core.DefaultGeneratorStrategy.generat e(
    at net.sf.cglib.core.AbstractClassGenerator.create(Ab
    at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer. java:377)
    at net.sf.cglib.proxy.Enhancer.create( 85)
    at org.springframework.aop.framework.Cglib2AopProxy.g etProxy(
    at org.springframework.aop.framework.Cglib2AopProxy.g etProxy(

    It looks like Spring is trying to run my class MetaManager through CGLib even though I don't have any Transaction attributes defined for that class. Is there a way to disable CGLib for some beans. Thanks.

    Here is my spring configuration file:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    default-autowire="byName" default-lazy-init="true" >

    <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerE ntityManagerFactoryBean">
    <property name="jpaVendorAdapter">
    class="org.springframework.orm.jpa.vendor.Hibernat eJpaVendorAdapter">
    <property name="showSql" value="true" />
    <property name="generateDdl" value="false" />
    <property name="databasePlatform" value="org.hibernate.dialect.Oracle9Dialect" />
    <property name="loadTimeWeaver">
    <bean class="org.springframework.instrument.classloading .ReflectiveLoadTimeWeaver"/>

    <!-- a PlatformTransactionManager is still required -->
    <bean id="txManager" class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="dataSource"/>

    <tx:annotation-driven transaction-manager="txManager"/>

    <bean id="dataElementDao" class=" ernateDao"/>

    <bean id="dataPointDao" class=" nateDao"/>

    <bean id="dataFrequencyDao" class=" ibernateDao"/>

    <bean id="planningLevelDao" class=" ibernateDao"/>

    <bean id="planningLevelManager" class=" nagerImpl">
    <ref bean="planningLevelDao"/>
    <property name="scenarioManager"><ref local="scenarioManager"/></property>



  • #2
    In case of Hibernate JPA implementation, the loadTimeWeaver is not required.