joinfaces / joinfaces

JoinFaces: JSF Spring Boot Starters - JSF inside Spring Boot Application
http://joinfaces.org
Apache License 2.0
393 stars 92 forks source link

SpringBoot Jar is Redirecting Login endlessly #2589

Open Declan-Rodrigues opened 1 week ago

Declan-Rodrigues commented 1 week ago

Hello all I have a JoinFaces app which runs just fine in IntelliJ IDE but when I package as a JAR and try running it this way I get "Too many redirects" when reaching the login page.

My application Jar is about 73 MB. I am not sure what to share in this forum but as a start below is my POM in case it's something obvious in there. Please let me know what I else I can share. I really appreciate the help.

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>ca.sws</groupId>
    <artifactId>sws</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>SmartWaste Solutions</name>
    <description>SmartWaste Solutions</description>

    <properties>
        <java.version>22</java.version>
        <jakarta.validation.version>3.1.0</jakarta.validation.version>
        <joinfaces.version>5.3.5</joinfaces.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <!--        JOINFACES DEPENDENCIES-->
        <dependency>
            <groupId>org.joinfaces</groupId>
            <artifactId>primefaces-spring-boot-starter</artifactId>
            <version>${joinfaces.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.joinfaces</groupId>
            <artifactId>omnifaces-spring-boot-starter</artifactId>
            <version>${joinfaces.version}</version>
        </dependency>
        <dependency>
            <groupId>org.joinfaces</groupId>
            <artifactId>rewrite-spring-boot-starter</artifactId>
            <version>${joinfaces.version}</version>
        </dependency>

        <dependency>
            <groupId>jakarta.validation</groupId>
            <artifactId>jakarta.validation-api</artifactId>
            <version>${jakarta.validation.version}</version>
        </dependency>

        <!--        Local Dependencies-->
        <!--        Added with command: -->
        <!--           mvn install:install-file -Dfile=verona-theme-7.0.0-jakarta.jar -DgroupId=primefaces -->
        <!--               -DartifactId=verona-theme -Dversion=7.0.0 -Dpackaging=jar -DgeneratePom=true-->
        <dependency>
            <groupId>primefaces</groupId>
            <artifactId>verona-theme</artifactId>
            <version>7.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.joinfaces</groupId>
                <artifactId>joinfaces-dependencies</artifactId>
                <version>${joinfaces.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <failOnWarning>true</failOnWarning>
                        <failOnError>true</failOnError>
                        <showDeprecation>true</showDeprecation>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>process-aot</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
Declan-Rodrigues commented 1 week ago

One difference when comparing the JoinFaces Example app with mine is I noticed the app resources are in different locations.

The Example app has the XHTML etc under ../resources/META-INF.resources/... While may app finds the XHTML etc under ../resources/webapp/...

Not sure why the difference