如何在命令行和Heroku上运行没有主类的.war文件?

huangapple go评论84阅读模式
英文:

How to run a .war without a main class from command and heroku?

问题

以下是您提供的内容的翻译部分:

我有一个Spring MVC、Maven CRUD Web应用,没有主类,也没有可执行的类。
它有一些.jsp页面,当从Controller类调用时会运行。

它有一个Appinitializer,我想它使用Spring MVC来启动应用。还有一个带有ViewResolver的类,我猜它配置了控制器。我将其打包为.war文件。

它在本地的Tomcat上运行得很好,但是当我尝试在命令行上或者Heroku本地Web上运行它时,它一直在要求主文件(没有主清单属性)。有什么线索可以找到要执行的文件吗?我没有任何可执行的类或主类。

以下是Appinitializer的外观:
如何在命令行和Heroku上运行没有主类的.war文件?

英文:

I have a spring mvc, maven CRUD webapp without a main class, and no executable classes.
It has a couple of .jsp pages that run when called from Controller class.

It has Appinitializer which i guess uses Spring MVC to start the app. It also has a class with Viewresolver which i guess configures the controller. I package it to .war .

It runs on tomcat localhost fine, but when I try to run it on commandline or heroku local web it keeps asking for main file (no main manifest attribute). any clues how to find the file to execute? I dont have any executable classes or main class.

Heres what appinitializer looks like:如何在命令行和Heroku上运行没有主类的.war文件?

答案1

得分: 1

你需要在Heroku上像在本地机器上一样拥有一个Tomcat。Heroku为你的用例提供了一种解决方案,详见这里:https://devcenter.heroku.com/articles/java-webapp-runner

英文:

You need to have a Tomcat on Heroku just as you do on your local machine. Heroku offers a solution for your use-case which is described here: https://devcenter.heroku.com/articles/java-webapp-runner

huangapple
  • 本文由 发表于 2020年4月6日 00:38:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/61045917.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定