unable to link tomee plus using tomcat server adapter in eclipse - java

I am trying link TomEE server in eclipse using already existing tomcat server adaptor but I am getting
The Apache Tomcat installation at this directory is version 8.5.3. A Tomcat 7.0 installation is expected.
so any idea how to change the tomee version?

This is due to a bug in Eclipse:https://bugs.eclipse.org/bugs/attachment.cgi?id=262418&action=edit
You can edit a file in a jar on the server to fool the server into thinking it's 8.0.
See the first answer for a workaround: How to use Tomcat 8.5.x and TomEE 7.x with Eclipse?

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

Related

Tomcat installation and configuration for Eclipse dynamic web project

I have installed Tomcat 9 by using standard way in my Ubuntu 20:
sudo apt install tomcat9 tomcat9-admin
But this installation not defines CATALINA_HOME value.
echo $CATALINA_HOME brings nothing. Why? What is right location for CATALINA_HOME?
Conent of /var/lib/tomcat9 :
conf lib logs policy webapps work
Conent of /etc/tomcat9 :
conf lib logs policy webapps work
My Eclipse JEE Tomcat server runtime environment configuration complains with message
Unknown version of Tomcat was specified.
How to fix that problem?
Don't use an installed copy. The locations of files needed to properly launch Tomcat from Eclipse and actually control the process could have been relocated to who knows where. Download the tar/zip file from tomcat.eclipse.org, and use that instead.
https://wiki.eclipse.org/WTP_Tomcat_FAQ#Why_won.27t_the_New_Server_Runtime_dialog_recognize_my_Linux_installed_version_of_Tomcat.3F
When you install by command
sudo apt install tomcat9 tomcat9-admin
Tomcat become a services inside operating system. Don't use this way in development.
Download Apache Tomcat, unzip, then point to its directory / declare path of Tomcat in Eclipse IDE. Tip: Must check permission some files, allow it read, write inside Tomcat.

Eclipse not recognizing Apache Tomcat on Debian/Linux

I am trying to get an eclipse project to recognize the apache/tomcat(v8.0..) that I have installed, but I am having trouble. The installation is from sudo apt-get install tomcat8, which after a lot of errors I have finally managed to solve. Now I am getting the following after I hook up the tomcat install at /usr/share/tomcat8 to a new project in eclipse.
Description Resource Path Location Type
The container 'Apache Tomcat v8.0 [Apache Tomcat v8.0]' references non existing library '/usr/share/tomcat8/lib/commons-dbcp.jar' helloworld2 Build path Build Path Problem
I'm not sure what the problem could be. There should be no unreferenced libraries as I have installed everything from sudo. I DID have to use this ln -s conf /usr/share/tomcat8/conf to get Eclipse to hook up the library in the first place (as suggested here: Unknown version of Tomcat was specified 8.0.24 / Eclipse 4.4.2 (Luna)). So perhaps that broke it. The road to hello world continues.....
EDIT:
I tried the following:
patientplatypus#next /usr/share/tomcat8/lib $ sudo chmod u+x commons-dbcp.jar
chmod: cannot operate on dangling symlink 'commons-dbcp.jar'
So this appears to be another tomcat8 issue. On installation tomcat8 somehow makes a directory with dangling symlinks to important files. Why it does this or what the fix is, I do not know.
I've not much linux experience, but I use tomcat and eclipse. Eclipse is a mix of java and platform specific binaries, but tomcat is java only (apart from tomcat native which is optional).
If your eclipse supports tomcat8 (I don't remember which version luna supports), you do not need (or even desire) a full server install of tomcat8, you just need to have tomcat package unzipped in any directory you choose, and just point to it.
Which is not the same as installing tomcat8 on your machine and then trying to make it work with eclipse.
My advice is:
Download tomcat8 and unpackage it on a folder.
Create a server runtime with eclipse pointing to that folder.
Develop.
Once you have a war to deploy, you can install tomcat8 on a machine and put your war there and use it.

Running multiple instances of Apache tomcat will not work in my pc

I have two jdks and jres installed in my pc java 1.5 and java 1.8 for some work purpose. Now I have one instance of tomcat 5.5 which I took from another pc and pasted it in my pc c:/servers folder. It is running fine using java 1.5. So I set the JAVA_HOME and path to java 1.5. Now I downloaded tomcat 7 binary distribution zip file and extracted it in my c:/servers directory. I changed the connector port, shutdown port and AJP port to different values. set CATALINA_BASE to c:/servers directory. But when I'm running the startup.bat two windows are popping up for a sec and they are closing. The server is not starting. I found the error as java.lang.UnsupportedClassVersionError. Bad version number in class file
Then I tried to install tomcat 8 using windows installer with again different port numbers in the same c:/servers directory which worked perfectly. It started and tomcat home screen also loaded. My work is survived with tomcat installer but I want to know why manual configuration failed.
OS = windows 10 64 bit
Please help me in making manual configuration of tomcat. If any other information is needed, I'll provide.
EDIT 1
I got this error java.lang.InvocationTargetException when I tried to install another instance of tomcat 5.5 manually in c:/servers directory
The exception UnsupportedClassVersionError occurs when you try to execute *.class files with an older version of Java as they were compiled for.
In your case, you are trying to run Tomcat 7 with Java 1.5, but its minimum requirement for the JRE is version 1.6. The latest version of Tomcat that supports Java 1.5 is Tomcat 6. Check out this overview for more information:
Apache Tomcat Versions

tomcat wont start up on linux machine

I'm new to Linux but having spent a whole day I Installed Java and Tomcat. My goal is to host an App with this Linux box. I know it all works fine from my windows based machine, but it is my laptop so I'm planning to use the Linux Box as my dedicated server.
Following many many forums I've now got Tomcat 7 installed. However i cannot get it to start.
Changing to the tomcat directory and "./startup.sh" i get the following output:
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: usr/lib/jvm/java-6-sun/
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
That's the end of the output.
However localhost:8080 is not up, and in the tomcat log file is the error "eval: 1: usr/lib/jvm/java-6-sun//bin/java: not found"
Hopefully there is some expert here who can help me with this problem. Please note that I'm a novice when it comes to Linux.
PS: My Linux version is Ubuntu 10.04 LTS - the Lucid Lynx
JRE_HOME is missing a / at the start of it.
Your CATALINA_HOME and CLASSPATH also looks wrong, with a local.tomcat instead of a local/tomcat and c\tomcat-juli instead of tomcat-juli
Try typing this on the command line:
$ export CATALINA_HOME=/usr/local/tomcat
$ export JRE_HOME=/usr/lib/jvm/java-6-sun
$ /usr/local/tomcat/bin/catalina.sh run
This will run Tomcat in the terminal you have open, so you can watch it do stuff. Press CTRL+C to quit it.
First download the Linux tomcat version.
Unzip it.
Go to the tomcat bin folder.
Run the startup.sh for start the tomcat server
Shutdown.sh for using to stop the tomcat
see the link,
http://brigitzblog.blogspot.com/2011/11/linux-how-can-i-startstop-tomcat-server.html
I'm just posting in case this will help someone else. I had my JAVA_HOME set to
/usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
I should have been
/usr/lib/jvm/java-7-openjdk-i386/jre
without the /bin/java part at the end. This is because will look for bin/java in that path already and you don't need to specify it.
When I encountered something similar, the problems was with my Tomcat7 installation. I downgraded to Tomcat6 and it started working perfectly.

Tomcat 6.0.18 service will not start on a windows server

I installed Tomcat 6.0.18 on a windows server 2003 box and it will not start as a service.
I'm running it with jdk 1.6.0_07.
It runs when I start it with tomcat6.exe.
I got a vague error in the System Event Log on Windows.
The Apache Tomcat 6 service terminated with service-specific error 0 (0x0).
I'll bite it :-)
Tomcat Service on windows is dependent on the MS C Runtime library msvcr71.dll. As long as it is in the path, the service will start just fine.
Just to prevent your other windows to be forced to use this version of the runtime library, you might want to copy the DLL to just the tomcat bin path instead of windows\system32.
From gobaco.wordpress.com
Tomcat 6 couldn’t find a file called msvcr71.dll.
I just copied it over from
c:\windows\microsoft.net\framework\v1.1.4322
to
c:\windows\system32
and was able to start tomcat.
I thought this was very strange, so I wanted to post it on SO in case anyone else runs into this problem. If someone wants to post the same answer I'll accept it.
i follow the above guide but still the same, error 0,
my process monitor log at http://www.sendspace.com/file/t0tahr
I solved the same problem enabling the default java virtual machine in the configuration app.
Assuming you have installed tomcat using:
service install tomcat-6.0.35
execute:
tomcat6w //ES/tomcat-6.0.35
a window pops up, select the java tab and click on "Use default" checkbox.
The service install script (I immagine) selected C:\Program Files(x86)\Java\jre\bin\client\jvm.dll instead.
Environment:
Windows Server standard SP2 64-bin
Java 1.6.0_23-b05 (Java hotspot 64-bit server vm 19.0-b09 mixed mode)
Apache tomcat 6.35 (you guessed this didn't you?)
I copied the msvcr71.dll from the java home directory to the bin directory of the apache-tomcat install, and the service started after that.
Even though it's an older post, I thought I'd share the knowledge about the very same issue I had, but the workaround was different.
The Apache Tomcat 7 service terminated with service-specific error 0 (0x0).
As there was no more information regarding the problem I went back to the Tomcat Control Panel and had a look at the Java path, which was pointed to an earlier installation of Java Virtual Machine:
C:\Program Files\Java\jre6\bin\client\jvm.dll, which no longer existed, so I had to change the JRE version to jre7.
Having done that, the service started up and all running now.
Hope it'll help some of you out there.

Categories

Resources