Creating web jar and loadinding into a tomcat server or a different desktop

Answered

 Hi

 

I am coming for Visual Studio, trying to get a handle on deploying a spring boot project war file to a Tomcat located on a 2nd desktop on same intranet.  I typically have no issue deploying web app using VS IDE as it is all pretty much automated

I installed Tomcat 8 and validated that if I got to http://IP Address:8088/ I see the Tomcat page.   I validated I can use the manager consile just fine.

The problem is that when I use Intellij IDE to generate a war file, I copy and past on the 2nd machine Desktop, and I then use Tomcat to deploy, I get 404 resource not found error.

I am obvious doing something wrong on the IntelliJ side ... my guesstimate is when I am adding project libraries.  The steps I used are:

-Went to Project Structure

-Selected Artifacts

-clicked the + sign and named the project to diexample (same name as the java IDE)

- the type is [Web Application Archive]

-

-I selected to put 'diexample' compile output into /WEB-INF/classes

-I selected to put all the remaining Maven items into /WEB-INF/lib

-Apply

-OK

-Rebuild project ... nothing happens ... I don't see an out folder under my diexample folder

-I moved the war file to the desktop of the machine where I have tomcat 8 installed.

-Wen to the Tomcate application manager

-Selected WAR file to deploy and pointed to the WAR file on the machine desktop

-deploy

-I validated the the newly installed file is on the Tomcat Applications List Grid

- I get

HTTP Status 404 - /diexample/

 

I am puzzeled.  I even get this with a simple Helloworld.

Any idea what I could be doing wrong?

 

Thanks

 

 

 

 

3 comments
Comment actions Permalink

Please share a sample project that would reproduce the problem.

0
Comment actions Permalink

Hi

 

thanks for the reply.   I don't seem to be able to find a way to attach a war in this webpage.

One thing I noticed though is that the WAR file generated by Intellij contains the java classes (first image below ... e.g. models, controllers and so forth) onlt,  but the static resources (e.g.; images, html, js ... and so forth ... please see 2nd image) are not included.   This could explain the 404 issue.  

But I am not sure how to get the Intellij to pull in the static resources under  resources when it only make available the complied sources.

Thank you for your help resolving this issue.

Mark

 

 

 

 

0
Comment actions Permalink

Check artifact configuration, you can include/exclude certain elements like resources: http://www.jetbrains.com/idea/webhelp/configuring-artifacts.html.

0

Please sign in to leave a comment.