title: Same .war file with no .xml configuration Spring MVC app with Tomcat9. Running fine at localhost:8080, I got 404 error in Remote server
body: <p>I have trouble to deploy my web app into a remote server. 
  It works completely fine when it's running on my machine - localhost:8080. (running fine at both cases at local machine where Tomcat started manually using .war file in <strong>webapps</strong> folder and, Eclipse - "run on server")  </p>
  
  <p>But I get 404 error when I try to connect after copying .war file into <strong>/webapps/</strong> folder in remote server. 
  ( I examed another sample.war file in the remote server, and it works fine. but not my .war file.)</p>
  
  <p>I made .war file using command</p>
  
  <pre><code>$ mvn package
  </code></pre>
  
  <p>There is no web.xml file. and every configuration was made by java annotation. 
  I Used Tomcat9. 
  Also, I installed MySQL into Remote server. and managed everything in DB. </p>
  
  <p><a href="https://i.stack.imgur.com/Rlv8k.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rlv8k.png" alt="folder structure"></a></p>
  
  <p>ExceptionHandlers.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  
  @ControllerAdvice
  public class ExceptionHandlers {
  
      @ExceptionHandler(NoHandlerFoundException.class)
      public String handle(Exception ex) {
  
          return "404";
      }
  }
  </code></pre>
  
  <p>MyServletInitializer.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  
  public class MyServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
  
      @Override
      public void onStartup(ServletContext servletContext) throws ServletException {
          super.onStartup(servletContext);
          servletContext.addListener(new SessionListener());
      }
  
      @Override
      protected Class&lt;?&gt;[] getRootConfigClasses() {
          return new Class[] { PersistenceConfig.class, WebSecurityConfig.class, };
      }
  
      @Override
      protected Class&lt;?&gt;[] getServletConfigClasses() {
          return new Class[] { SpringConfig.class };
      }
  
      @Override
      protected String[] getServletMappings() {
          return new String[] { "/" };
      }
  
      @Override
      protected void customizeRegistration(ServletRegistration.Dynamic registration) {
          boolean done = registration.setInitParameter("throwExceptionIfNoHandlerFound", "true"); // -&gt; true
          if(!done) throw new RuntimeException();
      }
  
      @Override
      protected Filter[] getServletFilters() {
          return new Filter[] {
              new OpenEntityManagerInViewFilter()
          };
      }
  
  }
  </code></pre>
  
  <p>NoHandlerFoundControllerAdvice.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  @ControllerAdvice
  public class NoHandlerFoundControllerAdvice {
      @ExceptionHandler(NoHandlerFoundException.class)
      public String handle(Exception ex) {
          return "redirect:/404";
      }
  
  }
  </code></pre>
  
  <p>PersistenceConfig.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  
  @Configuration
  @EnableTransactionManagement
  @ComponentScan({"com.rainbowtape.boards"})
  @EnableJpaRepositories(basePackages = {"com.rainbowtape.boards.dao"})
  @PropertySource({"classpath:persistence-mysql.properties"})
  public class PersistenceConfig {
  
      @Autowired
      private Environment env;
  
      @Bean
      public DataSource dataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName(env.getRequiredProperty("jdbc.driverClassName"));
          dataSource.setUrl(env.getRequiredProperty("jdbc.url"));
          dataSource.setUsername(env.getRequiredProperty("jdbc.user"));
          dataSource.setPassword(env.getRequiredProperty("jdbc.pass"));
          return dataSource;
      }
  
      @Bean
      public Properties hibernateProperties() {
          Properties properties = new Properties();
          properties.put("hibernate.dialect", env.getRequiredProperty("hibernate.dialect"));
          properties.put("hibernate.show_sql", env.getRequiredProperty("hibernate.show_sql"));
          properties.put("hibernate.hbm2ddl.auto", env.getRequiredProperty("hibernate.hbm2ddl.auto"));
          return properties;     
      }
  
      @Bean
      @Autowired
      public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
          LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactoryBean.setDataSource(dataSource());
          entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
          entityManagerFactoryBean.setPackagesToScan("com.rainbowtape.boards.entity");
          entityManagerFactoryBean.setJpaProperties(hibernateProperties());
          return entityManagerFactoryBean;
      }
  
      @Bean
      public PlatformTransactionManager transactionManager(EntityManagerFactory emf){
          JpaTransactionManager transactionManager = new JpaTransactionManager();
          transactionManager.setEntityManagerFactory(emf);
          return transactionManager;
      }
  
      @Bean
      public PersistenceExceptionTranslationPostProcessor exceptionTranslation(){
          return new PersistenceExceptionTranslationPostProcessor();
      }
  }
  </code></pre>
  
  <p>SecurityWebApplicationInitializer.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  
  @Configuration
  @EnableWebMvc
  @EnableSpringDataWebSupport 
  @ComponentScan(basePackages = "com.rainbowtape.boards")
  public class SpringConfig extends WebMvcConfigurerAdapter {
  
      @Autowired
      private Environment env;
  
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
          registry.addResourceHandler("/images/**").addResourceLocations("file:///Users/rainbowtape/liffey-app/images/").setCachePeriod(0);
      }
  
      @Override
      public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
          configurer.enable();
      }
  
      @Bean
      public SpringResourceTemplateResolver templateResolver() {
          final SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
          templateResolver.setCacheable(false);
          templateResolver.setPrefix("/WEB-INF/templates/");
          templateResolver.setSuffix(".html");
          return templateResolver;
      }
  
      @Bean
      public SpringTemplateEngine templateEngine() {
          final SpringTemplateEngine springTemplateEngine = new SpringTemplateEngine();
          springTemplateEngine.addTemplateResolver(templateResolver());
          springTemplateEngine.addDialect(new SpringSecurityDialect());
          return springTemplateEngine;
      }
  
      @Bean
      public ThymeleafViewResolver viewResolver() {
          final ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
          viewResolver.setTemplateEngine(templateEngine());
          viewResolver.setOrder(1);
          viewResolver.setContentType("text/html;charset=UTF-8"); 
          return viewResolver;
      }
  
      @Bean
      public JavaMailSender getJavaMailSender() {
          JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
          mailSender.setHost("smtp.gmail.com");
          mailSender.setPort(587);
  
          mailSender.setUsername(env.getRequiredProperty("gmail.username"));
          mailSender.setPassword(env.getRequiredProperty("gmail.password"));
  
          Properties props = mailSender.getJavaMailProperties();
          props.put("mail.transport.protocol", "smtp");
          props.put("mail.smtp.auth", "true");
          props.put("mail.smtp.starttls.enable", "true");
          props.put("mail.debug", "true");
  
          return mailSender;
      }
  
      @Bean
      public CommonsMultipartResolver multipartResolver(){
          CommonsMultipartResolver resolver = new CommonsMultipartResolver();
          resolver.setDefaultEncoding("utf-8");
          resolver.setResolveLazily(false);
          resolver.setMaxUploadSize(10000000);
          return resolver;
      }
  
  }
  </code></pre>
  
  <p>WebSecurityConfig.java</p>
  
  <pre><code>package com.rainbowtape.boards.config;
  
  
  @PropertySource({"classpath:maildata.properties"})
  @Configuration
  @EnableWebSecurity
  @EnableGlobalMethodSecurity(prePostEnabled=true) 
  public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  
      private static final Logger log = LoggerFactory.getLogger(WebSecurityConfig.class);
  
      @Autowired 
      private UserService userService;
  
      @Autowired
      public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { 
  
          auth.userDetailsService(userService).passwordEncoder(passwordEncoder());
      }
  
      @Bean
      @Override
      public AuthenticationManager authenticationManagerBean() throws Exception {
  
          return super.authenticationManagerBean();
      }
  
      @Bean
      public BCryptPasswordEncoder passwordEncoder(){
  
          return new BCryptPasswordEncoder();
      }
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          CharacterEncodingFilter filter = new CharacterEncodingFilter();
          filter.setEncoding("UTF-8");
          filter.setForceEncoding(true);
          http.addFilterBefore(filter,CsrfFilter.class);
          http
          .csrf().disable() // https://stackoverflow.com/questions/28716632/spring-boot-request-method-post-not-supported
          .authorizeRequests()
          .antMatchers("/resources/**").permitAll()
          .antMatchers("/images/**").permitAll()
          .antMatchers("/registerForm").permitAll()
          .antMatchers("/forgotPassword/**").permitAll()
          .antMatchers("/api/school/**").permitAll()
          .antMatchers("/school/**").permitAll()
          .antMatchers("/","/403","/register","/login","/loginError","/dbError","/404","/error","/validateLogin","/consulting","/test").permitAll()
          .antMatchers("/admin/**").hasRole("ADMIN")
          .antMatchers("/user/**").hasAnyRole("USER","ADMIN")
          .anyRequest().authenticated()
          .and()
          .formLogin()
          .loginPage("/login")
          .loginProcessingUrl("/validateLogin").permitAll()
          .successHandler(loginSuccessHandler())
          .failureHandler(loginFailureHandler())
          .and()
          .logout()
          .permitAll().logoutSuccessUrl("/")                                                     
          .invalidateHttpSession(true)                                                                                                 
          .and()
          .exceptionHandling()
          .accessDeniedPage("/403");
      }
  
      private AuthenticationFailureHandler loginFailureHandler() {
  
          return (request, response, exception) -&gt; {
              if(exception.getMessage().contains("JDBC")) {
                  response.sendRedirect(request.getContextPath()+"/dbError");
              } else {
                  response.sendRedirect(request.getContextPath()+"/loginError");
              }
          };
      }
  
      private AuthenticationSuccessHandler loginSuccessHandler() {
  
          return (request, response, authentication) -&gt; {
              if(authentication.getAuthorities().size() == 0) {
                  log.info("User has no role.");
                  response.sendRedirect(request.getContextPath()+"/403");
              } else if(isAdmin(authentication)) {
                  log.info("Admin");
                  response.sendRedirect(request.getContextPath()+"/admin/");
              } else {
                  log.info("UserPage Redirecting");
                  response.sendRedirect(request.getContextPath()+"/user/");
              }
          };
      }
  
      private boolean isAdmin(Authentication auth) {
  
          System.err.println("isadmin?? - " + auth.getAuthorities().toString());
  
          boolean isAdmin = false;
          Iterator&lt;? extends GrantedAuthority&gt; i = auth.getAuthorities().iterator();
          while (i.hasNext()) {
              if(i.next().toString().contains("ADMIN")) {
                  isAdmin = true;
                  break;
              }
          }
          return isAdmin;
      }
  
  }
  </code></pre>
  
  <p>pom.xml</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/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.rainbowtape&lt;/groupId&gt;
      &lt;artifactId&gt;boards&lt;/artifactId&gt;
      &lt;name&gt;spring-mvc-hibernate-boards&lt;/name&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0.0-BUILD-SNAPSHOT&lt;/version&gt;
      &lt;properties&gt;
          &lt;java-version&gt;1.8&lt;/java-version&gt;
          &lt;org.springframework-version&gt;4.3.4.RELEASE&lt;/org.springframework-version&gt;
          &lt;org.aspectj-version&gt;1.6.10&lt;/org.aspectj-version&gt;
          &lt;org.slf4j-version&gt;1.6.6&lt;/org.slf4j-version&gt;
          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
  
          &lt;!-- url parsing :: https://mvnrepository.com/artifact/com.twitter.twittertext/twitter-text --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.twitter.twittertext&lt;/groupId&gt;
              &lt;artifactId&gt;twitter-text&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- file upload :: https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-fileupload&lt;/groupId&gt;
              &lt;artifactId&gt;commons-fileupload&lt;/artifactId&gt;
              &lt;version&gt;1.3.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- mail :: https://mvnrepository.com/artifact/javax.mail/mail --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.mail&lt;/groupId&gt;
              &lt;artifactId&gt;mail&lt;/artifactId&gt;
              &lt;version&gt;1.4.7&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- mail :: https://mvnrepository.com/artifact/org.springframework/spring-context-support --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
              &lt;version&gt;4.3.4.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- dealing with html :: https://mvnrepository.com/artifact/org.jsoup/jsoup --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jsoup&lt;/groupId&gt;
              &lt;artifactId&gt;jsoup&lt;/artifactId&gt;
              &lt;version&gt;1.8.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- jackson json bind --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
              &lt;version&gt;2.9.8&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- commons-beanutils --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
              &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
              &lt;version&gt;1.9.3&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- thymeleaf-extras-springsecurity4 --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-extras-springsecurity4&lt;/artifactId&gt;
              &lt;version&gt;3.0.2.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- spring data jpa --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
              &lt;version&gt;1.11.15.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- thymeleap --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-spring4&lt;/artifactId&gt;
              &lt;version&gt;3.0.9.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- spring-security --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
              &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
              &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
              &lt;version&gt;4.2.0.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.mindrot&lt;/groupId&gt;
              &lt;artifactId&gt;jbcrypt&lt;/artifactId&gt;
              &lt;version&gt;0.4&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;8.0.12&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;5.3.3.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.validator&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;6.0.7.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                      &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- AspectJ --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
              &lt;version&gt;${org.aspectj-version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.15&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.mail&lt;/groupId&gt;
                      &lt;artifactId&gt;mail&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.jms&lt;/groupId&gt;
                      &lt;artifactId&gt;jms&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jdmk&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxtools&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;com.sun.jmx&lt;/groupId&gt;
                      &lt;artifactId&gt;jmxri&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- @Inject --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.inject&lt;/groupId&gt;
              &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
              &lt;version&gt;1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Servlet --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Test --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.7&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;finalName&gt;liffeyapp&lt;/finalName&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.9&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;additionalProjectnatures&gt;
                          &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
                      &lt;/additionalProjectnatures&gt;
                      &lt;additionalBuildcommands&gt;
                          &lt;buildcommand&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/buildcommand&gt;
                      &lt;/additionalBuildcommands&gt;
                      &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                      &lt;downloadJavadocs&gt;true&lt;/downloadJavadocs&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.5.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;compilerArgument&gt;-Xlint:all&lt;/compilerArgument&gt;
                      &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.2.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;mainClass&gt;org.test.int1.Main&lt;/mainClass&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>application.properties</p>
  
  <pre><code>server.contextPath=/liffeyapp
  </code></pre>
  
  <p>Can't fugure out, what was wrong... Would anyone help me? 
  Thanks in advance.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I am adding my remote server's catalina.out - log. </p>
  
  <pre><code>23-Feb-2019 00:24:33.066 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/liffeyapp]
  23-Feb-2019 00:24:43.174 INFO [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/opt/tomcat/webapps/liffeyapp.war]
  23-Feb-2019 00:24:43.194 SEVERE [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [/liffeyapp]
   java.util.zip.ZipException: zip END header not found
      at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1527)
      at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1428)
      at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1435)
      at java.base/java.util.zip.ZipFile$Source.&lt;init&gt;(ZipFile.java:1266)
      at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1229)
      at java.base/java.util.zip.ZipFile$CleanableResource.&lt;init&gt;(ZipFile.java:825)
      at java.base/java.util.zip.ZipFile$CleanableResource$FinalizableResource.&lt;init&gt;(ZipFile.java:852)
      at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:841)
      at java.base/java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:245)
      at java.base/java.util.zip.ZipFile.&lt;init&gt;(ZipFile.java:175)
      at java.base/java.util.jar.JarFile.&lt;init&gt;(JarFile.java:341)
      at java.base/sun.net.www.protocol.jar.URLJarFile.&lt;init&gt;(URLJarFile.java:103)
      at java.base/sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72)
      at java.base/sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99)
      at java.base/sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:125)
      at java.base/sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:92)
      at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:130)
      at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:605)
      at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:738)
      at org.apache.catalina.startup.Conte
  
  .
  .
  .
  ContextLoader ----&gt; ERROR: 2019-02-23 00:25:19,261 ----&gt; Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in com.rainbowtape.boards.config.PersistenceConfig: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:856)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4641)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5109)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  .
  .
  .
  
  </code></pre>
  
  <p><strong>EDIT 2</strong>
  Jave runtime verison was same. </p>
  
  <p>Local</p>
  
  <pre><code>~:  java -version
  java version "1.8.0_131"
  Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
  Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
  </code></pre>
  
  <p>Remote Server</p>
  
  <pre><code>root@vps*******:~# java -version
  java version "1.8.0_181"
  Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
  Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
  </code></pre>