I'm working on my first Java EE project with NetBeans IDE. My application server is the integrated GlassFish.
At this moment my project run locally on my Mac with MySQL database. How can I deploy it on my web server?
You need to just create the war file and copy it to your web server. When you start your web-server it will automatically deploy the war file.
You need to use the remote application server functionalities of deploy.
If it's also Glassfish you can use the Administration Console to do it - e.g. example.com:4848 (defaut port for Glassfish admin portal).
Also you may use Cargo Maven Plugin in order to automate the deploy.
You have different possibilities:
Netbeans can deploy your application on the integrated Glassfish server. This should happen automatically if you Run you project and the Glassfish server is selected for this project. You can change the selected server for every project under Project Properties -> Run
You can deploy .war files via the Glassfish admin console if the Glassfish server is already started. Navigate to http://localhost:4848, go to Applications and click on Deploy
You can manually deploy you applications. You have to copy either the .war file or a folder containing the contents of the .war file to the folder /GLASSFISH_HOME/glassfish/domains/domain1/autodeploy
Related
How can I do to deploy the web service automatically,I have the webService.war file ?I'm working with glassfish 4.1.1 and use a external library postgresql-9.4-1203.jdbc4.jar and I dont know how deploy the .war file thanks.
Not sure what you mean by deploy automatically, however, DeshanR's suggestion is still workable even for 4.1.1. You also have two other options:
You can deploy the war file from the browser by pointing your browser to yourdomain:4848. This will bring you to the glassfish admin console (provided glassfish is up and running and your glassfish is set to use port 4848, which by default it should be). You can then deploy your war file under the applications menu.
If this is a dev environment you can also deploy to your local glassfish from your IDE. This is an example for Eclipse. Connecting your IDE to your local glassfish has the advantage of allowing you to publish changes as you make them.
If you're using the postgres jar file for the JDBC driver and Glassfish's Connection Pool, you will need to restart the server to deploy that file after copying it in to your domain/ext/lib directory.
For the WAR, there is the asadmin command line client, your IDE may have direct support to deploy it from there, you can use the GF administration console, or you can copy the WAR in to the domain/autodeploy directory (assuming you have autodeploy enabled, which is it by default).
There are also HTTP and JMX interfaces, but those are probably not what you're looking for.
I have developed my webApp with Struts2, Hibernate and MySQL. Now I want to deploy it locally to the client in his computer without installing Eclipse .
For me I was installing wampserver and in the Eclipse I'm using Tomcat v7.0 Server at localhost. I don't use maven
please give me all step to do this task
You can use tomcat server.
Just create war file of your project and put it in tomcat's webapp folder and then move this folder to client machine.
At the client machine past your tomcat at any drive then open command prompt and go to that drive folder like 'd/new/tomcat' and bin folder of tomcat and then just type this command ./startup.bat
your tomcat is started check it on browser.
I have a Java web project in Eclipse which I run through Eclipse on Apache Tomcat.
Is there a way for me to permanently deploy the project on Tomcat such that it runs without having to open Eclipse and rather just starting Tomcat?
If yes, then what steps do I need to follow?
*UPDATE*
If I take the .war file and deploy it on another system will it work? Note that I am using a MySql database in this project. So will transferring the .war file also transfer the database?
You package the project into a war file (since it is a web project) and put that one into the Tomcat's webapps folder. The deployment should then happen automatically, when Tomcat is started.
Generate a WAR file within Eclipse. (Properties->Export->WAR File)
Place this file in the {installation}/webapps folder of Tomcat.
It should deploy now.
I have created a dynamic web projects in eclipse which includes jsp pages and servlet.The back end of this application is Mysql and i include mysql-connector-java-5.1.15-bin.jar in the lib folder. I want to deploy this web application using Tomcat server instead of running this application in eclipse using tomcat. How is it possible?. Can any one suggest any sample codes or methods to solve this problem.
copy the WAR file to Tomcats webapps folder and it should auto deploy. answer by Will Hartung is correct
you need to build a war file (or ear depending on which technologies you use), and then deploy that to your container. (in the tomcat/webapps folder i believe). Ant and Maven, two popular technologies for managing a project, both support doing this. There is plenty of documentation on the web as well
http://www.vaannila.com/ant/ant-sample-build-file-war-1.html
Step 1: Go to Windows > SHow View > Other > Select Servers
Step 2: In Server Tab . Right Click > Add New Server > Add Run time if not available and add tomcat server.
Step 3: Add your project to it and finish. If you will see in Server tab, you will see your project.
Step 4: Right click on server and choose either debug or run.
You can use ant build script by running that script from your eclipse your web application will automatically deploy into your tomcat. Another one option is to copy the war file into the tomcat's webapps folder
After export your application from Eclipse to .WAR file you can deploy, undeploy and reload it at Tomcat Web Application Manager Panel: http://localhost:8080/manager/html.
I have been using IntelliJ IDE (version 5.1) with Tomcat server (version 5.5) to build my Java web applications. I'm now trying to migrate my project to Eclipse IDE.
When I run my web application from IntelliJ IDE, it creates a exploded directory inside my web application project folder and then starts the server and runs the web app. (i.e. no WAR files and no copy to tomcat\webapps folder).
But in Eclipse IDE, it usually deploys the web app inside Tomcat's webapps folder.
Is there any way to deploy web applications to a exploded directory outside the Tomcat server, from Eclipse IDE?
There is pretty neat Eclipse plug-ins you can install that will allow you to do that.
Have a look at Plug-in, tutorial and from Sysdeo.
Sysdeo is the one that both Apache and IBM suggests.
There are actually quite a bunch of these plug-ins from different vendors.
The trick is to find the one that best suits your needs.
Hope this helps.