0

Hello everyone I have a java application (spring-boot) and I deployed it on tomcat9. The app appears on the tomcat manager and the first page of this app to connect appears correctly. But when I try to connect, the 404 error is declantiating.

I checked the Tomcat logs files, but no exceptions are thrown.

the pom file :

<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>ValERef</groupId>
  <artifactId>ValERef</artifactId>
  <version>0.0.1-1</version>
  <name>ValERef</name>
  <packaging>war</packaging>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      <java.version>1.8</java.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-tomcat</artifactId>
       <scope>provided</scope>
    </dependency> 
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.json</groupId>
      <artifactId>javax.json-api</artifactId>
      <version>1.0</version><!--$NO-MVN-MAN-VER$-->
    </dependency>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.json</artifactId>
      <version>1.0.4</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat</artifactId>
      <version>9.0.0.M1</version>
      <type>pom</type>
    </dependency>
  </dependencies>
  <build>
    <resources>
       <resource>
         <directory>src/main</directory>
         <includes>
           <include>config.ini</include>
         </includes>
       </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>spring-boot-tomcat</artifactId>
        <version>3.7.0</version><!--$NO-MVN-MAN-VER$-->
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

When i click the connect button nothing happens. But on eclipse the application worked very well (before the deployed on tomcat)

  • The answer can probably found in pieces of your application not provided in your question. Please edit your question to include an [mcve] – Selaron Jan 22 '19 at 11:04
  • I added an alert at the java script file and i got the error message: 404. but the application worked well before the deployment. – Achraf Mounir Jan 22 '19 at 11:19
  • Possible duplicate of [Add context path to Spring Boot application](https://stackoverflow.com/questions/20405474/add-context-path-to-spring-boot-application) – Selaron Jan 22 '19 at 13:04

0 Answers0