简体   繁体   中英

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

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: 在此处输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM