在Ubuntu 11.04上的Tomcat6 Eclipse3.5无法协同工作

时间:2022-11-29 14:12:39

I am using eclipse3.5 and tomcat6 on Ubuntu 11.04. I am trying to create Dynamic and website project (JSP) on Tomcat6 server but every time its giving me http 404 error (resources not found). I have created a new tomcat6 server and included the project in it, but when I run this project I am coming up with 404(http://localhost:8080/projectname/). I followed every possible solution available on line. Changing the Catalina variable, installing and reinstalling tomcat6 manually, changing workspace and creating symbolic links and changing the permissions on file according to one of the thread Ubuntu Forums link

我在Ubuntu 11.04上使用eclipse3.5和tomcat6。我试图在Tomcat6服务器上创建动态和网站项目(JSP),但每次它给我http 404错误(资源未找到)。我创建了一个新的tomcat6服务器并将项目包含在其中,但是当我运行这个项目时,我想出404(http:// localhost:8080 / projectname /)。我遵循了在线提供的每种可能的解决方案更改Catalina变量,手动安装和重新安装tomcat6,更改工作空间并创建符号链接并根据其中一个线程Ubuntu论坛链接更改文件权限

Still no result....... I have given many hours to this only to get zero and frustrating results.

仍然没有结果.......我已经花了很多时间才得到零和令人沮丧的结果。

Any help would be greatly appreciated.

任何帮助将不胜感激。

1 个解决方案

#1


0  

When it come to setup Eclipse, Tomcat and Java there are many things that can go wrong. In this case Ubuntu 11.04 is providing Eclipse 3.5 (Galileo) and Tomcat6 as standard edition through Software Center or Synaptic pkg. or Aptitude. Therefor I was installing Eclipse and Tomcat as they were provided on Ubuntu standard repo. For some reason the Environment variables on Ubuntu were not setting properly so I tried and fixed the variable by placing those variable in system bash file and assigning them values manually:

在设置Eclipse,Tomcat和Java时,有很多可能出错的地方。在这种情况下,Ubuntu 11.04通过Software Center或Synaptic pkg提供Eclipse 3.5(Galileo)和Tomcat6作为标准版本。或能力。因此我安装了Eclipse和Tomcat,因为它们是在Ubuntu标准repo上提供的。由于某种原因,Ubuntu上的环境变量没有正确设置,所以我尝试通过将这些变量放在系统bash文件中并手动分配它们来修复变量:

vi ~/.bashrc

Using CATALINA_BASE: /usr/local/tomcat-6 dir

使用CATALINA_BASE:/ usr / local / tomcat-6目录

Using CATALINA_HOME: /usr/local/tomcat-6 dir

使用CATALINA_HOME:/ usr / local / tomcat-6目录

Using JRE_HOME: /usr/lib/j2sdk1.6-sun/

使用JRE_HOME:/usr/lib/j2sdk1.6-sun/

this is one way to do it or you can export these variable like in cmd line:

这是一种方法,或者您可以像在cmd行中一样导出这些变量:

in bash: export JAVA_HOME=/path_to_j2sdk

在bash中:export JAVA_HOME = / path_to_j2sdk

(e.g. export JAVA_HOME=/usr/local/java/j2sdk similarly for Catalina variable's)

(例如,类似地为Catalina变量导出JAVA_HOME = / usr / local / java / j2sdk)

In My case above solution was not working even though I invested couple of days it. I decided to purge (remove completely) the existing Tomcat6 and Eclispe3.5 and then installed I followed AskUbuntu and did same with Eclipse3.6.

在我的情况下,上面的解决方案没有工作,即使我投入了几天。我决定清除(完全删除)现有的Tomcat6和Eclispe3.5,然后安装我跟着AskUbuntu,并对Eclipse3.6做了同样的事情。

  1. Download Eclipse3.6 from eclipse.org remember to download J2EE not JAVA for JSP.

    从eclipse.org下载Eclipse3.6,记得下载J2EE而不是JAVA for JSP。

  2. tar -xzvf filename.tar.gz

    tar -xzvf filename.tar.gz

  3. I placed Tomcat7 and eclipse in the same folder /usr/local/java

    我把Tomcat7和eclipse放在同一个文件夹/ usr / local / java中

    sudo mv Directory_Name(Extracted eg.eclipse /usr/local/java)

    sudo mv Directory_Name(提取eg.eclipse / usr / local / java)

4.Check for ROOT Folder in org.eclipse.wst.server.core, Make sure that you replace (or rm -rf old ROOT then cp the new ROOT folder) this ROOT folder created by tomcat6 with new ROOT from tomcat7 because some time ubuntu11.04 do not replace this file by itself and this error will take lot of time to solve so follow these cmd in terminal make sure that you are sudo:

4.检查org.eclipse.wst.server.core中的ROOT文件夹,确保用tomcat7中的新ROOT替换(或rm -rf旧ROOT然后cp新ROOT文件夹)这个ROOT文件夹,因为有些时间ubuntu11.04不要自己替换这个文件,这个错误会花费很多时间来解决,所以在终端中按照这些cmd确保你是sudo:

/home/local/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ROOT

with /usr/local/java/apache-tomcat-7.0.22-src/webapps/ROOT

From here you can simply click on "eclipse" executable file in /usr/local/java/eclipse and follow this link it is based on Tomcat5.5 but tomcat7 server setup in eclipse3.6 is exactly similar to this.

从这里你可以简单地点击/ usr / local / java / eclipse中的“eclipse”可执行文件,并按照此链接它基于Tomcat5.5,但eclipse3.6中的tomcat7服务器设置与此完全相似。

Leave your comments and questions.

留下您的意见和问题。

#1


0  

When it come to setup Eclipse, Tomcat and Java there are many things that can go wrong. In this case Ubuntu 11.04 is providing Eclipse 3.5 (Galileo) and Tomcat6 as standard edition through Software Center or Synaptic pkg. or Aptitude. Therefor I was installing Eclipse and Tomcat as they were provided on Ubuntu standard repo. For some reason the Environment variables on Ubuntu were not setting properly so I tried and fixed the variable by placing those variable in system bash file and assigning them values manually:

在设置Eclipse,Tomcat和Java时,有很多可能出错的地方。在这种情况下,Ubuntu 11.04通过Software Center或Synaptic pkg提供Eclipse 3.5(Galileo)和Tomcat6作为标准版本。或能力。因此我安装了Eclipse和Tomcat,因为它们是在Ubuntu标准repo上提供的。由于某种原因,Ubuntu上的环境变量没有正确设置,所以我尝试通过将这些变量放在系统bash文件中并手动分配它们来修复变量:

vi ~/.bashrc

Using CATALINA_BASE: /usr/local/tomcat-6 dir

使用CATALINA_BASE:/ usr / local / tomcat-6目录

Using CATALINA_HOME: /usr/local/tomcat-6 dir

使用CATALINA_HOME:/ usr / local / tomcat-6目录

Using JRE_HOME: /usr/lib/j2sdk1.6-sun/

使用JRE_HOME:/usr/lib/j2sdk1.6-sun/

this is one way to do it or you can export these variable like in cmd line:

这是一种方法,或者您可以像在cmd行中一样导出这些变量:

in bash: export JAVA_HOME=/path_to_j2sdk

在bash中:export JAVA_HOME = / path_to_j2sdk

(e.g. export JAVA_HOME=/usr/local/java/j2sdk similarly for Catalina variable's)

(例如,类似地为Catalina变量导出JAVA_HOME = / usr / local / java / j2sdk)

In My case above solution was not working even though I invested couple of days it. I decided to purge (remove completely) the existing Tomcat6 and Eclispe3.5 and then installed I followed AskUbuntu and did same with Eclipse3.6.

在我的情况下,上面的解决方案没有工作,即使我投入了几天。我决定清除(完全删除)现有的Tomcat6和Eclispe3.5,然后安装我跟着AskUbuntu,并对Eclipse3.6做了同样的事情。

  1. Download Eclipse3.6 from eclipse.org remember to download J2EE not JAVA for JSP.

    从eclipse.org下载Eclipse3.6,记得下载J2EE而不是JAVA for JSP。

  2. tar -xzvf filename.tar.gz

    tar -xzvf filename.tar.gz

  3. I placed Tomcat7 and eclipse in the same folder /usr/local/java

    我把Tomcat7和eclipse放在同一个文件夹/ usr / local / java中

    sudo mv Directory_Name(Extracted eg.eclipse /usr/local/java)

    sudo mv Directory_Name(提取eg.eclipse / usr / local / java)

4.Check for ROOT Folder in org.eclipse.wst.server.core, Make sure that you replace (or rm -rf old ROOT then cp the new ROOT folder) this ROOT folder created by tomcat6 with new ROOT from tomcat7 because some time ubuntu11.04 do not replace this file by itself and this error will take lot of time to solve so follow these cmd in terminal make sure that you are sudo:

4.检查org.eclipse.wst.server.core中的ROOT文件夹,确保用tomcat7中的新ROOT替换(或rm -rf旧ROOT然后cp新ROOT文件夹)这个ROOT文件夹,因为有些时间ubuntu11.04不要自己替换这个文件,这个错误会花费很多时间来解决,所以在终端中按照这些cmd确保你是sudo:

/home/local/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ROOT

with /usr/local/java/apache-tomcat-7.0.22-src/webapps/ROOT

From here you can simply click on "eclipse" executable file in /usr/local/java/eclipse and follow this link it is based on Tomcat5.5 but tomcat7 server setup in eclipse3.6 is exactly similar to this.

从这里你可以简单地点击/ usr / local / java / eclipse中的“eclipse”可执行文件,并按照此链接它基于Tomcat5.5,但eclipse3.6中的tomcat7服务器设置与此完全相似。

Leave your comments and questions.

留下您的意见和问题。