javamavenspring-mvcglassfish-4.1eclipse-oxygen

How to deploy a Spring MVC Maven project from Eclipse to an existing Glassfish server


I've got a Spring MVC Maven project written in Eclipse that was verified as working with an Apache Tomcat 7 as the web container.

I am trying to transfer it to my "server" pc where I want to deploy it to the my existing glassfish (4.1) server as the web container.

I am having a very hard time finding a big enough partial answer to get the rest of the way.

I have tried to just export the .war file to the autodeploy folder which resulted in a "deployfailed" file.

I have tried to setup a "new server" using glassfish tools, but I realized that this is creating a new server and the existing server blocks the socket connection.

Eclipse doesn't see to have standard web commands like build, clean or deploy, but I would happily settle for advice on how to tell it to deploy to the existing glassfish server similar to how I was able to with tomcat at my training location.


Solution

  • Check this answer. Then follow the following steps.

    1. Go to the project in the Project Explorer.
    2. Select the web project.
    3. Right click and select "Run As", you will see glashfish. Select it and click run.