Giter VIP home page Giter VIP logo

Comments (6)

tippexs avatar tippexs commented on July 26, 2024

Hi @dgrecoBill1st what's the version of Spring and Tomcat you have tested this with?

Our Java implementation is limited to the Servlet API version 3.1 which is spring 2.

from unit.

dgrecoBill1st avatar dgrecoBill1st commented on July 26, 2024

Spring Boot 2.7.18

Tomcat 9.0.83

from unit.

dgrecoBill1st avatar dgrecoBill1st commented on July 26, 2024

Any ideas on this? Really would like to utilize unit for this small project requiring java, as our primary infrastructure is PHP on Unit already.

from unit.

tippexs avatar tippexs commented on July 26, 2024

Good evening @dgrecoBill1st sorry for the long response time.

Can you share a WAR file for diagnosis or share a simple example on how to reproduce this?

from unit.

dgrecoBill1st avatar dgrecoBill1st commented on July 26, 2024

Sure, attaching the war here (renamed to add .zip as cannot upload war)
crypt-0.0.1.war.zip
crypt-0.0.1.war.zip
. Here is the full setup and steps:

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.bill1st</groupId>
    <artifactId>crypt</artifactId>
    <version>0.0.1</version>

    <properties>
        <start-class>com.bill1st.CryptApplication</start-class>
    </properties>


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.18</version>
    </parent>


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

    </dependencies>

    <packaging>war</packaging>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>
        </plugins>
     </build>

</project>

Built with maven 3.5.4

Application is simple hello world controller mapped to / URI

Configured Unit:

http://localhost/config/listeners/127.0.0.1:8312

{
        "pass": "routes/crypt"
}

http://localhost/config/routes/crypt

[
        {
                "match": {
                        "uri": "*"
                },

                "action": {
                        "pass": "applications/crypt"
                }
        }
]

http://localhost/config/applications/crypt

{
        "type": "java",
        "webapp": "/var/www/crypt/crypt-0.0.1.war",
        "working_directory": "/var/www/crypt/",
        "environment": {
               <REDACTED>
        }
}

And the result:
curl http://127.0.0.1:8312

<a href="META-INF">META-INF</a><br>
<a href="WEB-INF">WEB-INF</a><br>

from unit.

dgrecoBill1st avatar dgrecoBill1st commented on July 26, 2024

Closing ticket, I did a new clean build of the project and it works in unit now.

from unit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.