Configuring an Eclipse project to run on Tomcat - eclipse

Eclipse (Version: 2020-12 (4.18.0) has been downloaded, and a new workspace created, together with one new project (Spring Boot starter, maven), which displays in Project Explorer. In order to install Tomcat server to Eclipse , Tomcat has been downloaded and installed locally.
In the Eclipse Servers tag, the following link is selected:
No servers are available. Click this link to create a new server.
This popup appears:
After selecting the Tomcat version and selecting Next, the following popup allows the server installation to be specified:
After clicking Next, the following popup appears:
I am expecting the new project to be available to be added to the tomcat server, but the left pane is empty.
What is the issue?
Thanks

Related

Unable to install new software on Eclipse Neon

Whenever I click 'Install New Software' in the Help menu, I get a popup with
An internal error occurred during: "Contacting Software Sites".
java.lang.NullPointerException
Clicking 'OK' and selecting 'Neon' or 'Eclipse Update' in the 'Works with' dropdown list gives me another error popup:
'Fetching children of Neon' has encountered a problem.
I have seen various questions with a similar issue, but none of the answers solve my problem.
I hope to install 'JST Server adapters' to add Tomcat server in Eclipse.
I am using Eclipse Neon.1 on Fedora 25.
If the 'Install New Software' issue cannot be resolved, is there any way that I can add tomcat server in Eclipse?
I've downloaded Eclipse Neon.1
I've this version: eclipse-jee-neon-1-linux-gtk-x86_64.tar.gz
The following installation will use:
Tomcat 8.5.15
Eclipse Neon.1 Release (4.6.1) Build id: 20160913-0900
Fedora 25
in my case, I do not Have any issue when:
I click on Install New Software OR
Selecting Neon
To add a tomcat server to Eclipse Neon.1 follow the following steps:
download the tar.gz file from https://tomcat.apache.org/download-80.cgi#8.5.15
direct link:
http://httpd-mirror.frgl.pw/apache/tomcat/tomcat-8/v8.5.15/bin/apache-tomcat-8.5.15.tar.gz
(extract your files with tar -xvzf apache-tomcat-8.5.15.tar.gz in a Console)
Go to File, New, Other, type server, hit next, choose Tomcat 8.5,
Indicate the server location files and hit Finish
:
right click the Tomcat 8.5 server, properties, and click on Switch Location
Final step
in the screenshot follow the red 1, 2, 3 steps:
double click on Tomcat v8.5 Server at localhost.server at left
choose: Use Tomcat installation (take control of Tomcat installation)
save All
Now start your server under the server tab
And go to localhost:8080 in your browser.
Now for manager-gui, you have to edit your tomcat-users.xml file to edit the different user roles...

unable to create server tomcat v8.0 in eclipse

i am using eclipse mars 2 and i am new to eclipse,
when i click to create a new server apache tomat v8.0 it does not show me next and finish button
enter image description here
but on selection of v7.0
this image comesenter image description here
I tried all these
delete the .eclipse folder in C:\Users\Manish Kumar Tomar**.eclipse**
not worked
then delete the complete eclipse extracted folder which downloaded from eclipse site, i used to run all the time from there eclipse
and replaced with new downloaded and extracted folder
then i run the error is still same
i was working with v8.0 but due to some errors i deleted it, then again i try to create, it is not able to create new
thanks for helping in advance :)
Before creating a Tomcat 8.0 server, you'll need to add a Runtime Environment for it:
Download Tomcat v8.0 from here. I recommend not using 8.5.x as Eclipse has trouble recognizing it properly. If you do decide to use 8.5.x, see this answer first.
Extract the downloaded file and make a note of its location.
Open Window > Preferences in Eclipse.
Scroll down to Server, expand it and select Runtime Environments.
Choose "Add..." on the right.
Select "Apache Tomcat v8.0" and click Next.
Click "Browse..." and select the location of your Tomcat v8.0 installation.
Click Finish.
Once you follow those steps, you should be able to create a Tomcat v8.0 server the way you were trying before.

Cannot install Apache Tomcat in Eclipse

I've downloaded apache-tomcat-8.0.8 archive, then I've unzipped it and tried to add it in Preferences -> Server -> Runtime Environments by clicking Search and selecting path to the uzipped archive. What I'm getting is Server Error
No new server runtime environments were found.
Any ideas why it might be happening? I have no Apache Tomcat options in New Server Runtime Environment window, which I get by clicking Add in the previous one. There are such options in every tutorial I read.
I think there currently is no adapter for Tomcat 8 in Eclipse.
Updated
Don't use the search button. Click add and choose an adapter first. Open Apache and choose Tomcat 7. Click next and point the installation directory at your Tomcat folder.
It seem that you have Eclipse without Java EE components.
so you see something like
instead of
Check Apache Tomcat Not Showing in Eclipse Server Runtime Environments (need to install JST Server Adapters )
Once you have plugins installed follow dialog flow e.g. like
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jst.server.ui.doc.user%2Ftopics%2Ftomcat.html
Seems like no java EE component.
Eclipse IDE for Java Developers 'Servers' doesn't exist.
Therefore download correct Eclipse IDE. It is Eclipse IDE for Enterprise Java Developers(Eclipse IDE for Java EE Developers).
Then,
Open Eclipse IDE > Click on the Servers tab located at the bottom > right click > New > click on Server.
Select Apache and then select the appropriate version of tomcat server.click Next.
Select tomcat Installation Directory and JRE. Click next.Click Finish.

Jetty deployment error

I have deployed a project in Jetty (jetty-wtp plugin) in an Eclipse "Server". When I start the Jetty server the console output an error:
java.lang.NoClassDefFoundError: javax/annotation/security/RunAs
I also added common-annotations.jar to this project lib but cann't resolve this problem.
My installed environment:
JDK 1.6.0
jetty 8.0.0.M2
jetty-wtp http://download.eclipse.org/jetty/updates/jetty-wtp/development
How can I fix this?
download annotations-api.jar
download and include the above jar in your classpath
(Inspired from http://pipecuts.wordpress.com/2011/01/30/classnotfoundexception-org-objectweb-asm-classvisitor/#comment-18)
In the Servers view, right-click the entry for your (Jetty) server and select "Open".
Click the link 'Open launch configuration' and select the 'Classpath' tab in the resulting dialog box.
Select the 'User Entries' section and click 'Add External JARs'. Point it to jetty/lib/annotations/javax.annotation-[version].jar.
I'm using Jetty 8.1.1.v20120215 with Eclipse Indigo SR1 (WTP 3.3.2, Jetty WTP Adaptor 1.0)

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.