-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 38 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: NoSuchMethodError during CGLIB initialization
PostPosted: Thu Mar 17, 2005 2:04 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
When I startup my application either during unit testing or in tomcat, CGLib initialization is failing with a NoSuchMethodError for ALL of my persistent ojbects. Any ideas on how to resolve this, other than disabling cglib? I have included an example full stack trace below as well as an example mapping. As you can see, it's a pretty trivial case.

I appreciate any help.

Hibernate version:

3.0 rc1

Mapping documents:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="com.chessys.bankanalysis.util.persistence.SystemParameter"
table="systemparameters"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>

<id
name="sysParamName"
column="SysParamName"
type="java.lang.String"
>
<generator class="assigned">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-SystemParameter.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<property
name="sysParamValue"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="SysParamValue"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-SystemParameter.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>


Full stack trace of any exception that occurs:
428375 2005-03-16 15:52:13,812 [http8080-Processor25] (CGLIBLazyInitializer.java:102) ERROR org.hibernate.proxy.BasicLazyInitializer - CGLIB Enhancement failed: com.chessys.bankanalysis.util.persistence.SystemParameter

net.sf.cglib.core.CodeGenerationException: java.lang.NoSuchMethodError-->com.chessys.bankanalysis.util.persistence.SystemParameter.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;

at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235)

at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220)

at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:216)

at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:566)

at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:493)

at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:220)

at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368)

at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:280)

at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:597)

at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:93)

at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:42)

at org.hibernate.tuple.PojoTuplizer.buildProxyFactory(PojoTuplizer.java:138)

at org.hibernate.tuple.AbstractTuplizer.<init>(AbstractTuplizer.java:83)

at org.hibernate.tuple.PojoTuplizer.<init>(PojoTuplizer.java:53)

at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:45)

at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:208)

at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:398)

at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)

at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)

at com.chessys.bankanalysis.util.persistence.HibernateUtil.<clinit>(HibernateUtil.java:92)

at com.chessys.bankanalysis.security.persistence.User.findByUsername(User.java:328)

at com.chessys.bankanalysis.security.SecurityManager.getUser(SecurityManager.java:81)

at com.chessys.bankanalysis.security.SmartAnalysisLogin.isUserValid(SmartAnalysisLogin.java:199)

at com.chessys.util.security.ChesapeakeLogin.authenticate(Unknown Source)

at org.apache.jsp.security.loginresults_jsp._jspService(loginresults_jsp.java:68)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)

at java.lang.Thread.run(Thread.java:534)

Caused by: java.lang.NoSuchMethodError: com.chessys.bankanalysis.util.persistence.SystemParameter.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;

at com.chessys.bankanalysis.util.persistence.SystemParameter$$EnhancerByCGLIB$$3592b2d4.CGLIB$getHibernateLazyInitializer$0$7(<generated>)

at com.chessys.bankanalysis.util.persistence.SystemParameter$$EnhancerByCGLIB$$3592b2d4$$FastClassByCGLIB$$4dd9abad.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)

at org.hibernate.proxy.CGLIBLazyInitializer$1.intercept(CGLIBLazyInitializer.java:161)

at com.chessys.bankanalysis.util.persistence.SystemParameter$$EnhancerByCGLIB$$3592b2d4.getHibernateLazyInitializer(<generated>)

at org.hibernate.Hibernate.getClass(Hibernate.java:318)

at com.chessys.bankanalysis.util.persistence.BaseDataObject.<init>(BaseDataObject.java:26)

at com.chessys.bankanalysis.util.persistence.SystemParameter.<init>(SystemParameter.java:49)

at com.chessys.bankanalysis.util.persistence.SystemParameter$$EnhancerByCGLIB$$3592b2d4.<init>(<generated>)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:274)

at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228)

... 56 more


Name and version of the database you are using:

Fails on SQLServer and Oracle.

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 3:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
for me it looks like you are using another version of cglib than the one that hibernate needs.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 4:26 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
Yes, I've been looking into classpath/version issues, but haven't found anything. I am using version 2.0.2, which I believe to be correct. It is the 4th entry in my classpath, behind my application classes directory and antlr.

skerstetter@SKERSTETTER ~/sa/dev/core/lib
$ jar -tf cglib-full-2.0.2.jar
META-INF/
META-INF/MANIFEST.MF
net/
net/sf/
net/sf/cglib/
net/sf/cglib/beans/
net/sf/cglib/core/
net/sf/cglib/proxy/
net/sf/cglib/reflect/
net/sf/cglib/transform/
net/sf/cglib/transform/hook/
net/sf/cglib/transform/impl/
net/sf/cglib/util/
LICENSE
NOTICE
net/sf/cglib/beans/BeanCopier$BeanCopierKey.class
net/sf/cglib/beans/BeanCopier$Generator.class
net/sf/cglib/beans/BeanCopier.class
net/sf/cglib/beans/BeanGenerator$BeanGeneratorKey.class
net/sf/cglib/beans/BeanGenerator.class
net/sf/cglib/beans/BeanMap$Generator$BeanMapKey.class
net/sf/cglib/beans/BeanMap$Generator.class
net/sf/cglib/beans/BeanMap.class
net/sf/cglib/beans/BeanMapEmitter$1.class
net/sf/cglib/beans/BeanMapEmitter$2.class
net/sf/cglib/beans/BeanMapEmitter$3.class
net/sf/cglib/beans/BeanMapEmitter.class
net/sf/cglib/beans/BulkBean$BulkBeanKey.class
net/sf/cglib/beans/BulkBean$Generator.class
net/sf/cglib/beans/BulkBean.class
net/sf/cglib/beans/BulkBeanEmitter.class
net/sf/cglib/beans/BulkBeanException.class
net/sf/cglib/beans/FixedKeySet.class
net/sf/cglib/beans/ImmutableBean$Generator.class
net/sf/cglib/beans/ImmutableBean.class
net/sf/cglib/core/AbstractClassGenerator$1.class
net/sf/cglib/core/AbstractClassGenerator$Source.class
net/sf/cglib/core/AbstractClassGenerator.class
net/sf/cglib/core/Block.class
net/sf/cglib/core/ClassEmitter$1.class
net/sf/cglib/core/ClassEmitter$2.class
net/sf/cglib/core/ClassEmitter$FieldInfo.class
net/sf/cglib/core/ClassEmitter.class
net/sf/cglib/core/ClassGenerator.class
net/sf/cglib/core/ClassInfo.class
net/sf/cglib/core/ClassNameReader$1.class
net/sf/cglib/core/ClassNameReader$EarlyExitException.class
net/sf/cglib/core/ClassNameReader.class
net/sf/cglib/core/ClassesKey$Key.class
net/sf/cglib/core/ClassesKey.class
net/sf/cglib/core/CodeEmitter$State.class
net/sf/cglib/core/CodeEmitter.class
net/sf/cglib/core/CodeGenerationException.class
net/sf/cglib/core/CollectionUtils.class
net/sf/cglib/core/Constants.class
net/sf/cglib/core/Converter.class
net/sf/cglib/core/Customizer.class
net/sf/cglib/core/DebuggingClassWriter$1.class
net/sf/cglib/core/DebuggingClassWriter.class
net/sf/cglib/core/DefaultGeneratorStrategy.class
net/sf/cglib/core/DefaultNamingPolicy.class
net/sf/cglib/core/DuplicatesPredicate.class
net/sf/cglib/core/EmitUtils$1.class
net/sf/cglib/core/EmitUtils$10.class
net/sf/cglib/core/EmitUtils$11.class
net/sf/cglib/core/EmitUtils$12.class
net/sf/cglib/core/EmitUtils$13.class
net/sf/cglib/core/EmitUtils$14.class
net/sf/cglib/core/EmitUtils$15.class
net/sf/cglib/core/EmitUtils$16.class
net/sf/cglib/core/EmitUtils$2.class
net/sf/cglib/core/EmitUtils$3.class
net/sf/cglib/core/EmitUtils$4.class
net/sf/cglib/core/EmitUtils$5.class
net/sf/cglib/core/EmitUtils$6.class
net/sf/cglib/core/EmitUtils$7.class
net/sf/cglib/core/EmitUtils$8.class
net/sf/cglib/core/EmitUtils$9.class
net/sf/cglib/core/EmitUtils$ArrayDelimiters.class
net/sf/cglib/core/EmitUtils$ParameterTyper.class
net/sf/cglib/core/EmitUtils.class
net/sf/cglib/core/GeneratorStrategy.class
net/sf/cglib/core/KeyFactory$1.class
net/sf/cglib/core/KeyFactory$2.class
net/sf/cglib/core/KeyFactory$Generator.class
net/sf/cglib/core/KeyFactory.class
net/sf/cglib/core/Local.class
net/sf/cglib/core/MethodInfo.class
net/sf/cglib/core/MethodInfoTransformer.class
net/sf/cglib/core/MethodWrapper$MethodWrapperKey.class
net/sf/cglib/core/MethodWrapper.class
net/sf/cglib/core/NamingPolicy.class
net/sf/cglib/core/ObjectSwitchCallback.class
net/sf/cglib/core/Predicate.class
net/sf/cglib/core/ProcessArrayCallback.class
net/sf/cglib/core/ProcessSwitchCallback.class
net/sf/cglib/core/ReflectUtils$1.class
net/sf/cglib/core/ReflectUtils$2.class
net/sf/cglib/core/ReflectUtils$3.class
net/sf/cglib/core/ReflectUtils$4.class
net/sf/cglib/core/ReflectUtils.class
net/sf/cglib/core/RejectModifierPredicate.class
net/sf/cglib/core/RemappingCodeVisitor$1.class
net/sf/cglib/core/RemappingCodeVisitor$IntRef.class
net/sf/cglib/core/RemappingCodeVisitor$State.class
net/sf/cglib/core/RemappingCodeVisitor.class
net/sf/cglib/core/Signature.class
net/sf/cglib/core/TinyBitSet.class
net/sf/cglib/core/Transformer.class
net/sf/cglib/core/TypeUtils.class
net/sf/cglib/core/VisibilityPredicate.class
net/sf/cglib/proxy/Callback.class
net/sf/cglib/proxy/CallbackFilter.class
net/sf/cglib/proxy/CallbackFilter2$1.class
net/sf/cglib/proxy/CallbackFilter2.class
net/sf/cglib/proxy/CallbackGenerator$Context.class
net/sf/cglib/proxy/CallbackGenerator.class
net/sf/cglib/proxy/CallbackHelper.class
net/sf/cglib/proxy/CallbackInfo.class
net/sf/cglib/proxy/Dispatcher.class
net/sf/cglib/proxy/DispatcherGenerator.class
net/sf/cglib/proxy/Enhancer$1.class
net/sf/cglib/proxy/Enhancer$2.class
net/sf/cglib/proxy/Enhancer$3.class
net/sf/cglib/proxy/Enhancer$4.class
net/sf/cglib/proxy/Enhancer$5.class
net/sf/cglib/proxy/Enhancer$6.class
net/sf/cglib/proxy/Enhancer$7.class
net/sf/cglib/proxy/Enhancer$8.class
net/sf/cglib/proxy/Enhancer$EnhancerKey.class
net/sf/cglib/proxy/Enhancer$EnhancerTransformer.class
net/sf/cglib/proxy/Enhancer.class
net/sf/cglib/proxy/Factory.class
net/sf/cglib/proxy/FixedValue.class
net/sf/cglib/proxy/FixedValueGenerator.class
net/sf/cglib/proxy/InterfaceMaker.class
net/sf/cglib/proxy/InvocationHandler.class
net/sf/cglib/proxy/InvocationHandlerGenerator.class
net/sf/cglib/proxy/LazyLoader.class
net/sf/cglib/proxy/LazyLoaderGenerator.class
net/sf/cglib/proxy/MethodInterceptor.class
net/sf/cglib/proxy/MethodInterceptorGenerator$1.class
net/sf/cglib/proxy/MethodInterceptorGenerator.class
net/sf/cglib/proxy/MethodProxy$1.class
net/sf/cglib/proxy/MethodProxy.class
net/sf/cglib/proxy/Mixin$Generator.class
net/sf/cglib/proxy/Mixin$MixinKey.class
net/sf/cglib/proxy/Mixin$Route.class
net/sf/cglib/proxy/Mixin.class
net/sf/cglib/proxy/MixinBeanEmitter.class
net/sf/cglib/proxy/MixinEmitter.class
net/sf/cglib/proxy/MixinEverythingEmitter.class
net/sf/cglib/proxy/NoOp$1.class
net/sf/cglib/proxy/NoOp.class
net/sf/cglib/proxy/NoOpGenerator.class
net/sf/cglib/proxy/Proxy$1.class
net/sf/cglib/proxy/Proxy$ProxyImpl.class
net/sf/cglib/proxy/Proxy.class
net/sf/cglib/proxy/UndeclaredThrowableException.class
net/sf/cglib/reflect/ConstructorDelegate$ConstructorKey.class
net/sf/cglib/reflect/ConstructorDelegate$Generator.class
net/sf/cglib/reflect/ConstructorDelegate.class
net/sf/cglib/reflect/FastClass$Generator.class
net/sf/cglib/reflect/FastClass.class
net/sf/cglib/reflect/FastClassEmitter$1.class
net/sf/cglib/reflect/FastClassEmitter$2.class
net/sf/cglib/reflect/FastClassEmitter$3.class
net/sf/cglib/reflect/FastClassEmitter$4.class
net/sf/cglib/reflect/FastClassEmitter$GetIndexCallback.class
net/sf/cglib/reflect/FastClassEmitter.class
net/sf/cglib/reflect/FastConstructor.class
net/sf/cglib/reflect/FastMember.class
net/sf/cglib/reflect/FastMethod.class
net/sf/cglib/reflect/MethodDelegate$Generator.class
net/sf/cglib/reflect/MethodDelegate$MethodDelegateKey.class
net/sf/cglib/reflect/MethodDelegate.class
net/sf/cglib/reflect/MulticastDelegate$1.class
net/sf/cglib/reflect/MulticastDelegate$Generator.class
net/sf/cglib/reflect/MulticastDelegate.class
net/sf/cglib/transform/AbstractClassFilterTransformer.class
net/sf/cglib/transform/AbstractClassLoader$1.class
net/sf/cglib/transform/AbstractClassLoader.class
net/sf/cglib/transform/AbstractClassTransformer.class
net/sf/cglib/transform/AbstractProcessTask.class
net/sf/cglib/transform/AbstractTransformTask.class
net/sf/cglib/transform/ClassEmitterTransformer.class
net/sf/cglib/transform/ClassFilter.class
net/sf/cglib/transform/ClassFilterTransformer.class
net/sf/cglib/transform/ClassReaderGenerator.class
net/sf/cglib/transform/ClassTransformer.class
net/sf/cglib/transform/ClassTransformerChain.class
net/sf/cglib/transform/ClassTransformerFactory.class
net/sf/cglib/transform/ClassTransformerTee.class
net/sf/cglib/transform/ClassVisitorTee.class
net/sf/cglib/transform/CodeVisitorTee.class
net/sf/cglib/transform/MethodFilter.class
net/sf/cglib/transform/MethodFilterTransformer.class
net/sf/cglib/transform/NullClassVisitor$NullCodeVisitor.class
net/sf/cglib/transform/NullClassVisitor.class
net/sf/cglib/transform/TransformingClassGenerator.class
net/sf/cglib/transform/TransformingClassLoader.class
net/sf/cglib/transform/hook/AbstractPreProcessor.class
net/sf/cglib/transform/hook/AsmClassLoaderPreProcessor$1.class
net/sf/cglib/transform/hook/AsmClassLoaderPreProcessor$PreProcessingVisitor.clas
s
net/sf/cglib/transform/hook/AsmClassLoaderPreProcessor.class
net/sf/cglib/transform/impl/AbstractInterceptFieldCallback.class
net/sf/cglib/transform/impl/AccessFieldTransformer$Callback.class
net/sf/cglib/transform/impl/AccessFieldTransformer.class
net/sf/cglib/transform/impl/AddDelegateTransformer$1.class
net/sf/cglib/transform/impl/AddDelegateTransformer.class
net/sf/cglib/transform/impl/AddInitTransformer$1.class
net/sf/cglib/transform/impl/AddInitTransformer.class
net/sf/cglib/transform/impl/AddPropertyTransformer.class
net/sf/cglib/transform/impl/AddStaticInitTransformer.class
net/sf/cglib/transform/impl/FieldProvider.class
net/sf/cglib/transform/impl/FieldProviderTransformer$1.class
net/sf/cglib/transform/impl/FieldProviderTransformer$2.class
net/sf/cglib/transform/impl/FieldProviderTransformer$3.class
net/sf/cglib/transform/impl/FieldProviderTransformer$4.class
net/sf/cglib/transform/impl/FieldProviderTransformer.class
net/sf/cglib/transform/impl/InterceptFieldCallback.class
net/sf/cglib/transform/impl/InterceptFieldEnabled.class
net/sf/cglib/transform/impl/InterceptFieldFilter.class
net/sf/cglib/transform/impl/InterceptFieldTransformer$1.class
net/sf/cglib/transform/impl/InterceptFieldTransformer.class
net/sf/cglib/transform/impl/UndeclaredThrowableStrategy$1.class
net/sf/cglib/transform/impl/UndeclaredThrowableStrategy.class
net/sf/cglib/transform/impl/UndeclaredThrowableTransformer$1.class
net/sf/cglib/transform/impl/UndeclaredThrowableTransformer.class
net/sf/cglib/util/ParallelSorter$ByteComparer.class
net/sf/cglib/util/ParallelSorter$ComparatorComparer.class
net/sf/cglib/util/ParallelSorter$Comparer.class
net/sf/cglib/util/ParallelSorter$DoubleComparer.class
net/sf/cglib/util/ParallelSorter$FloatComparer.class
net/sf/cglib/util/ParallelSorter$Generator.class
net/sf/cglib/util/ParallelSorter$IntComparer.class
net/sf/cglib/util/ParallelSorter$LongComparer.class
net/sf/cglib/util/ParallelSorter$ObjectComparer.class
net/sf/cglib/util/ParallelSorter$ShortComparer.class
net/sf/cglib/util/ParallelSorter.class
net/sf/cglib/util/ParallelSorterEmitter.class
net/sf/cglib/util/SorterTemplate.class
net/sf/cglib/util/StringSwitcher$1.class
net/sf/cglib/util/StringSwitcher$Generator.class
net/sf/cglib/util/StringSwitcher$StringSwitcherKey.class
net/sf/cglib/util/StringSwitcher.class
asm-license.txt
org/
org/objectweb/
org/objectweb/asm/
org/objectweb/asm/Attribute.class
org/objectweb/asm/ByteVector.class
org/objectweb/asm/ClassAdapter.class
org/objectweb/asm/ClassReader.class
org/objectweb/asm/ClassVisitor.class
org/objectweb/asm/ClassWriter.class
org/objectweb/asm/CodeAdapter.class
org/objectweb/asm/CodeVisitor.class
org/objectweb/asm/CodeWriter.class
org/objectweb/asm/Constants.class
org/objectweb/asm/Edge.class
org/objectweb/asm/Item.class
org/objectweb/asm/Label.class
org/objectweb/asm/Type.class


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 5:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
relooking it might be a problem with your SystemParameter class .... anything "weird" about it ? like being final or having no default constructor ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 6:04 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
Not that I see. It is a pojo that extends a serializable abstract base class. In addition to the javabean attributes, it defines static finders. It has a default, no-arg, public constructor and is not final.

Again, it would be for all of my classes so it might be reasonable to suspect the abstract base class is the problem, but this just defines a convenience reflective toString implementation, a logger and a static utilty method.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 6:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i must say i havent seen the error before, so to figure it out i would need you to provide a simple failing testcase and add it to the jira.

tia

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 3:45 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
"getHibernateLazyInitializer" is this method protected ?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 3:50 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Send me this class to baliuka at yahoo.com if you do not want to make it public, I am not sure, but it looks like problem is related to protected method call in constructor.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 6:17 pm 
Regular
Regular

Joined: Wed Nov 17, 2004 11:49 am
Posts: 65
Location: Pittsburgh
I have resolved the problem. In my abstract base class, I had the following line of code:

[code]
public abstract class BaseDataObject implements Serializable {

/**
* The log object used to put messages out to a centralized log.
*/
//protected Logger log = (Logger) Logger.getInstance(Hibernate.getClass(this).getName());
protected Logger log = (Logger) Logger.getInstance(getClass().getName());

[code]

The commented out version throws up the gang signs. The other version works fine. I am not sure which I prefer. Well, I prefer the version that works. [/code]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 8:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
baliukas?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2005 4:15 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I will test it, probably there is a way to solve this problem.
BTW "lazy" makes no sence in this case, object will be loaded before construction.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2005 6:14 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
This is side effect caused by proxy factory, it creates template for new instances. This template has simplified interceptor, it delegates persistent class method only and fails on any LazyInitilizer method.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2005 6:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and what does that mean in somewhat plain english ? ,)

anything we can do to fix it ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2005 6:29 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
One of way is to remove this optimization, but proxy creation will be expensive (constructor lookup and syncronized cache). Alternative is to implement fake interceptor for this special case.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 21, 2005 6:48 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I am not sure it is a good idea, but it avoids this error:

Code:
public static Factory getProxyFactory(final Class persistentClass, Class[] interfaces) throws HibernateException {
      //note: interfaces is assumed to already contain HibernateProxy.class
      try {
         
          MethodInterceptor interceptor = new MethodInterceptor(){

                public Object intercept(final Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
                   
                    if(method.getName().equals("getHibernateLazyInitializer")){
                       
                        return new  LazyInitializer(){

                            public void initialize() throws HibernateException {
                            }

                            public Serializable getIdentifier() {
                               
                                return null;
                            }

                            public void setIdentifier(Serializable id) {
                               
                               
                            }

                            public String getEntityName() {
                               
                                return "<<" + persistentClass.getName() +  " TEMPLATE >>";
                            }

                            public Class getPersistentClass() {
                               
                                return persistentClass;
                            }

                            public boolean isUninitialized() {
                               
                                return false;
                            }

                            public SessionImplementor getSession() {
                               
                                return null;
                            }

                            public void setSession(SessionImplementor s) throws HibernateException {
                               
                               
                            }

                            public Object getImplementation() {
                               
                                return obj;
                            }

                            public Object getImplementation(SessionImplementor s) throws HibernateException {
                               
                                return obj;
                            }
                           
                        };
                    }
                    return proxy.invokeSuper(obj,args);
                }
             
         
          };
         
         return (Factory) Enhancer.create(
            (interfaces.length==1) ?
               persistentClass :
               null,
            interfaces,
            interceptor
         );
      }
      catch (Throwable t) {
         LogFactory.getLog(BasicLazyInitializer.class).error(
               "CGLIB Enhancement failed: " +
               persistentClass.getName(),
               t
         );
         throw new HibernateException( "CGLIB Enhancement failed: " + persistentClass.getName(), t );
      }
   }


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 38 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.