我使用 JHipster 制作了 Web 应用程序。一切正常,但是当我将它移动到 tomcat/webapps 并部署它时,我遇到了一些错误。出错后,我的应用程序运行正常,所以我之前没有关注这个......但是现在当我试图将它部署在 linux 服务器上时,我的应用程序开始时出现几个错误“CreateBeanException”。我认为出现此错误是因为我忽略了(在 Windows 和 Linux 中)他的文件中的 tomcat 配置。有人可以帮我吗? 我在生产环境中使用 mysql。
这是来自 tomcat.exe 的日志 https://pastebin.com/LA12tiL9
这是我来自 tomcat/conf 的 context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
我该贴什么了? 在 Windows 和 Linux 上安装后,我有默认配置。 我希望有人能帮助我。 谢谢
最佳答案
你有什么特殊需求想部署在tomcat上吗? 因为
JHipster
is a fully Open Source, widely used application generator. Easily create high-quality Spring Boot + Angular projects!
Spring Boot 为您提供了一个开箱即用的嵌入式 Web 服务器。
因此您可以轻松使用 JHipster -> Spring Boot 提供的嵌入式 Web 服务器:提供以下 JHipster 步骤:
生成 WAR 文件
To package the application as a “production” WAR, type:
./mvnw -Pprod package
Or when using Gradle:
./gradlew -Pprod bootRepackage
This will generate two files (if your application is called “jhipster”):
target/jhipster-0.0.1-SNAPSHOT.war
target/jhipster-0.0.1-SNAPSHOT.war.original
在没有应用服务器的情况下执行 WAR 文件
Instead of deploying to an application server, many people find it easier to just have an exectuable WAR file.
The first WAR file generated in the previous step is such a WAR, so you can run it in “production” mode by typing (on Mac OS X or Linux):
./jhipster-0.0.1-SNAPSHOT.war
If you are on Windows, use:
java -jar jhipster-0.0.1-SNAPSHOT.war
有关更多信息,请关注 JHipster 的这份出色文档
关于java - 在 Tomcat 服务器上启动 JHipster 生成的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44564260/