facebook

Injection of persistence dependencies failed;

  1. MyEclipse IDE
  2.  > 
  3. Spring Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #318778 Reply

    rsearls
    Member

    How to resolve this error?
    Here is my setup

    On a MAC.
    Using MyEclipse for Spring 9.0: Spring 3.0 MVC Scaffolding
    I configured the MyEclipse DB perspective to use my Oracle 9i DB.
    I created a Web App Project.
    In that project I created JPA entities from my DB using the reverse eng feature.
    Using the Scaffold Spring CURD App feature I generated the CRUD from these JPA
    entities. In the wizard, selected Artifact type JPA Entities; selected the
    entities to use; selected application layers to generate, (Web Layer, Service
    Layer, DAO Layer); selected my DB connection; selected Spring MVC as the web client
    type; used default setting REST options; used default setting customize user interface;
    used default setting for target folders; used default setting for scaffolding options.

    Deployed app to MyEclipes Server App (tomcat)
    and get this error:

    INFO: Starting Servlet Engine: Apache Tomcat/6.0.13
    Aug 9, 2011 8:30:31 AM org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    2011-08-09 08:30:34,255 INFO [main] Version – Hibernate Annotations 3.5.5-Final
    2011-08-09 08:30:34,282 INFO [main] Environment – Hibernate 3.5.5-Final
    2011-08-09 08:30:34,286 INFO [main] Environment – loaded properties from resource hibernate.properties: {hibernate.bytecode.use_reflection_optimizer=false, hibernate.bytecode.provider=javassist}
    2011-08-09 08:30:34,290 INFO [main] Environment – Bytecode provider name : javassist
    2011-08-09 08:30:34,297 INFO [main] Environment – using JDK 1.4 java.sql.Timestamp handling
    2011-08-09 08:30:34,448 INFO [main] Version – Hibernate Commons Annotations 3.2.0.Final
    2011-08-09 08:30:34,458 INFO [main] Version – Hibernate EntityManager 3.5.5-Final
    2011-08-09 08:30:34,508 INFO [main] Ejb3Configuration – Processing PersistenceUnitInfo [
    name: test_mmt_qa_HBP_Oracle_DataSource
    …]
    2011-08-09 08:30:34,976 ERROR [main] ContextLoader – Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ClAssignmentService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hbsp.cl.leftbookend.dao.ClAssignmentDAO org.hbsp.cl.leftbookend.service.ClAssignmentServiceImpl.clAssignmentDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ClAssignmentDAO’: Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘test_mmt_qa_HBP_Oracle_DataSource’ defined in class path resource [mmt-admin-entity-dao-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: test_mmt_qa_HBP_Oracle_DataSource] class or package not found
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    :
    :

    The resource, ‘test_mmt_qa_HBP_Oracle_DataSource’ is defined in these files.

    resources/mmt-admin-entity-dao-context.xml
    resources/mmt-admin-entity-dao.properties
    test_mmt_qa_HBP_Oracle_DataSource.dialect=org.hibernate.dialect.Oracle9iDialect
    test_mmt_qa_HBP_Oracle_DataSource.show_sql=false
    test_mmt_qa_HBP_Oracle_DataSource.generateDdl=true
    test_mmt_qa_HBP_Oracle_DataSource.minPoolSize=1
    test_mmt_qa_HBP_Oracle_DataSource.maxPoolSize=10
    test_mmt_qa_HBP_Oracle_DataSource.connection.driver_class=oracle.jdbc.driver.OracleDriver

    resources/META-INF/persistence.xml
    WebRoot/WEB-INF/web.xml

    #318810 Reply

    jkennedy
    Member

    Sorry you are having an issue.

    Was there any further information in the stack trace that may go further?

    Did you add the Oracle driver to the project.

    If not, add it to the web-inf/lib folder and restart.

    Thanks,
    Jack

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Injection of persistence dependencies failed;

You must be logged in to post in the forum log in