0

First of all, none of the questions I found solved my issue. Error - 403 forbidden on accessing my war deployed on web logic 9.x comes near, but the solution recommended in the comments doesn't solve my issue, since my index.html and its assets were copy-pasted into the WEB-INF folder.

I deployed my application and I get 403 forbidden in the browser as if the index.html was missing, but it ain't.

I am using WildFly 15 and deploying from Eclipse 2022-06 if that matters.

My web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
  <display-name>IdeaProjects</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

My pom.xml:

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>IdeaProjectsImport</groupId>
  <artifactId>IdeaProjectsImport</artifactId>
  <version>0.0.1</version>
  <packaging>war</packaging>
  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.3.2</version>
</plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <!-- MAVEN-ASSEMBLY -->
      <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>3.4.0</version>
      <configuration>
      <archive>
      <manifest>
      <mainClass>VorlagenWerkWebService.VorlagenWerkService.src.main.java.com.example.vorlagenwerk.HelloWorldServiceImpl</mainClass></manifest></archive></configuration>
      <executions>
      <execution>
        <id>make-assembly</id>
        <phase>package</phase>
        <goals>
            <goal>single</goal>
        </goals>
      </execution></executions>
      </plugin>
    </plugins>
  </build>
</project>
Munchkin
  • 857
  • 5
  • 24
  • 51
  • 1
    "since my index.html and its assets were copy-pasted into the WEB-INF folder" -> Are you saying your `index.html` page is in the `WAR.war/WEB-INF` directory? If so that is not the correct directory. It needs to be in the root if it's just a static HTML page. – James R. Perkins Jul 05 '22 at 17:11
  • @JamesR.Perkins tried that, now I'm getting 404, which is even worse... – Munchkin Jul 06 '22 at 06:31
  • It's tough to tell what it might be without more information about the project. Static HTML should not be in the `WEB-INF`. The POM configuration looks a little odd, but I don't really know your project configuration. Normally resources would be in `src/main/resources`. – James R. Perkins Jul 06 '22 at 14:10

0 Answers0