java.lang.IllegalStateException

Failed to load ApplicationContext


Solutions on the web12840

Solution icon of coderanch
via Coderanch by Laxmi Prasanna Bn, 7 months ago
Failed to load ApplicationContext

Solution icon of bugzilla
via Eclipse Bugzilla by franknleslie, 1 year ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by simon-brooke
, 4 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by blueelephants
, 7 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by hidetarou2013
, 6 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by joshuawilson
, 3 weeks ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by jot-hub
, 5 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by wilkinsona
, 10 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by jaideepmehta
, 10 months ago
Failed to load ApplicationContext

Solution icon of github
via GitHub by philwebb
, 10 months ago
Failed to load ApplicationContext

Stack trace

  • java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:308) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:333) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:220) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:301) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:303) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cataService' defined in file [/opt/IBM/WebSphere/jenkins/jenkins_home/workspace/CMC_Junit/war/classes/main/com/abchina/cmc/service/impl/CataServiceImpl.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.abchina.cmc.mapper.CataInfoMapper.selectCataByWhere at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 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.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84) at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1) at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280) at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304) Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.abchina.cmc.mapper.CataInfoMapper.selectCataByWhere at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:595) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:437) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:430) at org.apache.ibatis.binding.MapperMethod.setupCommandType(MapperMethod.java:188)

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

Samebug visitor profile picture
Unknown user
Once, 9 months ago
Samebug visitor profile picture
Unknown user
Once, 11 months ago