Tomcat 6 server creation using eclipse IDE on ubuntu
Asked Answered
U

17

57

I'm having a problem running tomcat 6 with eclipse 3 in ubuntu.

I installed tomcat 6 on my machine and when I tested it using http://localhost:8080, it worked fine.

But whenever i want to create a server in eclipse, i select Tomcat 6 , i get the following message "Cannot create a server using the selected type", and i can't click next.

Any idea why?

University answered 15/1, 2009 at 15:52 Comment(2)
After adding and removing tomcat6 to eclipse this problem occuringChau
Please look into this similar thread #8026341Foretop
A
88

There’s a better workaround so you can keep Ubuntu’s Tomcat6 (taken from http://ubuntuforums.org/showthread.php?p=8541057, by DisDis)

In a terminal:

sudo apt-get install tomcat6
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf

There. Now just go to Window/Preferences/Sever/Runtime Environments, add the Apache Tomcat6 Server and use /usr/share/tomcat6 as the installation directory!

Antebellum answered 16/1, 2010 at 13:59 Comment(7)
Very useful for all Ubuntu-ers! This should be carved in stone. Either way, it is necessary to remove the old Tomcat configuration from Runtime Environments, just like Silviu wrotes.Vanhouten
This worked for me - and I didn't have to remove my old Tomcat configuration which was set to /usr/share/tomcat6.Crossbred
Perfect. Don't look anywhere else. This is all you want!Satsuma
Works on Mint as well out of the boxFowlkes
why isn't this response marked as the answer?? it worked like a charmHandyman
Remove the servers (in eclipse) and create them newly in case if this doesn't work.Bovine
Works with tomcat7 the same way, as it does with tomact6, thank you.Laevo
N
43

ok, so here's what worked for me: you must go to Window>Preferences

here, go to Server>Runtime Environments

remove the old server or add your server or change the server location...

(in my case, this problem arised when i changed the tomcat server location)

now you should be able to add new servers to your environment :)

Neighborly answered 25/1, 2009 at 21:36 Comment(2)
It was happen same to me. As Silvio wrote, removing old and adding new server in the "Runtime Environments" does the trick.Vanhouten
The problem occurred for me when I moved my workspace to a different machine. Removing and adding the server in the "Runtime Environments" window fixed it.Sixth
B
8

Have you been using the ubuntu-tomcat version (e.g. "aptitude install tomcat6")? If so, please download a plain vanilla version from tomcat.apache.org and use this. The Debian/Ubuntu version relocates some jars around and eclipse expects the "pure" version and jar locations.

(Also: see Eclipse bug 239179)

Buttonwood answered 24/1, 2009 at 9:59 Comment(5)
The link appears to be brokenSatsuma
sorry for that. As this post is quite old I can't recall if it was valuable extra information or just a reinforcement of what I stated. I'll leave it in for now, in case the site comes back up, and maybe delete it later. The first paragraph still is accurate IMHOButtonwood
@Tathagata: A little googling and I've found the current link for that bugFirstling
see the answer using tomcat6-user; it's much simpler!Taboo
I'd hope that we'd have a simpler solution ~ 3.5 years after the original question ;)Buttonwood
O
6

Remove (or edit the apache tomcat v6.0 entry in) workspace.metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jst.server.tomcat.core.prefs

I think you also need to restart

Outspan answered 22/3, 2009 at 11:22 Comment(0)
E
6

I wrote a patch for solving this problem and it has been merged in Ubuntu and Debian. Now its possible to configure tomcat6 inside Eclipse without any pains.

In Ubuntu 11.04 you can install tomcat6-user package. Then configure a user instance of tomcat6 by running this command

$tomcat6-instance-create ~/my-tomcat-dir

A user instance of tomcat6 will be configured in ~/my-tomcat-dir directory.

Now to add tomcat6 inside eclipse to setup your development environment, simply point eclipse towards this directory and you will be ready to go.

If you are running an older version of Ubuntu, then you can simply download the latest version of tomcat6-user package from the Debian FTP: http://packages.debian.org/hu/sid/all/tomcat6-user/download

Edify answered 10/4, 2011 at 20:44 Comment(2)
Brilliant! As always, when starting a development server, it needs to have its own port. For me this means I need to stop the system tomcat manually, because it's started during bootup when installed from a Debian package.Photosensitive
Yes, it is a much easier way to work with Tomcat during development. Also useful for where you don't have the control over the server and need to ask the admin to set up the server.Edify
A
4

I had the same problem, but with tomcat 5.5. Changing the permissions on the /etc/tomcat5.5/conf (symlink from /usr/share/tomcat5.5/conf) worked. Thanks!

Avar answered 11/4, 2009 at 17:18 Comment(0)
R
3

I was suffering the same problem

I've got the lattest eclipse 3.4.1 GanyMede. Changed the Ubuntu Tomcat 6 install to the plain one from tomcat.apache.org

chmod 666 /usr/share/tomcat6/conf*

and the problem was solved

Raffaello answered 20/2, 2009 at 15:18 Comment(0)
H
3

I had the same problem but thanks to all your feedback I got it fixed. In summary...

I have Ubuntu 9.04, Eclipse Galileo (java EE developers platform 3.5.1).

I installed Tomcat as follows:

sudo tar zxvf apache-tomcat-6.0.20.tar.gz

sudo cp -R apache-tomcat-6.0.20 /usr/share/tomcat6

as explained at: http://www.ubuntugeek.com/tomcat-6-installation-on-ubuntu-feisty.html

Then I change permissions to the conf folder /usr/share/tomcat6/conf$ sudo chmod a+rw *

I removed it from Windows->Preferences->Server->Runtime Environment (but I don't think this step was necessary after all)

Voila!

Higgle answered 31/10, 2009 at 6:32 Comment(0)
F
3

Go to window > preferences -- Go to runtime environments --- you will probably find the location of the old install of Tomcat. Changing it to the current location will help.

Fatling answered 15/2, 2010 at 20:33 Comment(0)
M
2

Not sure, but maybe your version of Eclipse does not support the latest Tomcat version? Try to update Eclipse. I have Eclipse 3.4 and there's no problem.

Maupin answered 15/1, 2009 at 15:59 Comment(0)
P
2

If you can test it with http://localhost:8080 then the server is already running, and there's nothing for Eclipse to create. try closing down the server, and then setting up eclipse to point to the installation directory.

Pantheism answered 15/1, 2009 at 16:35 Comment(0)
M
2

I you have the newer version of eclipse, try to update the Web Tool Plateform plugins in Help/software Updates... If both eclipse and WTP are up to date I don't see were the problem can be...

PS : there is a "comment" button, do not post an answer to comment an answer ;)

Maupin answered 16/1, 2009 at 8:57 Comment(0)
S
2

I have been having the same problem (on fedora 9). You have to change the permissions of the files inside the tomcat conf directory to rw (chmod a+rw tomcat6/conf/*). Solved it for me!

Submariner answered 11/2, 2009 at 14:50 Comment(1)
This worked for me on Ubuntu with a download of tomcat from apache (not the apt-get one)... ThanksFoote
P
2

This one is working for me too Window -> Options -> Server -> Runtime Environments

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

Pantalets answered 21/3, 2009 at 16:54 Comment(0)
S
2

You have to symlink various folders that are scattered across the file system to the desired tomcat6 main (or installation) folder.

tsaid suggested symlinking to /usr/share/tomcat6, I rather use /var/lib/tomcat6.

My /var/lib/tomcat6 directory (see the symlinks I've made):

$ ls -g -o /var/lib/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:15 bin -> /usr/share/tomcat6/bin
drwxr-xr-x 3 4096 2010-07-20 12:22 common
lrwxrwxrwx 1   12 2010-07-20 12:22 conf -> /etc/tomcat6
lrwxrwxrwx 1   22 2010-07-20 18:14 lib -> /usr/share/tomcat6/lib
lrwxrwxrwx 1   17 2010-07-20 12:22 logs -> ../../log/tomcat6
drwxr-xr-x 3 4096 2010-07-20 12:22 server
drwxr-xr-x 3 4096 2010-07-20 12:22 shared
drwxrwxr-x 3 4096 2010-07-20 12:22 webapps
lrwxrwxrwx 1   19 2010-07-20 12:22 work -> ../../cache/tomcat6

Also, don't forget to give full rw permission to your configuration files, in my case in /etc/tomcat6. Since you'll also need to symlink catalina.policy from Catalina/localhost/catalina.policy, don't forget giving execute permission to those folders. You can simplify with full permission to the conf folder, but it's only advised if you're the only user of the computer.

cd /var/lib/tomcat6/conf
chmod -R a+xrw *

Now, delete the entry in Eclipse under Window -> Preferences -> Server -> Runtime Environment and add a new server through Run on Server or anywhere else.

Synonymous answered 21/7, 2010 at 14:24 Comment(0)
C
1

Window -> Options -> Server -> Runtime Environments

Edit the existing runtime environment "Apache Tomcat v6.0" and select your tomcat's location.

Calamine answered 1/2, 2009 at 14:47 Comment(0)
A
0

I had the same problem, i use ubuntu 9.04 and tomcat 6.

I installed the tomcat 6 for apt-get, installed also jre, jdk. (SUN)

In order to resolve the problem do:

  • Close the Eclipse;
  • Delete your workspace (save your files);
  • stop the tomcat6 (/etc/init.d/tomcat6 stop)
  • make a link to conf (ln -s /var/lib/tomcat6/conf /usr/share/tomcat6);
  • ln -s /var/lib/tomcat6/catalina.policy /etc/tomcat6/
  • init the eclipse
  • In server tomcat configuration (/usr/share/tomcat6)
Atahualpa answered 3/3, 2010 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.