Run WAR file in AWS Beanstalk

15,608

Try to open the manifest file in your generated war file, most likely it is missing the Main-Classinformation. A sample of a MANIFEST file containing that is like:

Manifest-Version: 1.0
Main-Class: org.xxx.xxx.

You can try to add the Main file information in the maven plugin config under your pom file. Something like this:

  <plugin>
    ...

    <configuration>
      <archive>
        <manifest>
          <addClasspath>true</addClasspath>
          <mainClass>fully.qualified.MainClass</mainClass>
        </manifest>
      </archive>
    ...
  </plugin>
Share:
15,608
user3235881
Author by

user3235881

Updated on November 30, 2022

Comments

  • user3235881
    user3235881 over 1 year

    I created a Web Server with java and jersey. I also use MAVEN. I am able to run the project from the command line with this command

    mvn clean verify org.codehaus.cargo:cargo-maven2-plugin:run
    

    My problem is that I want to deploy the project in an Amazon aws Elastic Beanstalk as a java application. I have to upload the code there and amazon will execute it with this command

    java -jar mywar.war
    

    If I try to run my project locally with this command, I get this error

    no main manifest attribute, in project.war
    

    So I think that's why the project is not running properly in the Beanstalk. Is it possible to run my project with this java command or I must use the mvn command?