Announcement Announcement Module
Collapse
No announcement yet.
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer

    Hi ,I am trying on a samll app on sprin-hibernate integration with annnotation and getting error ::

    Jun 1, 2011 3:21:11 PM org.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    Jun 1, 2011 3:21:11 PM org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@10f11b8: defining beans [org.springframework.beans.factory.config.PropertyP laceholderConfigurer#0,dataSource,sessionFactory,o rg.springframework.context.annotation.internalConf igurationAnnotationProcessor,org.springframework.c ontext.annotation.internalAutowiredAnnotationProce ssor,org.springframework.context.annotation.intern alRequiredAnnotationProcessor,org.springframework. context.annotation.internalCommonAnnotationProcess or,org.springframework.context.annotation.internal PersistenceAnnotationProcessor]; root of factory hierarchy
    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1420)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:563)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:139)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:83)
    at app.RunEStore.main(RunEStore.java:14)
    Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.c onstructTuplizer(EntityTuplizerFactory.java:110)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.c onstructDefaultTuplizer(EntityTuplizerFactory.java :135)
    at org.hibernate.tuple.entity.EntityEntityModeToTupli zerMapping.<init>(EntityEntityModeToTuplizerMappin g.java:56)
    at org.hibernate.tuple.entity.EntityMetamodel.<init>( EntityMetamodel.java:323)
    at org.hibernate.persister.entity.AbstractEntityPersi ster.<init>(AbstractEntityPersister.java:433)
    at org.hibernate.persister.entity.SingleTableEntityPe rsister.<init>(SingleTableEntityPersister.java:109 )
    at org.hibernate.persister.PersisterFactory.createCla ssPersister(PersisterFactory.java:55)
    at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:231)
    at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1313)
    at org.hibernate.cfg.AnnotationConfiguration.buildSes sionFactory(AnnotationConfiguration.java:859)
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.newSessionFactory(LocalSessionFactoryBean .java:860)
    at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:779)
    at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:211)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1477)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1417)
    ... 12 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.c onstructTuplizer(EntityTuplizerFactory.java:107)
    ... 26 more
    Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/Type
    at net.sf.cglib.core.TypeUtils.parseType(TypeUtils.ja va:180)
    at net.sf.cglib.core.KeyFactory.<clinit>(KeyFactory.j ava:66)
    at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java :69)
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitialize r.getProxyFactory(CGLIBLazyInitializer.java:117)
    at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.p ostInstantiate(CGLIBProxyFactory.java:43)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buil dProxyFactory(PojoEntityTuplizer.java:188)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer. <init>(AbstractEntityTuplizer.java:128)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<ini t>(PojoEntityTuplizer.java:78)



    Any One can help me to solve this problem...

  • #2
    Please use [ code][/code ] tags when posting code/xml/stacktraces ...

    Have you actually looked at the stacktrace. It is a classnotfound. You need to include the asm.jar in your classpath... I suggest using maven or ant/ivy or gradle to manage your dependencies. Saves you a lot of headaches.

    Comment


    • #3
      Thanks Deinum...

      As this is my first post so dnt knw exactly hw to post code/xml etc....

      well using asm.jar previous problem is solved but with one new error..an error is :

      Code:
      Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'productService' is defined
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:274)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
      	at app.RunEStore.main(RunEStore.java:15)
      And main class is

      Code:
      package app;
      
      import org.springframework.context.ApplicationContext;
      import org.springframework.context.support.ClassPathXmlApplicationContext;
      
      import dao.Product;
      import service.ProductService;
      
      public class RunEStore {
      
          public static void main(String[] args) {
              ApplicationContext ctx = new ClassPathXmlApplicationContext("META-INF/app-context.xml");
              ProductService productService = (ProductService) ctx.getBean("productService");
              Product product1 = new Product();
      ................
      ProductService class is..

      Code:
      import dao.Product;
      
      @Service("productService")
      public class ProductService {
      
      	@Autowired 
               ProductDAO productDAO;
      	   
              public void save(Product product){
                  System.out.println("save called");
                  productDAO.save(product);
      ........
      ProductDao class is..

      Code:
      import org.springframework.stereotype.Repository;
      
      
      @Repository("productDao")
      public class ProductDAO implements IProductDAO {
      
          private HibernateTemplate hibernateTemplate;
      
          @Autowired
          public void setSessionFactory(SessionFactory sessionFactory) {
              hibernateTemplate = new HibernateTemplate(sessionFactory);
          }
          public void save(Product product) {
              hibernateTemplate.save(product);
      ........
      please help...

      Comment


      • #4
        Hi Deinum....

        I got the problem and solved it ..now it running fine....

        Thanks

        Comment


        • #5
          AND ? What was problem ?

          Comment


          • #6
            It is a classnotfound. You need to include the asm.jar in your classpath... I suggest using maven or ant/ivy or gradle to manage your dependencies.Attachment
            Attached Files

            Comment

            Working...
            X