Eclipse dynamic web project not running on tomcat server - eclipse

I've installed a Tomcat server to my Eclipse (Kepler), so why does it need an internet connection when I run a dynamic web project?

If I understood your question correctly - you need to start your tomcat server before you access your application. It's not related to internet connection.
Overall Steps:
1.Follow THIS post answer steps to setup tomcat into eclipse
2.Add your application artifact (.war or .jar file) into tomcat server by right click on server -> Add and Remove...
3.Select your artifact and click on add button. You will see artifact moved from Available to Configured box.
4.Clean entire project (Project -> Clean)
5.Start you server and check console for any error.
6.If you don't see any error - access your application
Hope this helps!!

Related

Running GWT on tomcat in eclipse

I am trying to get a GWT Project running on a Tomcat 7 server in eclipse. I installed Tomcat and i can run other web application out of eclipse on Tomcat without a problem.
Now i generated a gwt maven project for eclipse with the following command and importet it as maven project to eclipse:
"mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin"
I can run this now as Web application (with the google plugin) and i can build a "war" with maven and deploy this with the Tomcat management console on the server. Both is working. But if i choose the option in eclipse "Run on server" and choose tomcat than just the html is loaded but not the application itself. See the screenshot: It doesn't find the "GWTModule.nocache.js".
This file is available in the target folder. What do i have to change to tell tomcat to look in the correct directory?
Tomcat is not able to run GWT code in development mode. You can use Tomcat for server side code, but in this case you need to run GWT development mode with -noserver option (to prevent built-in Jetty instance from running). See this article for more details.
I would recommend using the wtp plugin for eclipse. If you do this you can add your project/resource to tomcat when adding a new server. Here are the steps to use if you already have your project imported into eclipse.
Window -> Show View -> Servers
In Servers
New -> Server -> Choose apache tomcat
Point to the location of your tomcat installation/download
Next
At this point you should be able to add your gwt-maven project which will add the target/project.war to the tomcat modules.
Save it
Click on the newly added server, then click the modules tab at the bottom kind of hard to see.
This should have your project shown in the list of web modules.
Start your tomcat instance then on your gwt application right click and choose Run As -> Web application. Make sure your configuration settings are correct and when the development server starts it should give you the development url to browse to.
You can configure some aspects of tomcat in the overview tab, I would recommend making sure that "Modules auto reload by default" is checked so that tomcat will watch the filesystem for class changes.

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.

How to configure gwt application on tomcat for debugging?

I am trying to debug a GWT application on Tomcat, but I don't know how to run/debug my application on Tomcat in Eclipse. I have so many links but I can't get a proper result.
I'm using -noserver -port 8080 and war file configuration but every time I get an error 404 while I run the application.
Here are some links that I follow but I can't configure:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/7511aca28b5f683c
https://developers.google.com/eclipse/docs/faq#gwt_in_eclipse_for_java_ee
http://jxpang.blogspot.in/2010/11/configure-external-tomcat-7-server-in.html
update
I am having same url but i think i am doing wrong configuration. is any body has proper solution for configure gwt web application with apche tomcat with debugging.
I want step by step configuration and running tutorial
please help me.
So you connect to the local server, but it can't resolve your URL?
If you stick with all the defaults, then in dev-mode you would use the following URL:
http://127.0.0.1:8888/index.html?gwt.codesvr=127.0.0.1:9997
But when configured on an external server you would need:
http://localhost:8080/MyApplication/index.html?gwt.codesvr=127.0.0.1:9997
Also make sure that in the 'Server' tab of your Debug configuration the option Run built in server is unchecked.
Hope this helps!
In Eclipse: right-click on your GWT project, and choose "Run As web Application (running on an external server)"
Then you can fill the field External root server (dns/ip and webapps folder for tomcat)

Ejb with NetBeans

I am very new in Ejb and with very few knowledge about it. I have download NetBeans (7.01) and GlassFish and run a sample program. But, as I have no idea about Ejb, I can't understand how to run this program on NetBeans. Can anybody help me by giving steps how to run this program. Thanks in advance.
NetBeans installs on default GlassFish web application server, which deploys your enterprise projects. To ensure that server is registered in the IDE, go to Services -> Servers inlay and look for "GlassFish Server 3.x". If you found it, open projects properties inlay: right click on your enterprise project -> Properties -> Run and make sure, that "Server" is set to "GlassFish Server 3.x". Then you can deploy you enterprise application: right click on project -> Deploy. IDE should start application server and deploy your application. To run your deployed project right click -> Run or type in the browser address, given in your tutorial, which is mapped to your resource (e.g. http://localhost:8080/book). In this way GlassFish doesn't require additional settings files except persistence.xml in your ejb project and web.xml in the web project.
In case you don't have GlassFish server installed, you can download it here. Make sure you don't have it already installed separately from NetBeans.
If you want to deploy your app on JBoss application server (instead of GlassFish), you should first download it from official site and install. After you've done it, you can set it as server in NetBeans: Services -> Servers -> Add server. Then you can deploy your project as was described above.

how to stepin/debug a Maven web project in eclipse

I have a Maven project which is a web project and is packaged as a war.
I use tomcat-maven-plugin v1.2-SNAPSHOT to do a tomcat:deploy when i want to deploy.
But my question is how do i debug it / set breakpoints like i can do for normal web projects in eclipse (where a Debugging perceptive is shown and the server is paused.)
(i am a noob in this field)
[EDIT] I am not asking how to deploy to TOMCAT. i am rather asking how to setup the debug mode .FYI i am not able to right click on my project and select run> run on server, even though i have generated WTP specific files through maven.
mvn tomcat:deploy deploys an app to an external Tomcat server. If you want to debug that, you'll need to run that Tomcat server with debugging enabled and set up a remote debugging profile in Eclipse.
Edit: There's a succinct guide to doing this on the Tomcat wiki. The simplest approach is to start Tomcat with catalina jpda start. That will start Tomcat in debug mode listening on port 8000 for debugger connections. Then in Eclipse, you create a "remote" launcher configuration and tell it to connect to localhost:8000.
It doesn't matter whether you deploy it with maven or with Eclipse WTP as long as you started the server to which you deploy from eclipse and eclipse knows where the sources of the code you deployed are placed.
Keep attention if you have set the CATALINA_HOME environment variable, this will used to deploy to with mvn tomcat:deploy. But you can also define this in the configuration of the pom.xml.
<configuration>
<url>http://www.mydomain.com:1234/mymanager</url>
</configuration>
I'm not sure that it is feasible through the Maven plugin.
But you can generate eclipse specific files: mvn eclipse:eclipse -Dwtp.version=2.0 (The WTP version depends on the WTP version of your Eclipse).
Then, you can update your project and deploying it into a Tomcat like you can do for normal web projects.
This solution worked in my case, you can try this
Add module to Server
Go to the Servers view.
Double click on the Tomcat server.
You will get the server editor view.
Click on Modules tab in view (at bottom)
Click add External Web Module enter the path to your built files (e.g., C:\svn\projectName\trunk\test\project\target\webapp) and give a path.
Save.
Debug Server
Right-click on Tomcat in Servers view.
Choose Debug.
Debugging Startup
If you are debugging the startup of your application you might need to increase the startup timeout in the server view.
Thanks.