2

Spring Boot is being started by maven plugin spring-boot:run. When localhost:8080/parse is being accessed it show the vague description of error but I cannot see stacktrace here neither can I see it in IntelliJ console output. How to get error information?

Console output:

[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ event-log-parser ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot-maven-plugin:1.1.6.RELEASE:run (default-cli) @ event-log-parser <<<
[INFO] 
[INFO] --- spring-boot-maven-plugin:1.1.6.RELEASE:run (default-cli) @ event-log-parser ---
[INFO] Attaching agents: []

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.1.6.RELEASE)

Web Page

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
There was an unexpected error (type=Internal Server Error, status=500).
${message}

UPDATE

Configuration

Community
  • 1
  • 1
J.Olufsen
  • 13,415
  • 44
  • 120
  • 185
  • Does the Apache container have any logs going to `/var/log`? Did you configure logging so that you could get error output? – Makoto Jan 21 '15 at 15:48
  • I think Spring Boot has embedded Tomcat container. I have no idea how to configure logging. Usually when I trigger run not in maven, in intelliJ then any errors end up in console. – J.Olufsen Jan 21 '15 at 15:51
  • If you're starting it with maven then the output will be sent to maven's standard output. I don't see why you would expect it to show up in Intellij. If you want to debug it, attach your debugger to the remote service. – Software Engineer Jan 21 '15 at 16:37
  • Start by using IntelliJ to run the main method. Your output will then turn up in IntelliJ. If you're not getting any help from that then you should write an exception handler service and put some system.outs in it. – Software Engineer Jan 21 '15 at 16:41
  • 3
    I debug Spring boot apps by defining the run configuration as an Application and setting the main. It works well this way. There is no real reason to try run it with the maven plugin and then try attach. – EvilJinious1 Jan 22 '15 at 04:26
  • Ran into this exact problem. The answer is in this post: http://stackoverflow.com/a/29767982/462771 – ogradyjd May 20 '15 at 17:56
  • @EvilJinious1 answer work, but if use spring-boot:run, then don't know how to enable debug mode in Intellij – user1169587 Feb 02 '23 at 08:31

1 Answers1

0

You can customize how Spring MVC handles exceptions. For instance, by displaying a custom page for a specific exception (or for all kinds of exceptions). For that, use a ControllerAdvice http://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc.

sebge2
  • 383
  • 2
  • 11