Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > access a tomcat project builded in eclipse

Reply
Thread Tools

access a tomcat project builded in eclipse

 
 
marcelino
Guest
Posts: n/a
 
      01-26-2004
Hello java-community,

I'm trying to run a servlet in tomcat 4.1.27 developed in eclipse
using the tomcat-plugin from sysdeo version 2.2.1.
If I copy the binary from my eclipse workspace to the
webapps/examples/WEB-INF/classes- directory it runs with this call:

http://localhost:8080/examples/servlet/HelloWorld2


The Location of binaries rendered by eclipse is:

file:/home/myhome/workspace/tctest/WEB-INF/classes

If I try to run the servlet from the eclipse-workspace -after updated
the server.xml- with this call:

http://localhost:8080/tctest/servlet/HelloWorld2
and also
http://localhost:8080/servlet/tctest.HellowWorld2

I see the error 404.
tctest is my eclipse- project HelloWorld2 is part of.
In server.xml I can find the following context-element:

<Context path="/tctest" reloadable="true"
docBase="/home/mbert/workspace/tctest"
workDir="/home/mbert/workspace/tctest/work/org/apache/jsp" />

Maybe there is something wrong in the configuration. So here are some
environment variables

global:
JRE_HOME=/usr/lib/java/jre
PATH=/home/mbert/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
JAVA_BINDIR=/usr/lib/java/bin
JAVA_HOME=/usr/lib/java
SDK_HOME=/usr/lib/java
JDK_HOME=/usr/lib/java
JAVA_ROOT=/usr/lib/java

eclipse:
JRE_HOME=/usr/lib/SunJava-1.4.2/jre
PATH=/home/mbert/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/SunJava-1.4.2/bin
JAVA_BINDIR=/usr/lib/SunJava-1.4.2/bin
JAVA_HOME=/usr/lib/SunJava-1.4.2
SDK_HOME=/usr/lib/SunJava-1.4.2
JDK_HOME=/usr/lib/SunJava-1.4.2
JAVA_ROOT=/usr/lib/SunJava-1.4.2


At the moment I can't figure out the cause of my problem. If somebody
can give me a hint I would appreciate it.

thanks in advance

Marcelino

thanks in advance

martina
 
Reply With Quote
 
 
 
 
Markos Charatzas
Guest
Posts: n/a
 
      01-26-2004
Hi there,

You actually need to modify web.xml inside the WEB-INF directory of your
project to state which class is HelloWorld2.
E.g.
<servlet>
<servlet-name>HelloWorld2</servlet-name>
<servlet-class>[package-name].HelloWorld2</servlet-class>
</servlet>

You can also have an alias in the form of
<servlet-mapping>
<servlet-name>HelloWorld2</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping>

Also make sure that you put the <Context> element withing the
<Host></Host> element in server.xml

Let us know if you have further problems.
Markos Charatzas

marcelino wrote:
> Hello java-community,
>
> I'm trying to run a servlet in tomcat 4.1.27 developed in eclipse
> using the tomcat-plugin from sysdeo version 2.2.1.
> If I copy the binary from my eclipse workspace to the
> webapps/examples/WEB-INF/classes- directory it runs with this call:
>
> http://localhost:8080/examples/servlet/HelloWorld2
>
>
> The Location of binaries rendered by eclipse is:
>
> file:/home/myhome/workspace/tctest/WEB-INF/classes
>
> If I try to run the servlet from the eclipse-workspace -after updated
> the server.xml- with this call:
>
> http://localhost:8080/tctest/servlet/HelloWorld2
> and also
> http://localhost:8080/servlet/tctest.HellowWorld2
>
> I see the error 404.
> tctest is my eclipse- project HelloWorld2 is part of.
> In server.xml I can find the following context-element:
>
> <Context path="/tctest" reloadable="true"
> docBase="/home/mbert/workspace/tctest"
> workDir="/home/mbert/workspace/tctest/work/org/apache/jsp" />
>
> Maybe there is something wrong in the configuration. So here are some
> environment variables
>
> global:
> JRE_HOME=/usr/lib/java/jre
> PATH=/home/mbert/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
> JAVA_BINDIR=/usr/lib/java/bin
> JAVA_HOME=/usr/lib/java
> SDK_HOME=/usr/lib/java
> JDK_HOME=/usr/lib/java
> JAVA_ROOT=/usr/lib/java
>
> eclipse:
> JRE_HOME=/usr/lib/SunJava-1.4.2/jre
> PATH=/home/mbert/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/SunJava-1.4.2/bin
> JAVA_BINDIR=/usr/lib/SunJava-1.4.2/bin
> JAVA_HOME=/usr/lib/SunJava-1.4.2
> SDK_HOME=/usr/lib/SunJava-1.4.2
> JDK_HOME=/usr/lib/SunJava-1.4.2
> JAVA_ROOT=/usr/lib/SunJava-1.4.2
>
>
> At the moment I can't figure out the cause of my problem. If somebody
> can give me a hint I would appreciate it.
>
> thanks in advance
>
> Marcelino
>
> thanks in advance
>
> martina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate WSDL in eclipse using Eclipse Web tools project Veerle Java 0 03-13-2009 02:09 PM
buildr & eclipse => how to convert a eclipse project to buildr ? Stephane Wirtel Ruby 0 07-05-2007 06:33 AM
Is there any other method to run builded Java programs? Dagorlas Java 7 06-16-2006 08:33 AM
Deploying eclipse plugin cleared everything in eclipse - project references in package explorer etc. javaguy44 Java 1 08-18-2004 03:24 PM
Eclipse/Tomcat test environment: Project dependencies/classpath Thomas Java 1 10-18-2003 12:36 PM



Advertisments