Where does Tomcat in Eclipse store the expanded WAR? - eclipse

When I launch my web application from Eclipse Indigo, where does Tomcat 7 store web application folder? It is not located in Tomcat's own webapp folder. Why I can not access Tomcat's default home page (I talk about http://localhost:8080), if it started under Eclipse? If I start tomcat manually (thruogh the startup.bat), I can access http://localhost:8080.

Doubleclick the Tomcat server entry in Servers view and check the Server Locations section. The path is in there and you can also configure in there if Eclipse should use the Tomcat installation instead of the workspace metadata (which is the default setting).
Note that the server must be published with no modules present to make changes. I.e. stop the server, remove all projects and publish the server.
This will also make the Tomcat homepage available.
See also:
Tomcat started in Eclipse but unable to connect to http://localhost:8085/

Per default it will deploy your application in a subfolder of .metadata-folder from your workspace.

Related

Eclipse server location using workspace metadata, can't change to installation

I want Eclipse deploy my application to Tomcat installation folder's webapps when I add it to server in Eclipse, but for some reason Eclipse seems to use it's internal server instance under .metadata/.plugins, even thought I added my server manually and provided the installation directory. After that I added the server runtime to project facets and enabled dynamic web module. Now when I add the application to server under server tab and start the server, application doesn't appear in Tomcats installation folder nor is the instance started up.
When I look the server configuration tab, I can see Eclipse is using workspace metadata for server location and doesn't let me change it to tomcat installation.
What is causing the problem and how to solve it? I have spent hours with this one with no luck.
Remove all modules in the server configuration/Modules tab.
Close the configuration.
Right click the server in the "Servers" view and publish it.
Open the configuration again.
Then it must be editable.

Liferay homepage is not found after starting the server in Eclipse

I have set up a Liferay Tomcat Server in Eclipse. After the server starts and I go to localhost:8181 (where I configured the server), the page is empty. Also, if I right click the server in Eclipse and select Open Liferay Portal Home, a 404 Page Not Found is displayed.
When I start the server outside Eclipse, with startup.bat, the page loads just fine.
Does anyone have a clue about why this might happen?
This answer assumes you're using Liferay IDE in Eclipse. It might be accurate even if you're not.
Try making your edits in the Eclipse workspace's server.xml file. The workspace should have a Servers folder, with your Tomcat Liferay server underneath it. The path in my workspace is as follows:
eclipse-luna-workspace/Servers/Liferay v6.2 CE Server (Tomcat 7) at localhost-config
Underneath the directory for the server are copies of the Tomcat configuration files, including server.xml. Make your edits to this server.xml file, restart your server in Eclipse, and Eclipse should copy it to the Tomcat instance at startup.
Where you defined Tomcat http port? And in which way Tomcat is configured in Eclipse?
These questions because Eclipse is able (but it's not mandatory) to override Tomcat default configurations.
Just a note: do you try to use Liferay plugin for Eclipse? It can help you to proper configure a Liferay server in Eclipse (and help you for development also).

How to run web pages without starting eclipse

I have created a dynamic web application using eclipse. it consist of java servlet and jsp and it run on tomcat 7.2.it runs fine under any browser if run it through a eclipse, copy the address and paste it in browser while eclipse is running. I wish to run this application without running eclipse. for this i run the tomcat manually using startup command. however than when i use the website address of my web site in the browser it says resource not found. I want to run this without actually running eclipse. any suggestion please.
You'll need to deploy the war file that was built by Eclipse to your new Tomcat server. You can just copy it to <tompcat-instrallation-path>/webapps location. It will be exploded by Tomcat automatically and you'll be able to see your pages at:
http://localhost:<port>/<name-of-your-war>/...
Where <port> is usually 8080 if you didn't change it in Tomcat's config and <name-of-your-war> is the name of your war without .war extension.
You will need to take the built war file, name it ROOT.war, and place it in the /webapps directory in your tomcat directory. Tomcat gives instructions for this, you will replace the ROOT.war that is there by default. You should also check to make sure you are using the same port on which Tomcat is running.

Tomcat home page is not showing when running in Eclipse

I'm running Tomcat in Eclipse. I would like to see the Tomcat home page, however it doesn't show up. When I browse http://localhost:8080, then I get a HTTP 404 Page Not Found error.
How is this caused and how can I solve it?
Eclipse does by default not use Tomcat standalone. Instead, it overtakes its sole server engine and uses the workspace as deployment space instead of Tomcat's own /webapps folder. It also creates copies of configuration files like server.xml in the Servers project. It untouches the Tomcat installation. It untouches the Tomcat default homepage (and manager). It untouches existing deployments.
As the Tomcat homepage is not one of Eclipse projects (nor would become one), you won't see it when starting Tomcat from inside Eclipse like that. You would only see Eclipse projects which are deployed to the server by Add/Remove projects. I'm not sure why you need to see the Tomcat homepage as it has no utter value while developing Java EE web projects. But if you are really dead set on seeing it for some unclear reason, then you'd need to tell Eclipse to not only overtake its engine, but instead use the standalone installation at its entirety.
To configure that, double click Tomcat's entry in Servers view to open its configuration and in the Server Locations section, choose the option Use Tomcat installation.
You'll now be able to see Tomcat's homepage.
Again, the benefit is highly questionable. Do note that this way Eclipse will modify the Tomcat installation. So the Tomcat installation may not be reuseable across other IDEs/workspaces. You'd need to create a whole new Tomcat installation.
In eclipse,right click over tomcat server in servier view.
tomcate->properties.click switch location.
Try the following steps once:
1.Remove schoolManagementsystem folder and war file from webapps folder
2.Task Manager--> end the all java process
3.Now execute the command catalina.bat run in command prompt.
Hope this will help you .

Tomcat and Eclipse server configuration

I installed tomcat on my ubuntu. When i create a new Dynamic Web Project I choose the tomcat 7 server. When I launch my page it works on localhost:8080/app/page but if I go on localhost:8080 it give me a 404 error.
If i start tomcat server with an external script like /etc/init.d/tomcat start, it works but I cannot launch my app because it says that the port 8080 is already occupied (by the other instance of tomcat).
I'm confused on how set everything, I would start tomcat at boot and link that instance for my apps.
Can you explain how I hato to do?
Open the server configuration in the Servers tab on Eclipse. On "Server Locations", mark "Use Tomcat installation".
EDIT: to be more precise, this will make Eclipse "take control" of your Tomcat folder. So it will not just make a replica on eclipse .metadata and deploy only your apps on it; instead it will be like if you ran bin/startup, but using some of the configuration defined on Servers view. So if you go localhost:8080 you will see the Welcome page, because /ROOT is now started by Eclipse.
So, I am not against "Starting/Stopping" the server from eclipse but to keep it simple, I think you can stop the server from eclipse (Click on windows/showview/Servers and then stop the server). Then I think you should not get an error if you start tomcat again from external script. Then you can right click on your dynamic web project in eclipse and export it as a war file inside tomcat-install--dir/webapps. Where your web application is available (on which context) depends on the web.xml file. If you need further info on this plz let me know.