No persistence units parsed from {classpath*:META-INF/persistence.xml}问题解决

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'hotelsController' defined in file [D:\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\openbi\WEB-INF\classes\org\springframework\webflow\samples\booking\HotelsController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.springframework.webflow.samples.booking.BookingService]: : Error creating bean with name 'bookingService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-access-config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bookingService': Injection of persistence methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/config/data-access-config.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}

注意,这里的META-INF应该是位于classes同级目录的,不是和web-inf同级目录的,切记。

你可能感兴趣的:(eclipse,xml,bean,Web,Access)