Announcement Announcement Module
Collapse
No announcement yet.
Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption

    Hi,
    I am getting following error

    Exception in thread "main" org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myTxManager' defined in URL : Invocation of init method failed; nested exception is org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1488)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:524)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:461)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 95)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:223)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:292 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:626)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:479)
    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 com.novelty.sprhib.TestClient.test(TestClient.java :38)
    at com.novelty.sprhib.TestClient.main(TestClient.java :34)
    Caused by: org.hibernate.service.UnknownUnwrapTypeException: Cannot unwrap to requested type [javax.sql.DataSource]
    at org.hibernate.service.jdbc.connections.internal.Dr iverManagerConnectionProviderImpl.unwrap(DriverMan agerConnectionProviderImpl.java:93)
    at org.springframework.orm.hibernate4.SessionFactoryU tils.getDataSource(SessionFactoryUtils.java:91)
    at org.springframework.orm.hibernate4.HibernateTransa ctionManager.afterPropertiesSet(HibernateTransacti onManager.java:335)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1547)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1485)
    ... 13 more
    Last edited by SpringEnthusiast; Jun 28th, 2013, 05:58 AM.

  • #2
    A bit of googling turns up this: Spring-Hibernate-transaction-Management-unwrap. Does that provide any insight into your problem?

    Comment


    • #3
      Finally, the article did fix the issue.

      Comment

      Working...
      X