<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=alisonr" rel="nofollow">Alison Rosewarne</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5145?redirect=false" rel="nofollow">SPR-5145</a></strong> and commented</p>
<p dir="auto">After upgrading to junit 4.5 my test class which uses the SpringJUnit4ClassRunner gets a NoClassDefFoundError:</p>
<p dir="auto">org.apache.maven.surefire.booter.SurefireExecutionException: org/junit/Assume$AssumptionViolatedException; nested exception is java.lang.NoClassDefFoundError: org/junit/Assume$AssumptionViolatedException<br>
java.lang.NoClassDefFoundError: org/junit/Assume$AssumptionViolatedException<br>
at org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:240)<br>
at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)<br>
at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)<br>
at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)<br>
at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)<br>
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:142)<br>
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:59)</p>
<p dir="auto">etc.</p>
<p dir="auto">This is a Junit 4.5 issue.  The static class AssumptionViolatedException within org.junit.Assume that existed in 4.4 has become org.junit.internal.AssumptionViolatedException.</p>
<p dir="auto">The file tiger/mock/org/springframework/test/context/junit4/SpringMethodRoadie.java imports org.junit.Assume.AssumptionViolatedException which is why my test is failing.</p>
<p dir="auto">Workaround is to stick with Junit 4.4.</p>
<p dir="auto">(Aside: are there plans to create a "SpringTEST" component?).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.5</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/14674/junit4.5.patch" rel="nofollow">junit4.5.patch</a> (<em>43.97 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398091060" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9844" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9844/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9844">#9844</a> Incompatible with JUnit 4.5 (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398095979" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10557" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10557/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10557">#10557</a> Upgrade the Spring TestContext Framework to JUnit 4.6</li>
</ul>
<p dir="auto"><strong>Referenced from:</strong> commits <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/d159195b79ab02c25217e0503e804e53dff28b43/hovercard" href="https://github.com/spring-projects/spring-framework/commit/d159195b79ab02c25217e0503e804e53dff28b43"><tt>d159195</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/c0c9501005750f06f4cac355ef576a3730665b2c/hovercard" href="https://github.com/spring-projects/spring-framework/commit/c0c9501005750f06f4cac355ef576a3730665b2c"><tt>c0c9501</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/9daae23e17c4294af5fdbf9dc10a0ce959534a24/hovercard" href="https://github.com/spring-projects/spring-framework/commit/9daae23e17c4294af5fdbf9dc10a0ce959534a24"><tt>9daae23</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/e5d2570c8d9a005a7f9e0dd5b667528895ef4321/hovercard" href="https://github.com/spring-projects/spring-framework/commit/e5d2570c8d9a005a7f9e0dd5b667528895ef4321"><tt>e5d2570</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/751e0f0eb77f5330169cf0fd6c046e5bbfb23af4/hovercard" href="https://github.com/spring-projects/spring-framework/commit/751e0f0eb77f5330169cf0fd6c046e5bbfb23af4"><tt>751e0f0</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/62c991f9d6ebaa404d71ac1fad84c8128fd47ca0/hovercard" href="https://github.com/spring-projects/spring-framework/commit/62c991f9d6ebaa404d71ac1fad84c8128fd47ca0"><tt>62c991f</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/6327b3484b2fe34bacc85b4e70641a6baec5274e/hovercard" href="https://github.com/spring-projects/spring-framework/commit/6327b3484b2fe34bacc85b4e70641a6baec5274e"><tt>6327b34</tt></a></p>
<p dir="auto">3 votes, 11 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=mrgcos" rel="nofollow">Gordon Cosgrave</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2669?redirect=false" rel="nofollow">SPR-2669</a></strong> and commented</p>
<p dir="auto">org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [testApplicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [testApplicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: SessionFactory not initialized yet<br>
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [testApplicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: SessionFactory not initialized yet<br>
Caused by: java.lang.IllegalStateException: SessionFactory not initialized yet<br>
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.getSessionFactory(AbstractSessionFactoryBean.java:175)<br>
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.updateDatabaseSchema(LocalSessionFactoryBean.java:918)<br>
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:762)<br>
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:131)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)<br>
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)<br>
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)<br>
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:955)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)<br>
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)<br>
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:92)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:77)<br>
at SchemaUpdater.main(SchemaUpdater.java:13)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 final</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398071766" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7387" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7387/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7387">#7387</a> LocalSessionFactoryBean when schemaUpdate is true fail to build session factory (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398073598" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/7611" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/7611/hovercard" href="https://github.com/spring-projects/spring-framework/issues/7611">#7611</a> Can't use the schemaupdate=true functionality in Spring 2.0.1 (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>