Unknown version of Tomcat was specified with tomcat -9.0.37 - java

I downloaded the windows service installer of version 9.0.37.But at the time of connecting tomcat with eclipse IDE which is of version 2020-06 it is showing error that the version of tomcat was unspecified.
So please help me how can I configure my eclipse with tomcat-9.0.37

Look, you need to atleast open the folder once.
It will ask you the permission to enter after which it's contents will be visible to u as well as Eclipse.
So, after setting up and installing Tomcat, just go into the folder once, open it & then try connecting from Eclipse.
Instead of changing permissions, try this once!

From the WTP Tomcat FAQ: "To support searching for Tomcat runtimes, the contents of each directory being tested is checked for a set of content that uniquely identifies the version of Tomcat. These sets are based on the standard zip or tar.gz downloads from Apache. The packaged install for various versions of Linux (and even for other Operating Systems) might not quite match the expected set of files."
So get and unpack the zip file from https://tomcat.apache.org/download-90.cgi in a folder your user owns and use that instead (with its own port numbers or after disabling your Tomcat service).

I had the same problem. Later when I tried accessing the Tomcat folder from the file explorer, it said you need permissions to access this folder. This made me realize that the folder is in read-only mode.
So in the file explorer, right-click on Tomcat 9.0 folder, go to properties, click on the checkbox beside Read-only to deselect it and then click on OK.
Then again try the add server process in eclipse. It should work now.
Tomcat folder is in the following location :
C-> Program Files -> Apache Software Foundation
or wherever you have installed Tomcat.

I had first downloaded the .exe file in apache website and I had this same issue. I tried to change the permissions but it did not work so I went back to apache website and downloaded the .zip file. I extracted it to the same folder I have eclipse and closed and opened eclipse again. It worked this way.

You've to specify where the tomcat is, it can be from
a) Program files
C >> Program Files >> Apache Software Foundation
b) If tomcat is downloaded and you've zip,
Specify the Tomcat file location, don't select bin/conf folder, Tomcat won't be recognized but specify the folder of Tomcat Downloaded.
Doing any of these you can add sever in Eclipse

just try to enter C-> Program Files -> Apache Software Foundation -> tomcat ->bin and make sure there are files installed in this folder.
after that you can add the server in eclipse it will work.

Related

Tomee Installation process?

SPEC : jdk1.8 ,TOMEE702, win10
Question : How/What/which to install and use TOMEE for open-ejb3.X ?
url : http://tomee.apache.org/download-ng.html
I could not find any easy install-able for all of the downloads from the url.
with regards
Karthik
How to install
Just unzip the archive you downloaded.
which distribution
TomEE comes in several flavors which offer either alternative implementations for some of the specifications and/or additional functionality. Without more concrete requirements it's not possible recommend concrete flavor.
You can see the comparison here: http://tomee.apache.org/comparison.html Note that the table is for version 1.7 For 7.0.x, the details are in the text below.
The difference between plume/plus is that the first one uses eclipselink and mojara, while "plus" uses openjpa and myfaces.
The difference between web-profile and the others interms of ejb is that web-profile by spec supports ejb-lite, while plus/plume should support ejb full.
Also I'd recommend you to use the latest and greates version of tomee - currently 7.0.3 and upgrade to 7.0.4 as soon as it's released as it contains A LOT of fixes.
I think you want to know the way of using openejb with tomcat server.
To do that you will have to download openejb.war file.
http://tomee.apache.org/download/apache-openejb-3.1.4.html
After downloading openejb.war file download the tomcat server which can be downloaded from the link given below.
http://tomcat.apache.org/
Extract your tomcat zip file to a folder and deploy openejb.war file to tomcat's webapp folder.
If you are using Eclipse as an IDE then setup a tomcat server by going to window menu -> preferences -> server -> Runtime Environments. Add your version of tomcat server.
After adding the server, check the Project Explorer view, there you should see Servers folder. Finally right click on the project explorer view, select import and search for war file and lastly add the openejb.war file.
If everything goes well you should have successfully added openejb to your tomcat server.
If you have an openejb based project then you can add it by going to window menu -> show view and search for server. You should probably see the server view at the very end of your eclipse window. Right click on it and select Add and Remove. In the Add and Remove window you can control your projects deployment.
If you don't have a project then develop a project and add it to your server and run the tomcat server. You might also need to configure openejb.xml file depending upon your needs.
Tomee installation is no different then any other Tomcat installation. You should download the compressed file and extract it into your desired directory, preferably into root drive in case of windows extract it into the c drive.
Once extracted you can start it from the bin folder startup.bat or startup.sh script. Make sure you have the compatible jdk installed into your system and the path is configured for the JDK.
You can find the detailed installation step from the official documentation of apache.

NetBeans 8.0.2 fails to start Tomcat because of missing catalina.bat

I just finished setting up the prelimanary steps for a Java Web project on NetBeans. I installed NetBeans and created a network drive using Samba on my home Ubuntu Server, which has Tomcat7. When I try to run the example Hello World project, i get the following error:
Starting of Tomcat failed, the Z:\usr\share\tomcat7\bin\catalina.bat startup script is missing.
C:\Users\\Documents\NetBeansProjects\WebApplication1\nbproject\build-impl.xml:1150: Starting of Tomcat failed, the Z:\usr\share\tomcat7\bin\catalina.bat startup script is missing.
BUILD FAILED (total time: 3 seconds)
I checked the directory its is referencing and there is a catalina.sh file but no .bat file. Anyone know hints to get this file or how to get NetBeans to run the .sh file instead?
Download the appropiate zip file from https://tomcat.apache.org/. I use Tomcat 8.0.33 and I download zip file from the zip link in the Binary Distributions subsection of the 8.0.3 section download zip file.
Open the zip file (you don't need uncompress it), go to bin folder, copy the catalina.bat file.
Go to Apache Tomcat bin folder in you machine and paste the catalina.bat file.
Go to you NetBeans, click on Services tag (window -> services), left click in ApacheTomcat, click Start option
If must copy other files like setclasspath.bat, go to step 2.
If you are using Windows, Netbeans need the .bat file, not the .sh file.
catalina.bat file is distributed with the Tomcat binary distribution.
It's not in your path means either you have mingled with the files or you have downloaded wrong distribution (eg: source distribution).
So download a fresh copy of tomcat from here, set the path correctly and try again.
For some reason that I don't know, if you download the zip version of Tomcat, the .bats are there. It's not the same for the installer version though. (I am on Windows BTW, I don't know what happens on Linux.)
The Problem is happening when you are using the installer, use the distribution copy. it worked for me

Running website on Tomcat 7.0: Windows 2008 R2

My team and I originally had a server running through Eclipse (Java EE), but wanted to switch it to running on the Tomcat 7.0 service found in Windows 2008 R2. We are completely clueless on what files to put where in the Tomcat folders found in program files. The entire server has gone down and we can't go back to the original setup. Any help is appreciated. All we're asking is where do we put our JSP/ROOT ect folders in the Tomcat program files.
Copying JSP files are not good idea rather you can package your jsp file into an archive file called WAR file. You can export your project from Eclipse IDE as a WAR file.
After creating the WAR file (.war), you need to find out tomcat installation directory and its called tomcat HOME. Now you just need to copy the WAR file into the following folder:
{TOMCAT HOME}/webapps/<project>.war
I'll add to the answer.
If you have folders of running applications from before you can put 'em under
{TOMCAT HOME}/webapps/
war file will un-zip after you start the service.
once the war is un-zipped, you can delete it, but only after you stop the service for the first time after war deployment.

Unknown version of Tomcat was specified in Eclipse

I want to add latest tomcat-7.0.42 in my eclipse. Probably eclipse tomcat server adapter 7 only supports tomcat version upto 7.0.12 ..
So please help me how can I configure my eclipse with tomcat-7.0.42
You are specifying tomcat source directory.
You need to specify tomcat binary installation root directory, also known as CATALINA_HOME.
Usually, this is where you untar apache-tomcat-7.0.42.tar.gz file.
This happened to me because Tomcat was still in the process of downloading (Download and Install). The message disappeared after a few minutes.
The eclipse window should really have some type of progress indicator showing download status.
To recognise your Tomcat installation folder, Eclipse is scanning for the following files:
conf/catalina.policy
conf/server.xml
conf/web.xml
conf/context.xml
conf/tomcat-users.xml
conf/catalina.policy
conf/catalina.properties
lib/catalina.jar
so make sure you're pointing to the right place and have the right read permissions.
E.g.
OS X (if installed via brew), it's: /usr/local/opt/tomcat/libexec
Linux/Ubuntu: see: Tomcat and Eclipse Integration Error
For LINUX the installation directory for Tomcat 7 is:
/usr/share/tomcat7
Please use this configuration.
More here:
http://gridlab.dimes.unical.it/lackovic/eclipse-tomcat-ubuntu-jersey/
I got the same error and resolved it by giving enough permissions to the folder. I gave full permissions by (you can try limited permissions which is enough for eclipse to run tomcat)
sudo chmod -R 777 apache-tomcat-8.5.33/
FYI, I encountered this error on my mac, but I think it should be same for ubuntu system too.
I know this is and oldie but i had this issue recently with the latest versions of Tomcat and Eclipse on Windows 10.
It was a permissions issue. All i had to do was navigate to the Tomcat install directory and open the folder. I was prompted to access the folder as an Administrator.
After this the versions were recognised by Eclipse and I could add the new runtime.
I am on MacOS and installed tomcat using homebrew, Following path fixed my problem
/usr/local/Cellar/tomcat/9.0.14/libexec
Probably, you are trying to point the tomcat directory having the source folder. Please download the tomcat binary version from here .For Linux environments, there you can find .zip and .tar.gz files under core section. Please download and extract them. after that, if you point this extracted directory, eclipse will be able to identify the tomcat version. Eclipse was not able to find the version of tomcat, since the directory you pointed out didn't contain the conf folder. Hope this helps!
As soon as you provide the directory where Tomcat needs to be installed and click ok you can notice download and installation starts in the progress tab of Eclipse.
Let the process complete.The error will automatically disappear.
Note: It is not mandatory to name your folder CATALINA_HOME. I have tested this with windows. Cannot assert the same for Linux but IMO same rule should apply.
Just in case...
Apache Tomcat 8.5.X is not compatible with Apache Tomcat 8.0 server selection in eclipse. And it gives this error.
Go to "Window -> preferences -> Server -> Runtime Environments"
Remove the existing servers they might not have downloaded completely.
Add new Server
For Windows Users,
Use the Tomcat Service Installer from the Apache tomcat downloads page. You will get a .exe file. which Installs the service for windows. It will usually install Apache tomcat at "C:\Program Files\Apache Software Foundation\Tomcat 8.0" and its easily recognized in eclipse.
Having installed tomcat with brew the solution for me was:
sudo chmod -R 777 /usr/local/Cellar/tomcat/<your_version>
In my case I used wrong directory, the right one is lib exec and my path:
/usr/local/Cellar/tomcat#7/7.0.96/libexec
You are pointing to the source directory. You can run a build by running ant from that same directory, then add '\output\build' to the end of the installation directory path.
It may be due to the access of the tomcat installation path(C:\Program Files\Apache Software Foundation\Tomcat 9.0) wasn't available with the current user.
Since this is evidently happening on Linux, this would be because your dev user might not have read access to Tomcat's installation directory. That's because Tomcat's installation directory (let's say it is pointed to by CATALINA_HOME) is owned by tomcat:tomcat while your dev user is something that's neither tomcat nor one that belongs to the tomcat group. Therefore Eclipse fails to read ${CATALINA_HOME}/conf/catalina.policy.
The following should fix the permission issue:
sudo find ${CATALINA_HOME} -type d -exec chmod o+rx {} \;
Why do we need the execute bits? Because to traverse a directory and reach its descendants, you need execute permissions. In your case, if CATALINA_HOME isn't yet set, replace the actual installation directory (/opt/tomcat/apache-tomcat-<version> maybe?) in the above.
For Windows
Just open the (tomcat xx.x) folder once and check if you can see all other root folders while selecting folder.
Sometimes windows wont give access to this folder

Deployment to Tomcat using War file resulting in ClassNotFoundException

I am developing a web application and have hit a wall and could use some advice. So the application was written by a coworker who is no longer at our company. They wrote a web application for Apache Tomcat with Java and Javascript in the back end. The application makes use of the JDBC api to interface with a SQL Server database. This person did all the development in Eclipse and running it this way.
I am trying to take this web application and move it to a server. I attempted this by using Eclipse to export a WAR file and then placing this within the Tomcat webapps folder. Then when I started Tomcat the program was extracted. So far so good. The website comes up and works well. However, when I try to access the pages which rely upon database info everything is coming up NULL. I went through the Tomcat logs and found that in the standard out the following message was given:
ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
I had assumed that the WAR file would include all dependencies but I am guessing that probably this is not the case. If anyone is experienced, is this what has happened? If anyone out there is aware, is there a way to tell Eclipse to do this? Otherwise, what is my option? I am not a Java dev and so I would not know how to install JDBC if needed.
Any help is appreciated.
Mike
You can do the following
Go to Microsoft JDBC Driver download page and download the JDBC driver and install it to a location.
Open the .war file using a zip utility like 7-zip or winzip.
Copy the sqljdbc.jar from the sqljdb_4.0/enu directory where you installed the downloaded JDBC driver and paste it in WEB-INF/lib of the extracted war file.
Zip it back as .war file and deploy it again.
This will get the application running.
If you want to fix this permanently, then you should add the stop to include sqljdbc.jar to your WEB-INF/lib while building war file, in your build system, i.e. in build.xml if you are using ANT or in your Maven's pom.xml under dependencies section for this particular dependency.
You don't need to do the "Export WAR > copy to tomcat > start tomcat" manually, you could configure eclipse to do the deploy directly in your tomcat installation, firts double click tomcat server, and then select "Use tomcat installation" in the "Server Locations" section.
Make sure that your application contains the SQLServer JDBC driver (sqljdbc4.jar) in your project WebContent/WEB-INF/lib directory (assuming your coworker used the Eclipse "Dynamic Web Project" for the project layout), if not, download from here, unzip and copy it to the mentioned folder, the next time you start tomcat, it will automatically add it for you.
If the project uses the maven project layout (there is a file named pom.xml in the project root folder), use the following instructions to install the dependency in your local repository (there are some disagreements between Maven and Microsoft about licensing and redistribution of the driver, so there is no repo)

Categories