英文:
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上运行它时,它一直在要求主文件(没有主清单属性)。有什么线索可以找到要执行的文件吗?我没有任何可执行的类或主类。
英文:
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.
答案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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论