How to fix this "Unknown version of Tomcat was specified" (Windows) - eclipse

I want to connect with tomcat server with eclips IDE. I have already install tomcat 8.5 and 9.0 versions.
Both versions shows this error.
So please help me how can I configure my eclipse with tomcat any versions

Don't use an installed copy of Tomcat. Instead, download the Core zip/tar file and unpack it somewhere under your user's home directory. It has the most predictable layout for needed files and avoid any write permission issues you might have with an installed copy.
https://wiki.eclipse.org/WTP_Tomcat_FAQ#Why_won.27t_the_New_Server_Runtime_dialog_recognize_my_Linux_installed_version_of_Tomcat.3F

Related

How to use Tomcat 8.5.x and TomEE 7.x with Eclipse?

I need to setup a Tomcat 8.5.x server version in Eclipse. When I try to create a server using Eclipse GUI, I get in Eclipse Luna as choice the latest version "Apache Tomcat v8.0". When I select it and I browse to my Tomcat 8.5.x server, I get this blocking error message:
The Apache Tomcat installation at this directory is version 8.5.0. A
Tomcat 8.0 installation is expected.
The same error appears when trying TomEE 7.x, which is internally based on Tomcat 8.5.
In Eclipse Neon the latest version as choice is "Apache Tomcat v9.0" and it gives the same error. There isn't even a "Apache Tomcat v8.5" option.
Is there a way to use Tomcat 8.5 and TomEE 7.x in Eclipse? How?
You have to patch catalina.jar, as this is version number the WTP adapter looks at. It's a quite useless check, and the adapter should allow you to start the server anyway, but nobody has though of that yet.
For years and with every version of Tomcat this is always a problem.
To patch you can do the following:
cd [tomcat or tomee home]/lib
mkdir catalina
cd catalina/
unzip ../catalina.jar
vim org/apache/catalina/util/ServerInfo.properties
Make sure it looks like the following (the version numbers all need to start with 8.0):
server.info=Apache Tomcat/8.0.0
server.number=8.0.0
server.built=May 11 2016 21:49:07 UTC
Then:
jar uf ../catalina.jar org/apache/catalina/util/ServerInfo.properties
cd ..
rm -rf catalina
There is a patch for Eclipse:
https://bugs.eclipse.org/bugs/attachment.cgi?id=262418&action=edit
Download this patch and put it to the plugins directory of your Eclipse installation. It will replace the default "org.eclipse.jst.server.tomcat.core_1.1.800.v201602282129.jar".
NOTE
After you add this patch you must choose "Apache Tomcat v9.0" when adding a server runtime environment in the Eclipse (Preferences > Server > Runtime Environments).
I.e. this patch allows you to select either Tomcat version 9.x or Tomcat version 8.5.x when adding Apache Tomcat v.9.0 runtime environment.
More details on can be found on the related bug report page:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=494936
For Tomcat 8.5.x users
You've to change the ServerInfo.properties file of Tomcat's /lib/catalina.jar file.
ServerInfo.properties file contains the following code
server.info=Apache Tomcat/8.5.4
server.number=8.5.4.0
server.built=Jul 6 2016 08:43:30 UTC
Just open the ServerInfo.properties file by opening the catalina.jar with winrar from your Tomcat's lib folder
ServerInfo.properties file location in catalina.jar is /org/apache/catalina/util/ServerInfo.properties
Notice : shutdown the Tomcat server(if it's already opened by cmd) before doing these things otherwise your file doesn't change and your winrar shows error.
Then change the following code in ServerInfo.properties
server.info=Apache Tomcat/8.0.8.5.4
server.number=8.5.4.0
server.built=Jul 6 2016 08:43:30 UTC
Restart your eclipse(if opened). Now it'll work...
As for now Eclipse Neon service release is available. So if someone is still encounters this trouble, just go to
Help → Check for Updates
and install provided updates related to : org.eclipse.jst
This workaround worked for me. I edited the serverInfo.properties file as given below:
server.info=Apache Tomcat/8.0.0
server.number=8.0.0.0
server.built=Oct 6 2016 20:15:31 UTC
I had similar issues with Eclipse Kepler v3.8
I had tomcat v8.5.37 installed. I couldn't see Apache v8.5 as an option. By skimming through StackOverflow I found Apache v9.0 is available on Eclipse Neon.
Cool thing is you don't have to change your eclipse version.
In your current Eclipse. Download WTP(Web Tools Package) by following the steps:
Step 1: Help >>> Install New Software. Copy this link in the Work with: http://download.eclipse.org/webtools/repository/neon
Step 2: Select JST Server Adapters and JST Server Adapters Extensions from the first package you see. Install those.
Step 3: Windows >>> Preferences >>> Server >>> Runtime Environments >>> Add..
You'll see Apache v9.0 there!
It works!
Install the latest version of eclipse(). It would have the option to add Tomcat 8.5.
Go to the preview version of tomcat e.g. : tomcat 8.3 and copy catalina.jar file and
paste into the existing tomcat which you have facing the issue
Forgive me for invoking old problem. But it is like legendary, always happen for new users. The reason I am here is I want to purpose different answer. Rather simple. Please fo to windows->preference->Runtime Environment->search and select the folder where you download the server. It will automatically detect the server and you are good to go.
I'm guessing that you are running Eclipse Mars, or an even earlier release. You need to upgrade to Eclipse Neon or later
Navigate to /apache-tomcat-8.5.65/lib/org/apache/catalina/util/ServerInfo.properties
Then change
server.info=Apache Tomcat/8.5.65
server.number=8.5.4.0
server.built=Jul 6 2021 00:29:43 UTC
server.info=Apache Tomcat/8.0.8.5.4
server.number=8.5.4.0
server.built=Jul 6 2016 08:43:30 UTC

GlassFish 5.0 - Not a valid GlassFish Server installation

I downloaded the GlassFish 5.0 from here because I was experiencing an issue with the JDBC connection pools in GlassFish 4.1.1 (and 4.0).
After unzipping the folder I tried to add the server to NetBeans and I received this error:
Not a valid GlassFish Server installation.
The found one potential answer here, but it didn't seem to help.
I am able to add other versions of GF into fine. Also, GF 5.0 runs, and it has fixed the previous issue I described in 4.1.1 which is nice.
One thing I noticed was that when I changed the name of the console-core file here:
glassfish4/glassfish/lib/install/applications/__admingui/WEB-INF/lib/console-core-5.0-SNAPSHOT.jar
to
console-core-4.1.1.jar
NetBeans actually recognizes the GF installation! I tried to go through the entire GF installation and replace references to console-core-5.0-SNAPSHOT.jar to console-core-4.4.1.jar, but after clicking "next" in the Add server dialog, it doesn't advance. I may have missed something, but it's still a major hack.
I know its a late answer But it may help other new to this issue.
Rename the console-core jar file to have version name limited to 2 figure i.e. if jar name is console-core-4.1.1 or console-core-4.1.2 or something like it then change it to as
console-core-4.1 which is in the directory in my case
E:\Programs\Java + Databases\java_ee_sdk-7u3\glassfish4\glassfish\lib\install\applications\__admingui\WEB-INF\lib
In my case in the above directory jar file name was console-core-4.1.1 And I changed it to console-core-4.1. Now Everything is working fine.
Its working with Netbeans and in browser too with url
http://localhost:4848
I had the same issue when I downloaded netbeans 8.02 and tried to add glassfish 5 server. After investigating for hours I found the solution. I had actually downloaded the Java EE bundle of netbeans 8.02 for installation. I uninstalled my netbeans and reinstalled using the Java ALL bundle installation file. Then the error went away.
Thanks,
Mitesh

root path glassfish v4 eclipse luna

I had just installed eclipse luna and I use the marketplace to install oracle package to use glassfish v4.0. Everything went ok but when I'm trying to install it they still show me an error at the server root path (Error: The specified directory is not a valid GlassFish installation.)...I don't know why? this happen even giving it a path. have anyone resolve this issue?.
I got caught by this trying to following along with the Lynda.com tutorial on web services with Java EE. You need to download and install Glassfish and then point the server root to the glassfish directory. Here are the steps I took:
download glassfish from here: https://glassfish.java.net/download.html
unzip the zip file: this is essentially the install step
navigate into the installation to the glassfish folder: this what you point eclipse to
The high level answer is here: How do I use Glass fish server with eclipse luna for Java EE?
Possible duplicate of How do I use Glass fish server with eclipse luna for Java EE?
However, you need to specify the "glassfish" folder under the extracted GlassFish files, for example ...\glassfish4\glassfish
First Download full platform from https://glassfish.java.net/download.html
Unzip it.
At the window you read this error, go to the browse for server root and find the glassfish folder inside your unzipped folder. Click on it and your error will be gone.

How to uninstall server adapter?

Eclipse EE Indigo. I installed additional server adapter and I don't know how uninstall them.
they are not shown in the list of installed software
uninstalling entire eclipse and installing it again does not help
given server adapter is visible for Eclipse, because it can report conflicts for it (if any) and it is excluded from the list of adapters available to install
I don't know where I could find a list of installed server adapters with ability to uninstall them.
So -- how to uninstall server adapter?
Have you tried reverting to an older eclipse configuration version :
Help > Installing New Software > Installation History > select a configuration before you added the server tools.
ps: please let me know if this worked or not and wether you found another working solution.
In Eclipse EE Juno, I tried the trick of gaspyr to revert to an old configuration version and it worked even though the server adapter is not listed in the content installed from the installation history.
In my case, this was a pretty fresh install of Eclipse with very few configuration versions in the installation history and I knew when I had installed the server adapter. All I had to do is select a version prior to the server adapter installation.
If you are not sure what version it is, you may need to go through the installation history and revert to every versions, one by one and check each time if the server adapter is present or not. Afterwards, you may have to reinstall every plugins you had installed after the server adapter.
This one is different from other software, but to remove a Server Runtime, go to Preferences -> Server -> Runtime Environment, select the Server runtime you want to remove and click Remove.
That should take care of it.
Pretty Easiest thing would be deleting all the related Jar files and folders manually from the Eclipse folder in the file system.

Tomcat server type unavailable in Fedora 15 Eclipse package

I have installed Tomcat server on my Fedora 15, I can run it, and it's avaible at the localhost:8080. Then I tryed adding it into eclipse, File->New->Servers->Server But the list is empty. I am reading this guide http://vaadin.com/book/-/page/getting-started.first-project.html And this is how it should be
(source: vaadin.com)
And this is how I see it
howiseeit http://img42.imageshack.us/img42/8320/38149731.png
Maybe you don't have Eclipse WTP (Web Tools Project) installed. Try installing it on top of your Eclipse-Installation or get startet with the Eclipse IDE for Java EE Developers where this is already included.
In your first image.. .try to click Installed runtimes. Locate your tomcat installation directory and select it.
I think the server is not detected because it's either stopped or eclipse cannot find the installation directory.
Hope that helps. :)