3

I got a problem with generating a war file from a dynamic web project by the command line. Similar to this thread. But unfortunately I dont have maven or gradle...

If I create a war file from commandline from the main directory of my Webproject, I cant connect on any website by tomcat. If I go deeper into folder "webcontent", I am able to connect to the html welcome-page but I am not able to connect to the servlets, which are located in the src folder. enter image description here

Thank you for your help!

Community
  • 1
  • 1
Andreas W
  • 225
  • 3
  • 11
  • Would Ant be an option? – Hein Blöd Jun 03 '16 at 20:01
  • You don't currently have gradle or maven. But can you add one of them to your project? Gradle, for example, can be distributed in a form of a self-contained [wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html), that doesn't require anything other that JDK installed in the system. – Roman Jun 05 '16 at 00:49
  • Thanks you too. I already tried it with Ant but had some trouble to create the war file with it. Now I am trying to convert it into a maven project. I think it would be the easiest way. – Andreas W Jun 06 '16 at 07:46

1 Answers1

2

Okay, I solved the problem with a different solution:

According to this thread, I created /WEB-INF/classes under /WebContent.

Then I was able to create the War-File really easy with

cd /to/your/Webcontent/directory
jar -cvf /destination/folder/of/war-file *

And deployed this war file in tomcat. Everything working now. Hope this will also help other people with similar problem.

Community
  • 1
  • 1
Andreas W
  • 225
  • 3
  • 11