java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Is it legal to map a many-to-one class to an interface. I have done this with the father property (in the attached example), however, I am receiving errors when I try to load records where the parent property is not null. I have attached a set of files that demonstrate the error I am getting. To use: 1. run the sql script to build files and populate data Note: I'm using MySQL so you might have to change for a different DB 2. Change eg.test configuration properites to reflect your DB setup 3. Run eg.test Everything should work fine and "Detail B1 - F3" should be printed to the output 4. Now in eg.test, change the configuration to use eg.IFather instead of eg.Father 5. In IDetail, change the m-1 father property from eg.Father to eg.IFather 6. Re-run and you will get this error. Exception in thread "main" java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.HibernateException: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:37) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:59) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at eq.test.main(test.java:43) Chris....
    via by Chris Hane,
  • Is it legal to map a many-to-one class to an interface. I have done this with the father property (in the attached example), however, I am receiving errors when I try to load records where the parent property is not null. I have attached a set of files that demonstrate the error I am getting. To use: 1. run the sql script to build files and populate data Note: I'm using MySQL so you might have to change for a different DB 2. Change eg.test configuration properites to reflect your DB setup 3. Run eg.test Everything should work fine and "Detail B1 - F3" should be printed to the output 4. Now in eg.test, change the configuration to use eg.IFather instead of eg.Father 5. In IDetail, change the m-1 father property from eg.Father to eg.IFather 6. Re-run and you will get this error. Exception in thread "main" java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.HibernateException: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:37) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39) rethrown as net.sf.hibernate.LazyInitializationException: Hibernate lazy instantiation problem: CGLIB Enhancement failed: No visible constructors in interface eg.IFather at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:59) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at eq.test.main(test.java:43) Chris....
    via by Chris Hane,
    • java.lang.IllegalArgumentException: No visible constructors in interface eg.IFather at net.sf.cglib.EnhancerGenerator.<init>(EnhancerGenerator.java:128) at net.sf.cglib.Enhancer.enhanceClassHelper(Enhancer.java:224) at net.sf.cglib.Enhancer.enhanceHelper(Enhancer.java:206) at net.sf.cglib.Enhancer.enhance(Enhancer.java:162) at net.sf.cglib.Enhancer.enhance(Enhancer.java:139) at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxy(CGLIBLazyInitializer.java:26) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1790) at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1728) at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:62) at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:1971) at net.sf.hibernate.loader.Loader.doFind(Loader.java:196) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:587) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:42) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:392) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:1901) at net.sf.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1710) at net.sf.hibernate.proxy.LazyInitializer.initialize(LazyInitializer.java:48) at net.sf.hibernate.proxy.LazyInitializer.initializeWrapExceptions(LazyInitializer.java:55) at net.sf.hibernate.proxy.LazyInitializer.getImplementation(LazyInitializer.java:153) at net.sf.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:49) at eg.DetailB$$EnhancedByCGLIB$$0.getTestValue(<generated>) at com.test.main(test.java:39)
    No Bugmate found.