Announcement Announcement Module
Collapse
No announcement yet.
an strange error with net.sf.cglib.core.KeyFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • an strange error with net.sf.cglib.core.KeyFactory

    I have an project, where test spring with flex integration.
    On server side i have spring+hibernate+mysql.
    I get an strange error:
    Code:
    Jun 9, 2009 8:04:19 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    Jun 9, 2009 8:04:20 PM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring FrameworkServlet 'testdrive'
    Jun 9, 2009 8:04:22 PM org.apache.catalina.core.ApplicationContext log
    SEVERE: StandardWrapper.Throwable
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:483)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:276)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:273)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:175)
    	...................................................
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:476)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
    	... 41 more
    Caused by: java.lang.ExceptionInInitializerError
    	at org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:228)
    	at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:170)
    	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
    	at org.springframework.flex.core.EndpointConfigProcessor.processAfterStartup(EndpointConfigProcessor.java:68)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.processAfterStart(MessageBrokerFactoryBean.java:286)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:166)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
    	... 61 more
    Caused by: java.lang.ClassCastException: net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72 cannot be cast to net.sf.cglib.core.KeyFactory
    	at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
    	at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
    	... 69 more
    Jun 9, 2009 8:04:22 PM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /blazeds threw load() exception
    java.lang.ClassCastException: net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72 cannot be cast to net.sf.cglib.core.KeyFactory
    	at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
    	at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
    	at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
    	at org.springframework.aop.framework.Cglib2AopProxy.createEnhancer(Cglib2AopProxy.java:228)
    	at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:170)
    	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
    	at org.springframework.flex.core.EndpointConfigProcessor.processAfterStartup(EndpointConfigProcessor.java:68)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.processAfterStart(MessageBrokerFactoryBean.java:286)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:166)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:476)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:412)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:383)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:276)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:273)
    I don't know what can be!!
    This error appear when i put these lines in my applicationContext ile, where it's defined bean for hibernate.
    Code:
    <property name="annotatedClasses">
           <list>
    		<value>test.Zone</value>
           </list>
    </property>
    My Zone class look's like this:
    Code:
    package test;
    
    import javax.persistence.*;
    
    @Entity
    @Table(name = "zone")
    public class Zone {
    
    	@Id
    	@Column(name = "zonaId")
    	private Integer zonaId;
    	
    	@Column(name = "zona")
    	private String zona;
    	
    	public Integer getZonaId() {
    		return this.zonaId;
    	}
    
    	public void setZonaId(Integer zonaId) {
    		this.zonaId = zonaId;
    	}
    
    	public String getZona() {
    		return this.zona;
    	}
    
    	public void setZona(String zona) {
    		this.zona = zona;
    	}
    
    }

  • #2
    Ok, i resolve with that error. Seem that need to put in my lib directory cglib.jar instead cglib_nodep.jar.
    Second, need to have asm.jar in my lib.
    Now, work just fine.

    Comment


    • #3
      versions

      i am seeing a similiar issue. could you tell me the versions of:

      cglib-nodep
      cglib
      asm
      spring

      that you used in this?

      Comment

      Working...
      X