org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'groupSectionAPIController' defined in file [/home/akshay/modulemyapp/target/BASE_MODULE/WEB-INF/classes/com/myapp/spring/ApiController/GroupSectionAPIController.class]: Post-processing failed of bean type [class com.myapp.spring.ApiController.GroupSectionAPIController] failed; nested exception is java.lang.IllegalStateException: Failed to introspect bean class [com.myapp.spring.ApiController.GroupSectionAPIController] for persistence metadata: could not find class that it depends on

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web259

  • via Unknown by Unknown author,
  • Stack trace

    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'groupSectionAPIController' defined in file [/home/akshay/modulemyapp/target/BASE_MODULE/WEB-INF/classes/com/myapp/spring/ApiController/GroupSectionAPIController.class]: Post-processing failed of bean type [class com.myapp.spring.ApiController.GroupSectionAPIController] failed; nested exception is java.lang.IllegalStateException: Failed to introspect bean class [com.myapp.spring.ApiController.GroupSectionAPIController] for persistence metadata: could not find class that it depends on at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:936)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)[spring-context-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:664)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:630)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:678)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:549)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:490)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)[spring-webmvc-4.1.7.RELEASE.jar:4.1.7.RELEASE] at javax.servlet.GenericServlet.init(GenericServlet.java:158)[servlet-api.jar:3.0.FR] Caused by: java.lang.IllegalStateException: Failed to introspect bean class [com.myapp.spring.ApiController.GroupSectionAPIController] for persistence metadata: could not find class that it depends on at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:396)[spring-orm-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333)[spring-orm-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:931)[spring-beans-4.1.7.RELEASE.jar:4.1.7.RELEASE] ... 17 more Caused by: java.lang.NoClassDefFoundError: Lcom/myapp
    • otification/service/NotificationService; at java.lang.Class.getDeclaredFields0(Native Method)[na:1.8.0_101] at java.lang.Class.privateGetDeclaredFields(Class.java:2583)[na:1.8.0_101] at java.lang.Class.getDeclaredFields(Class.java:1916)[na:1.8.0_101] at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.buildPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:411)[spring-orm-4.1.7.RELEASE.jar:4.1.7.RELEASE] at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:392)[spring-orm-4.1.7.RELEASE.jar:4.1.7.RELEASE] ... 20 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitor2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    28 more bugmates