Can I run Java EE Spring MVC project without Eclipse? - eclipse

I have Tomcat installed and it's working when I open a browser.
I want to know that can I run a Java EE Spring MVC project without using Eclipse.

You need to create a .war file (for example, using Export -> WAR file) and deploy it in Tomcat (via web interface of Tomcat Manager or by placing that file into webapps subfolder of Tomcat).

Related

deploy my project directly without copying always the war file

I'm running a web application with maven + spring mvc + spring data jpa with apache tomcat in eclipse.
I want to deploy my application without opening eclipse and run tomcat inside it, so i have to export my project into war and copy it into apache-tomcat-7.0.42\webapps directory and it's working good.
My problem is that i want to work directly into apache-tomcat-7.0.42\webapps with eclipse so like that i don't have to export my war file after every changes in my code.
Just configure the Tomcat as server in eclipse and run the project from eclipse.
To configure tomcat in eclipse:
In Eclipse, go to Windows->preferences->Servers->runtime Environment, add tomcat here.
To run the project from eclipse:
right click project in Eclipse's project explorer and select->run as->run on server. select the tomcat you configured.

How to Create EAR file in RAD 7.5

I have checked out a dynamic web project from a CVS repository. But, there was no EAR file to check in. Now how can I create an EAR file for the project to deploy in WAS 6?
Also can I run my project in RAD without creating an .ear file? I am a newbie to Java EE projects.
In order to be able to export an EAR, you can add a new Enterprise Application project ( New > Enterprise Application project) and select your Web project as a Java EE module dependency.
This way you can export an EAR file that will contain a WAR file built from your Web project.
If you run the wizard for creating a new enterprise application (File->New), one of the options is to add an existing web project in your workspace into the application as you create it. You can then export the enterprise application as an EAR file ready to deploy into WebSphere Application Server or, if you have the test environment set up, you can just drag-and-drop it onto the server in the Servers view. To test your web application, right-click it and choose Run->Run on Server.
Try importing as project instead of EAR files

How to deploy a web application on Jetty

I create a war file , then i executed in eclipse, like described here.
I don't know configure the context path, how can I run the war file?
There are two ways you can run your webapp using Jetty Server
Configure jetty server using Jetty_WTP_Plugin and run webapp within eclipse
Download stand alone jetty server from Jetty Distributions from Eclipse
If you use second option, you need to create war file keep war file interface /webapps folder.
I haven't used jetty but I know that its quite similar to tomcat. Just place your war file (say foo.war) in webapps directory; Start jetty by the following command in
java -jar start.jar
and hit http://localhost:8080/foo in your browser
By the way the tutorial you're using is quite an old one and may not work for jetty 8 or 9

Eclipse running a web app on an existing tomcat installation

I have an existing tomcat server running on my local machine that is being started from outside of eclipse. Is there a way to deploy my web app from eclipse to that tomcat instance without having eclipse trying to start that instance of tomcat?
It's possible using ANT scripts in eclipse which will deploy war file into tomcat directory and tomcat will take care rest of the things.
For those ant scripts you can see this below links
How Apache Ant deploys .war file to Tomcat
http://www.coderanch.com/t/423905/tools/automate-deployment-war-Tomcat-through

Deploying GWT app to tomcat in eclipse

I want to use tomcat server in development mode with GWT. When I use embedded Jetty it deploys application to the current directory(where my war folder is located). So it generates all the files there. How can I configure eclipse to use tomcat server and all the deployment stuff to be copied to tomcat webapps directory. I have tried to use -noserver option in Run conigurations, but it doesn't copy any resource from war directory to server deployment directory.
Can I use tomcat server in such manner?
P.S. i want to solve this problem withou ant or maven
Using my own server in development mode instead of GWT's built-in Jetty instance
You will need to copy the contents of the WAR folder over, but only once.
Have you looked at Eclipse WTP? It allows deploying to a server right from within Eclipse.
For a GWT project, you'd then, in addition, follow that recipe: http://code.google.com/eclipse/docs/faq.html#gwt_in_eclipse_for_java_ee