I have a java project that use tomcat. when I run project in idea with tomcat(version 6)my project run in idea and in tomcat not create web inf file for my project and war file. why?
thanks
It should be a web project not java project and Tomcat is not responsible for creating web-inf folder. It is created when you first defined the project. Also are you able to see your war after building ? Does it launch the browser when you say running in Tomcat?
Related
Hi can anyone please tell me how to convert the eclipse dynamic web app into executable jar. I need to use this jar in another application to generate the jsps. So even after adding into another project it should be working as web app only.
Can anyone please help me to resolve this.
For Dynamic web projects you cannot create an Executable jar file,but you always have an option to export as .War file that you can include to build and EAR file which can include multiple .war files from other Dynamic web applications as well. How this war can communicate with other war files with in EAR for that you can refer this Options to communicate between WARs in the same EAR
I just started to work on JSF. And i followed some steps. At last step i created project configured it. After build the project, eclipse created target folder inside of my jsf project. i moved the war file to webapps folder of apache tomcat.
After localhost:8080/firstJsfApp it worked successfully.
But when I changed something on this project and it recreates the .war file. and I have to move it to tomcat folder again (repeatedly).
Is there anyway to make this easier?
You can deploy your webapp to tomcat directly from Eclipse:
1st. Open the "Servers" view in Eclipse, and it will allow you to configure a tomcat instance.
2nd. Add your webapp to the tomcat
Then you can debug and hot deploy any changes to the project.
Here is a link were you can run tomcat in eclipse: http://www.coreservlets.com/Apache-Tomcat-Tutorial/tomcat-7-with-eclipse.html
Hello all master minds,
I have created a java spring application in eclipse with mysql db.
Now I can run this application using >Run on server in eclipse,but I want to know how to deploy this application on my own laptop(windows 7).
I have already configured server,by localhost://8080 I can see Apache tomcat is configured.
Give me simple steps so that i can just run that software using browser via its link like
http://localhost:8080/PMS
PMS is my project name.
Thanks in advance.
You can install tomcat-manager in order to deploy your war using a web interface: Tomcat 7 manager
Another option is to copy your war file into tomcat webapps folder. Your container will auto deploy your war: http://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html#Deployment_With_Tomcat.
The easiest way, since you are using eclipse is to just export your project as war and then put that war (naming it PMS) in webapps directory in your tomcat.
Once started, Tomcat will deploy that war on http://localhost:8080/PMS
You have to do the following steps:
Right click on project>> Export (Export as WAR file).
or if you are using a maven project then you can give a maven build.
Copy that WAR file, (you will get that war file inside the project folder in your workspace) to the tomcat_Installed_Folder/ webapps
Inorder to deploy the app from outside eclipse,
goto tomcat_Installed_Folder/bin
and double click on startup.bat
then you could see a console.
For detailed logs of deployment, goto tomcat_Installed_Folder/logs
ALL THE BEST :)
I currently have a working servlet created in Eclipse. When running it from the Tomcat plugin, everything works, and my app shows up at localhost:8080/project_name/. However, when I package the project into a .war file and place it in the /webapps directory of Tomcat and start the server, the servlet cannot be accessed. In Terminal, I can see Tomcat loading my project, and a temporary folder of the unarchived project is also created in /webapps. However, I simply cannot access my servlet.
Note:
I'm using Tomcat 7 and I don't have a web.xml file in my project.
How are you creating the war file? Check if your war files contain jar files under WEB-INF/lib folder and if the class files are not missing. You can easily verify it under tomcat/webapps/[project name] folder.
Can anyone guide me how to get Servlets working in Apache Tomcat server? I can run the Servlets from Netbeans without problems, but I don't know where to put the class files in Tomcat.
In tomcat:
class files must be in TOMCAT_DIR/webapps/<yourAppName>/WEB-INF/classes
jar files must be in TOMCAT_DIR/webapps/<yourAppName>/WEB-INF/lib
(and if course you'll need web.xml in WEB-INF)
They go in Tomcat/webapps folder. There are several ways to deploy a JSP/Servlet webapplication on Tomcat. They are all described in Tomcat Web Application Deployment HOW-TO.
If you already have developed the webapplication in Netbeans, then Netbeans should already have build a WAR file of it in the /dist folder. You just need to drop the WAR file in Tomcat/webapps folder and Tomcat will automatically deploy it during startup (or even while running, this is called hotdeploy).
If you want to develop without an IDE and/or don't want to create a WAR, then you just need to put a folder representing the context name in Tomcat/webapps, e.g. Tomcat/webapps/contextname. It will become the public web content. You can drop all JSP files and other static files in there. Then, for classes you need to create a Tomcat/webapps/contextname/WEB-INF/classes folder. There should go the package structure.