Eclipse tomcat project context menu option - eclipse

I recently upgrade to Eclipse Kepler and I loose the context menu option Tomcat project to create war file to deploy an application.
What can I do?

I am not that much familiar with this plugin.
But can you verify your installation from its official page link .
Its mentioned that you need to add a couple of other dependencies manually. Like DevLoader.jar and the Sysdeo Eclipse Tomcat Launcher plugin
Edit
If you just want to deploy the project to your tomcat, you can use the Run as option as well. Just right click on the project, select Run as and then Run on Server
And to make a war, you can simply export as war from the export option (Right click on project -> export
)

Related

Eclipse: Can't run project on Tomcat server

I have installed the Tomcat plugin and it works if i create a New Dynamic Web Project, and import an existing basic maven webapp into it. I can run it with the option of running it "as server".
However, when i did an Import existing project, in Eclipse, of an existing basic maven app, I had to right-click on the Project, choose Configure and convert it to a Faceted project, then right-click on the Project, choose Properties, and choose Targeted runtimes, and choose Tomcat and JRE. However, i still cannot run the project, "as server". When i click Run, i just see Java Applet, Java Application and JUnit Test as the options with which to run the project. I don't see Server.
Looks like the answer is:
May be Dynamic Web Module in Project Facet is not selected
Go to :- Project > Properties > Project Facets > check Dynamic Web Module
Answer from Mohit Saluja for the following question: Eclipse Juno, maven project not able to run on server
Navigate to Project > Properties > Project Facets .
In the Runtimes Tab check the apache version which is installed in your lappy, and uncheck others .
Import the project as an existing maven project (you'll need m2e installed and either m2e-wtp or webby) and the maven configurators should set it up as a dynamic web project for you and get you ready to go. Then with m2e you can "run on server" or with webby you can "run as webby"

Eclipse Juno, maven project not able to run on server

I upgraded to Eclipse Juno(for Java EE developers). I installed Maven Integration for Eclipse through marketplace.
Just to test, I created a web app using maven-archetype-webapp. I cannot run on server(There's no menu Run On Server). The same happens with another maven project which runs fine using Eclipse Indigo. A tried deleting .settings, .classpath, .project then re-importing the project but nothing. I was hoping so much on Juno!
Does anyone know a real solution to this problem?
May be Dynamic Web Module in Project Facet is not selected
Go to :- Project > Properties > Project Facets > check Dynamic Web Module
How about installing the m2e-wtp plugin and trying? You would want to confirm that the maven project is of war packaging as well.
Run on server is not a maven feature, it's a "classic eclipse" feature.
In order to run a maven project on a server you must adopt a plug-in (e.g a Jetty plug-in for your webapp) and the run the proper maven goal (e.g jetty-run).
Said this, you can run a web project on a server with (right-click) > Run as > Run on server if you have the proper runtime environment configured.
Enabling "Dynamic Web Module" in Project Facets may not help here in maven projects.
Because maven projects are structured differently (target/sampleApp-1.0-SNAPSHOT.war) than the normal Dynamic Web Projects (WebContent/).
So, If you use Dynamic Web Module manually, then eclipse will try to use "WebContent" directory structure as deployment directory for Application Server which won't be the case in maven projects.
Solution is to use m2e-wtp plugin to do the deployment.
If you installed m2e-wtp plugin, it'll automatically detect your maven project type & it'll show you the "Run as Server" option in "Run as" menu in "Project".

Run on server option does not display in eclipse helios for spring-maven project

I have imported maven project in eclipse and configured properly. Its a web application, however I can't see 'Run on Server' option on right click in 'Run As'. I have Eclipse Helios and maven, tomcat plugin installed. should it required any plug-in for this or we need to convert project. Other web applications are getting 'Run on Server' option.
check Project properties / Project Facets / Dynamic Web module.
You might find this helpful;
http://vijaypm.blogspot.com/2010/12/maven-eclipse-and-tomcat.html
I had similar issue, unable to run on a server due to project facet validation issue.
I'm using Eclipse "Juno Service Release 2".
And resolved the issue with the following steps:
Right click on the project (on Project Explorer)
Click on Properties
Click on Project Facets
Uncheck the unwanted Project Facet(s).
Eg., I have unchecked Oracle WebLogic Web App Extensions
(because, my server is Apache Tomcat 7)
Apply >> OK
Now, I am able to run my web app on Tomcat server.
Hope this will work your you too.
Thanks,
Maris

Running jetty from eclipse

Please let me know how can I configure jetty server to run from eclipse IDE?
Also, suggest me some good plugins for the same. I downloaded jetty launcher but not able create new configuration with it. Please help.
The best way I found to run Jetty from eclipse (and debug, etc.) was this : http://neelzone.wordpress.com/2007/06/18/jetty-and-eclipse-integration/
Basically, you create a java project, put jetty's code in it, create a context file in jetty/contexts that points to your web application, and Run as Java application.
No need for a plugin.
With Eclipse Kepler, I found two plugins, "Eclipse Jetty" and "Run Jetty Run" in the
market place.
I tried "Run Jetty Run" first but couldn't make it work (css file didn't load), but with
"Eclipse Jetty", it worked out of the box for my project.
I have followed the below steps to set up Jetty server in my eclipse:
(1) Download the 'net.sourceforge.eclipsejetty.launcher' jar (plugin) from the below URL:
http://sourceforge.net/projects/eclipse-jetty/
(2) Copy the downloaded jar file to your eclipse 'plugins' folder (Example: C:\eclipse-jee-luna\plugins)
(3) Restart Eclipse
(4) Go to Eclipse Workspace -> Right click on your web project -> Run -> Run Configurations > Jetty Web App > Set the 'WebApp Directory' > Click on Run
After following the above steps, I am able to successfully deploy & run my web project using Jetty Server in Eclipse.
I hope this is helpful and easy to set up.

Debugging a tomcat project in Eclipse 3.4.2

I downloaded eclipse 3.4.2 and tried installing tomcat plugin (version 3.2.1)for eclipse from sysdeo (http://www.eclipsetotale.com/tomcatPlugin.html)
I have followed installation instructions but when is start tomcat from eclipse toolbar i got the following error
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
at java.lang.Class.getConstructor0(Class.java:2671)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:205)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)
I did follow troubleshoot instructions but no success.
I tried to putting plugin in dropin directory too but still got the same error.
This was working fine in eclipse 3.2 and 3.3
Then I tried using standard inbuilt WTP to set up my tomcat server. I am not sure how it will pick my server.xml in conf directory of tomcat, it seems it is not picking as of now.
How do I associate my eclipse project with this setup. I am able to start the server but when i browse the tomcat start page, it does not show anything.
I would appreciate if someone can provide some ways to fix this.
Thanks in advance.
-Dipesh
After trying out few things I was able to debug tomcat project in eclipse 3.4.2
To debug tomcat application/project using eclipse 3.4.2 use WTP plugins which are installed along with it.
Go to Window --> Show View --> Others --> Server
In this view create a new server, please select tomcat installation directory and version information.
Then double click on Tomcat VX.X Server at local host, it opens up configuration settings page
In the Server Locations Section select "Use Tomcat Installation (takes control of Tomcat Installation) and enter deploy path.
In the publishing section select Never Publish automatically and uncheck update context path checkbox.
Voila!! All set to debug tomcat project in eclipse 3.4.2
There is no need to download and copy any extra plugin.
Thanks Juri. Hope this helps.
I'm using Tomcat with Eclipse Java EE version with WTP and it works perfectly. I have Ant scripts which deploy my web app to the tomcat webapp folder. In order to debug, you have to open the Server view in Eclipse, add a new server and choose the correct Tomcat version. Once that's done, open the configuration of Tomcat within eclipse by double-clicking on the server entry in the Eclipse server view you just created. On the left-middle side of the confguration page you should see something like "let Eclipse control the native Tomcat installation", I don't remember the exact text now. You have to choose that. Then you can set a breakpoint in your source code and then start Tomcat in debug mode from within Eclipse's server view.
Hope that helped.
If you are using the Sysdeo plugin, then you don't want to also be using the standard Eclipse WTP servers. To use the Sysdeo plugin, you need to have already downloaded and extracted a standard zipped tomcat directory. Make sure to define CATALINA_HOME in your path. Then, assuming you've correctly installed the sysdeo plugin, go into Eclipse->Windows->Prefs->Tomcat (this is Sysdeo's Tomcat settings, and not the WTP settings). You need to tell the plugin where you've extracted your Tomcat directory, and set it to use Context files.
Now create a new Dynamic web project. Right click it, and go into its properties->Tomcat.
Check it as a 'Tomcat Project'. Give it a context name, and also tell it the directory which would be the base of your war (by default, Eclipse has named this WebContent, I believe). Apply it and close the Window. Right click again your project, and go to the Tomcat section. Add the 'Tomcat Libraries to Build Path' so you can use the Servlet/JSP classes. Finally, click on 'Update Context'. If you go into your Tomcat directory under Conf, you'll see that the plugin has created a context for you that points to your Eclipse workspace. No need for deploying the app to the Tomcat directory. Now, you should be able to click on the Sysdeo Tomcat 'start' button, and your app should be able to connect to your app at localhost:8080/context_name.
HTH,
Bill
Using the excellent Findjar web page for:
org/apache/tomcat/util/log/SystemLogHandler
gives the following:
Information on class org.apache.tomcat.util.log.SystemLogHandler:
Containing JAR files:
jbossweb.jar
gwt-dev-windows.jar
tomcat-util-3.3.2.jar
tomcat-util-4.0.6.jar
tomcat-util-4.1.31.jar
tomcat-util-4.1.34.jar
tomcat-util-4.1.36.jar
tomcat-util-5.0.16.jar
tomcat-util-5.0.18.jar
tomcat-util-5.0.28.jar
tomcat-util-5.5.12.jar
tomcat-util-5.5.15.jar
tomcat-util-5.5.23.jar
tomcat-util-5.5.4.jar
tomcat-util-5.5.7.jar
tomcat-util-5.5.9.jar
tomcat-util-5.5.7-alpha.jar
tomcat-util-5.5.8-alpha.jar
tomcat-util-5.5.9-alpha.jar
Ensure the appropriate jar file is in your CLASSPATH.