<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=framiere" rel="nofollow">Florent Ramiere</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6902?redirect=false" rel="nofollow">SPR-6902</a></strong> and commented</p>
<p dir="auto">When this method is executed</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@ExceptionHandler
@ResponseBody
public String dummyExceptionHandler(Exception e) {
    return e.getMessage();
}"><pre class="notranslate"><code class="notranslate">@ExceptionHandler
@ResponseBody
public String dummyExceptionHandler(Exception e) {
    return e.getMessage();
}
</code></pre></div>
<p dir="auto">Spring mvc tries to resolve the view using the method output --&gt; 404.<br>
As the method is annotated with <code class="notranslate">@ResponseBody</code>, it should directly write the method output to the response.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.1</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/17505/spr-6902.zip" rel="nofollow">spr-6902.zip</a> (<em>32.61 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="398105129" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11850" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11850/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11850">#11850</a> AnnotationMethodHandlerAdapter and AnnotationMethodHandlerExceptionResolver should supports MappingJacksonHttpMessageConverter by default (<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="398109214" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12476" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12476/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12476">#12476</a> Add support for <code class="notranslate">@Request-</code>/<code class="notranslate">@ResponseBody</code> to <code class="notranslate">@ExceptionHandler</code> methods (<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="398103691" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11626" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11626/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11626">#11626</a> <code class="notranslate">@ResponseStatus</code> does not work with <code class="notranslate">@ExceptionHandler</code></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/157623b47fa3bc9fd8d9a3d8803bcf6bf9a50b80/hovercard" href="https://github.com/spring-projects/spring-framework/commit/157623b47fa3bc9fd8d9a3d8803bcf6bf9a50b80"><tt>157623b</tt></a>, <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/spring-projects/spring-framework/commit/7f8c91a52dcea4810acebb0f9ebe86233a3d2063/hovercard" href="https://github.com/spring-projects/spring-framework/commit/7f8c91a52dcea4810acebb0f9ebe86233a3d2063"><tt>7f8c91a</tt></a></p>
<p dir="auto">0 votes, 8 watchers</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=zyzjaffery" rel="nofollow">Yaozong Zhu</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4759?redirect=false" rel="nofollow">SPR-4759</a></strong> and commented</p>
<p dir="auto">I am trying to integrate my tests into Spring 2.5 availing of TestContext annotations. But I met a support issue. The followings are relevant codes:</p>
<p dir="auto"><code class="notranslate">@RunWith</code>(SpringJUnit4ClassRunner.class)<br>
<code class="notranslate">@TestExecutionListeners</code>(value = {<br>
DependencyInjectionTestExecutionListener.class,<br>
DirtiesContextTestExecutionListener.class,<br>
TransactionalTestExecutionListener.class<br>
})<br>
<code class="notranslate">@ContextConfiguration</code>(locations = {<br>
"classpath:/applicationContext-resources.xml",<br>
"classpath*:/applicationContext.xml"<br>
}, inheritLocations = true)<br>
<code class="notranslate">@TransactionConfiguration</code>(transactionManager = "transactionManager", defaultRollback = true)<br>
<code class="notranslate">@Transactional</code><br>
public abstract class BaseTestCase extends AbstractJUnit4SpringContextTests {...}</p>
<p dir="auto"><code class="notranslate">@ContextConfiguration</code>(locations = {<br>
"classpath:/applicationContext-jmx.xml",<br>
"/WEB-INF/applicationContext*.xml",<br>
"/WEB-INF/dispatcher-servlet.xml"<br>
}, inheritLocations = true)<br>
public abstract class BaseWebControllerTestCase extends BaseTestCase{...}</p>
<p dir="auto">public class UserFormControllerTest extends BaseWebControllerTestCase{<br>
<code class="notranslate">@Autowired</code><br>
private UserFormController c = null;</p>
<p dir="auto"><code class="notranslate">@Test</code><br>
...<br>
}</p>
<p dir="auto">java.lang.IllegalStateException: WebApplicationObjectSupport instance [xxx.UserFormController@123961b] does not run in a WebApplicationContext but in: org.springframework.context.support.GenericApplicationContext@1fc2fb: display name [org.springframework.context.support.GenericApplicationContext@1fc2fb]; startup date [Mon Apr 28 15:35:37 BST 2008]; root of context hierarchy<br>
at org.springframework.web.context.support.WebApplicationObjectSupport.getWebApplicationContext(WebApplicationObjectSupport.java:101)<br>
at org.springframework.web.context.support.WebApplicationObjectSupport.getServletContext(WebApplicationObjectSupport.java:115)<br>
...</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.2</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="398091548" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9917" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9917/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9917">#9917</a> Support loading WebApplicationContexts with the TestContext Framework (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto">1 votes, 1 watchers</p>