I have a very simple spring boot application that I want to deploy to Jboss EAP. Here is my simple application class:
@SpringBootApplication public class MayurApplication extends SpringBootServletInitializer{ public static void main(String[] args) { SpringApplication.run(MayurApplication.class, args); } @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(applicationClass); } private static Class<MayurApplication> applicationClass = MayurApplication.class; } @RestController class GreetingController { @RequestMapping("/hello/{name}") String hello(@PathVariable String name) { return "Hello, " + name + "!"; } }
and my pom.xml is also very simple. When I run this application on Tomcat using the built-in Tomcat that comes with spring boot. Everything works like a charm in just one click. I can access http://localhost:8080/demo/hello/World
, and it works too.
Now I tried to make JBoss EAP a compatible war, I disabled Tomcat, excluding spring-boot-starter-web from spring and turning it into a military project. (as suggested in the article http://spring.io/blog/2014/03/07/deploying-spring-boot-applications ).
I also added:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency>,
as he complained.
Now, after all this, it compiles perfectly and creates a war. When I copied this war to jboss deployment, I see that it has been successfully deployed to the console. But the rest of the api http://localhost:8080/demo/hello/World
just does not work and constantly causes an error in the browser:
JBWEB000068: message /demo/hello/World JBWEB000069: description JBWEB000124: The requested resource is not available.
What am I doing wrong?
source share