title: spring boot with java + groovy _maven in embedded tomcat, controller but error
body: <p>Sorry if this is already answered, I am not able to find it. </p>
  
  <p>I have created new project using spring boot. </p>
  
  <p>My requirements are that I have some java classes, some groovy classes and they should be able to call each others.</p>
  
  <p>I am using maven and running my embedded tomcat by 
  mvn spring-boot:run 
  Problem is, RestController which is Java Class is there and I am able to call it REST URL. </p>
  
  <p>But the controller which is in Groovy, is not able to be called and gives me error.</p>
  
  <pre><code>curl localhost:8080/
  {"timestamp":1455913384508,"status":404,"error":"Not Found","message":"No message available","path":"/"}
  </code></pre>
  
  <p>Good part is that I am able to call groovy class from java. </p>
  
  <p>Below are my files. </p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;gs-spring-boot&lt;/artifactId&gt;
          &lt;version&gt;0.1.0&lt;/version&gt;
  
          &lt;parent&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
              &lt;version&gt;1.3.2.RELEASE&lt;/version&gt;
          &lt;/parent&gt;
  
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                  &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
                  &lt;version&gt;2.3.7&lt;/version&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
  
          &lt;properties&gt;
              &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;/properties&gt;
  
  
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher --&gt;
                      &lt;version&gt;3.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;compilerId&gt;groovy-eclipse-compiler&lt;/compilerId&gt;
                      &lt;/configuration&gt;
                      &lt;dependencies&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                              &lt;artifactId&gt;groovy-eclipse-compiler&lt;/artifactId&gt;
                              &lt;version&gt;2.9.1-01&lt;/version&gt;
                          &lt;/dependency&gt;
                          &lt;!-- for 2.8.0-01 and later you must have an explicit dependency on 
                              groovy-eclipse-batch --&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                              &lt;artifactId&gt;groovy-eclipse-batch&lt;/artifactId&gt;
                              &lt;version&gt;2.3.7-01&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
  
      &lt;/project&gt;
  
  
      app.groovy:
  package hello
  
  import org.springframework.web.bind.annotation.RestController;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  
  @RestController
  class ThisWillActuallyRun {
  
      @RequestMapping("/home")
      String home() {
          return "Hello World!"
      }
  
  }
  
  
      Application.java
  package hello;
  
  import java.util.Arrays;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.ApplicationContext;
  
  @SpringBootApplication
  public class Application {
  
      public static void main(String[] args) {
          ApplicationContext ctx = SpringApplication.run(Application.class, args);
  
          System.out.println("Let's inspect the beans provided by Spring Boot:");
  
          String[] beanNames = ctx.getBeanDefinitionNames();
          Arrays.sort(beanNames);
          for (String beanName : beanNames) {
              System.out.println(beanName);
          }
      }
  
  }
  
  
  
  
      Controller class
  package hello;
  
  import org.springframework.web.bind.annotation.RestController;
  import org.springframework.web.bind.annotation.RequestMapping;
  
  @RestController
  public class HelloController {
  
      @RequestMapping("/hello")
      public String index() {
  
          ThisWillActuallyRun t = new ThisWillActuallyRun() ; 
          String v = t.home() ;
          System.out.println("value from groovy="+v) ; 
          return "Greetings from Spring Boot!";
      }
  
  }
  </code></pre>
  
  <p>This works: 
      curl localhost:8080/hello
      Greetings from Spring Boot!</p>
  
  <p>Thanks a lot for the help. </p>