Deploying Spring MVC from SBT - spring-mvc

I'm having trouble deploying my Spring MVC Webapp with the xsbt-web-plugin. When i'm using container:start everything works just fine, but when i'm trying to run the packaged .war file inside a tomcat instance the webapp isn't loaded. It is just starting a plain tomcat instance.

I had an error in my path that slipped through. I've overlooked this for days. Sorry.

Related

Spring Boot static files deployed via WAR with bad encoding

I am working on a project with spring boot web to serve a rest API (and using react.js on frontend) where embedded tomcat and dev-tools is used in development phase but is deployed to a jboss server via war file.
To keep consistency between dev mode and deployment mode, I am copying my front-end files to the classpath directory classpath:/public. This way of working is being very productive and I liked it.
The problem that is happening is that these front-end files have special characters (Portuguese characters) and only when I serve my application via WAR in jboss these characters are being displayed with problems. When I serve with embedded tomcat everything works fine.
Thanks in advance.
Spring MVC defaults to ISO-8859-1, embedded Tomcat overrides it to UTF-8, see https://github.com/spring-projects/spring-boot/issues/1182
I fixed it with property spring.http.encoding.force=true

Tomcat with in eclipse not recognizing the non web.xml app

I have created Spring MVC application without web.xml, completely using the java configuration but when I right click on the project I am not getting an option as Run on server which usually helps me to deploy my war into Tomcat 8.

Spring MVC war deployed to karaf not working?

I am trying to deploy a war to karaf using pax-web.I am not seeing any errors but it is not working.
But if i go to karaf console and do a bundle:update everything is working fine.
Is there a way to do bundle:update programatically with out connecting to karaf console and doing a bundle:update manually.

Spring web app deploys on Gradle's embedded Jetty but not in standalone Jetty

I have built a small web app using Gradle. Things seemed to be going well using the embedded Jetty server, but not so well when I tried to copy the WAR file to a standalone server.
I used the gradle war plugin to assemble the war.
Running gradle jettyRunWar works fine.
Copying the war to the Jetty webapps folder and running Jetty fails with this exception:
java.lang.IllegalStateException: No such servlet servlet_name
But this very same servlet is found and used without issue in the embedded Jetty server.
The same issue happens if I manually copy the exploded war to the webapps directory.
The Spring web and Spring mvc libs are copied and present in the WEB-INF/libs directory, so it isn't an issue of not finding Spring (or is it?)
I'm using Jetty 9.1, and my web.xml file is configured for Servlets v3.
I'm also using Spring 3.2. The web app I'm writing is a RESTful service, using the #Controller annotations to route requests.
This should be as simple as copying the war over, but it seems not to be. At a bit of a loss at what to do here, any thoughts?
Thanks!
Sometimes the answer is staring you in the face...after posting I realized that I had my servlet-mapping before my servlet declaration. While this did not present an issue for the Gradle Jetty (not sure why), it made Jetty unhappy. Not sure why I changed the order to begin with...
In short, Jetty seemed to not find the servlet because it had not been declared yet.

Updated servlet class not being referred in tomcat ubuntu

I am beginner to servlets. I am trying to create and run servlets using tomcat in ubuntu. I am facing a problem. I am able to call the servlet from the html file by adding an entries into web.xml. But when I change the java program a little and recompile and invoke the new servlet class, the html still seems to call the old one.
Any help is appreciated.
Thanks.
Check if you are redeploying the application properly.
Tomcat by default supports HOT Deployment, you should check if the modified servlet got reflected in TOMCAT_HOME/webapps/{application-name}/WEB-INF/classes location.
.
References:
How do i update JSP's without restarting
Hot Deployment
Hot Deployment Support in WebLogic and Tomcat

Resources