Jhipster可执行jar与undertow不工作-404

Jhipster可执行jar与undertow不工作-404,jhipster,Jhipster,我构建了一个jhipster应用程序。添加了一个实体。用 mvn -Pprod package 当我使用tomcat时,应用程序运行良好 java -jar xyz.war 但是,由于我们需要在高负载场景和快速启动时间下牵引,我只需将maven依赖项从Tomcat更改为在Spring文档中提到Tomcat starter依赖项的所有位置(所有配置文件)下牵引: 或 上面说找不到 我还需要做什么才能使嵌入了Undertow的jHipster应用程序正常工作 任何被认为是推动jHipster在我

我构建了一个jhipster应用程序。添加了一个实体。用

mvn -Pprod package
当我使用tomcat时,应用程序运行良好

java -jar xyz.war
但是,由于我们需要在高负载场景和快速启动时间下牵引,我只需将maven依赖项从Tomcat更改为在Spring文档中提到Tomcat starter依赖项的所有位置(所有配置文件)下牵引:

上面说找不到

我还需要做什么才能使嵌入了Undertow的jHipster应用程序正常工作


任何被认为是推动jHipster在我们组织中发展的关键POC的快速帮助都取决于这一步

我们过去支持底拖,但最近将其拆除。因此,您应该不会有太多的麻烦重新设置它(并且您所做的看起来很好,然后您不会发布您的整个配置,所以很难说)。 无论如何,关于您的特定用例,您需要知道为什么我们删除了底拖:

  • 启动时间确实较短,大约为300-500毫秒。我们在我们的“开发人员”档案中主要使用这个,因为启动时间很重要。但是现在我们有了Spring开发工具热重启,这就不再有用了
  • 对于“prod”用法,我没有看到Tomcat和Undertow之间有任何性能差异。与仅仅一次数据库访问(花费数毫秒)相比,我想您看不到这种改进
此外,我们已经消除了“暗流”,因为它缺乏一些重要的功能。最重要的是:

  • GZip压缩支持->由于您将失去这一点,实际上,使用Undertow比使用Tomcat的性能要差得多
  • 腹板支架

最后但并非最不重要的一点是,通过添加新节点可以很容易地扩展JHipster应用程序(在JHipster 3.0中更容易),因此处理大量用户不应该是一个问题。

我们过去支持Undertow,但最近删除了它。因此,您应该不会有太多的麻烦重新设置它(并且您所做的看起来很好,然后您不会发布您的整个配置,所以很难说)。 无论如何,关于您的特定用例,您需要知道为什么我们删除了底拖:

  • 启动时间确实较短,大约为300-500毫秒。我们在我们的“开发人员”档案中主要使用这个,因为启动时间很重要。但是现在我们有了Spring开发工具热重启,这就不再有用了
  • 对于“prod”用法,我没有看到Tomcat和Undertow之间有任何性能差异。与仅仅一次数据库访问(花费数毫秒)相比,我想您看不到这种改进
此外,我们已经消除了“暗流”,因为它缺乏一些重要的功能。最重要的是:

  • GZip压缩支持->由于您将失去这一点,实际上,使用Undertow比使用Tomcat的性能要差得多
  • 腹板支架

最后但并非最不重要的一点是,通过添加新节点可以很容易地扩展JHipster应用程序(在JHipster 3.0中更容易),因此处理大量用户不应该是一个问题。

我没有遇到您的错误。下拖对我来说似乎很好

1) 我生成了一个新的JHipster项目(来自master),所有默认选项

2) 我仅在pom.xml的这一部分中将tomcat替换为undertow:

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <!-- log configuration -->
            <logback.loglevel>DEBUG</logback.loglevel>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-undertow</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </profile>
    <profile>
        <id>prod</id>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-undertow</artifactId>
            </dependency>
        </dependencies>
4) 启动数据库:

docker-compose -f src/main/docker/prod.yml up -d
5) 启动应用程序

java -jar target/*.war --spring.profiles.active=prod

:: JHipster Fortunately for me, when I move the same war file to a RHEL system, it works just fine. :-) I am accepting @pgrimaud 's answer. Thanks @deepu and @Julien. You guys are awesome. 

I will investigate what's going wrong on my Win7 machine-will post back here if I am able to figure out. (npm clear cache dint help. Will re-install node.js and npm as I had updated them for my other node.js work - I will see if that helps). I will also try to debug spring-boot-starter-undertow.

Finally, a solution for the nemesis is in place. Here is an update from me - Today, I started to debug spring boot and undertow code and realized that spring boot is looking for resources in the below locations :

private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
        "classpath:/META-INF/resources/", "classpath:/resources/",
        "classpath:/static/", "classpath:/public/" };
java-jar target/*.war--spring.profiles.active=prod

::JHipster我没有设法得到你的错误。下拖对我来说似乎很好

1) 我生成了一个新的JHipster项目(来自master),所有默认选项

2) 我仅在pom.xml的这一部分中将tomcat替换为undertow:

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <!-- log configuration -->
            <logback.loglevel>DEBUG</logback.loglevel>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-undertow</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </profile>
    <profile>
        <id>prod</id>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-undertow</artifactId>
            </dependency>
        </dependencies>
4) 启动数据库:

docker-compose -f src/main/docker/prod.yml up -d
5) 启动应用程序

java -jar target/*.war --spring.profiles.active=prod

:: JHipster Fortunately for me, when I move the same war file to a RHEL system, it works just fine. :-) I am accepting @pgrimaud 's answer. Thanks @deepu and @Julien. You guys are awesome. 

I will investigate what's going wrong on my Win7 machine-will post back here if I am able to figure out. (npm clear cache dint help. Will re-install node.js and npm as I had updated them for my other node.js work - I will see if that helps). I will also try to debug spring-boot-starter-undertow.

Finally, a solution for the nemesis is in place. Here is an update from me - Today, I started to debug spring boot and undertow code and realized that spring boot is looking for resources in the below locations :

private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
        "classpath:/META-INF/resources/", "classpath:/resources/",
        "classpath:/static/", "classpath:/public/" };
java-jar target/*.war--spring.profiles.active=prod

::JHipster幸运的是,当我将同一个war文件移动到RHEL系统时,它可以正常工作。:-)我接受@pgrimaud的回答。谢谢@deepu和@Julien。你们太棒了


我会调查我的Win7机器出了什么问题,如果我能弄清楚的话,我会发回这里。(npm clear cache dint help.将重新安装node.js和npm,因为我已经为我的其他node.js工作更新了它们-我将看看这是否有帮助)。我还将尝试调试spring boot starter undertow。

幸运的是,当我将相同的war文件移动到RHEL系统时,它工作正常。:-)我接受@pgrimaud的回答。谢谢@deepu和@Julien。你们太棒了


我会调查我的Win7机器出了什么问题,如果我能弄清楚的话,我会发回这里。(npm clear cache dint help.将重新安装node.js和npm,因为我已经为我的其他node.js工作更新了它们-我将看看这是否有帮助)。我还将尝试在牵引下调试spring boot starter。

最后,复仇女神的解决方案已经就位。这是我的更新-今天,我开始调试spring boot和undertow代码,并意识到spring boot正在以下位置寻找资源:

private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; 
之后,我在META-INF目录中创建了一个名为resources的文件夹,并使用7zip复制了其中的所有资源瞧,它是有效的!:-)

虽然spring boot也应该从

出于某种原因,它没有这样做。(这是jHipster放置所有资源文件的地方)


我认为这是jHipster使用的spring boot版本的一个bug,我将我的应用程序spring boot版本升级到了
1.3.3.RELEASE
,但这也无济于事。

最后,复仇女神的解决方案已经到位。这是我的更新-今天,我开始调试spring boot和undertow代码,并意识到spring boot正在以下位置寻找资源:

private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" }; 
之后,我在META-INF目录中创建了一个名为resources的文件夹,并使用7zip复制了其中的所有资源瞧,它是有效的!:-)