java - Spring Boot Deployed in Tomcat gives 404 but works Stand-alone -
I'm testing spring boot with embedded tomcat for about a month to build a rest of the API. Everything was working fine. Now we want to deploy APIs in different development environments, in which there are some other non-spring applications running on the Tomcat container.
I have specified these changes.
Deployment is good (logs are OK, no error) and seeing Tomcat management, I see my application posted. However, when I try to reach curl, I get 404.
Any help is greatly appreciated.
UPDATE:
These are my logs:
Netbins:Netbeans: ApacheTomac 8.0.17 Profile Mode Deployment on: Incorrect debug mode: Wrong force redeploy: true
In-place deployment / home / bugz / workspace / pdcore / sophiaserver / target / sophiaserver-1.0.0-SNAPSHOT
Deployment is in progress ...
posted? Config = file% 3A% 2Ftmp% 2Fcontext1845402702541504208.xml & amp; Path = / Sofia
OK - In the reference path / Sophia transmitted the application
The start is in progress ...
The starting path? = / Sofia
OK - Start the App on Reference Path / Sofia
Tomcat:
INFO 10: 47: 52 : 703 org.springframework.boot.context.embedded.ServletRegistrationBean - Mapping servlet: 47 :: 54: for [/ sophia / *]
information 10 'dispatcherServlet' 042 org.springframework.boot.SpringApplication -Ad application for start 8.285 seconds (running for JVM 12,087.301)
10: 47: 54.060 of 22-January 2015 information [http-NIO-8080-Executive-99] org.apache.catalina. Startup.hostConfig Configuration descriptor /home/bugz/workspace/server/apache-tomcat-8.0.17/conf/Catalina/localhost/sophia.xml's deployDescriptor deployment is 12,091 ms
and expires in Sofia For Catalina localhost, go to .xml:
& lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Context antiJARLocking = "true" docBase = "/ home / bugz / workspace / pdcore / sophiaserver / target / sophiaserver-1.0.0 - snapshot" path = "/ sophia" /> (name war) > First gives a 404, but with the CORS information from my CORS filter bean. Second return 404 (which indicates that the application has started and configured but I do not have access to the controller) without the information of the CORS.
There are parts to call when an application is running.
The first base URL is the application on which the application has been posted, in your case it is that / sophia .
The second servlet mapping is Dispatcher Surlett in your case that is / sohpia / * .
The third controller's mapping DispatcherServlet , in your example, is that / user .
Mix all those things and make the URL / Sofia / Sofia / User .
The difference between deployment as a war is that there is a separate URL for you to deploy, when running as a jar, by default, / (root).
You can fix it by adding / sophia to server.context-path in application.properties < Go to Code> DispatcherServlet to / * or / . In both cases it gives you the URL you want (and expected).
Comments
Post a Comment