473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how do i configure tomcat5.5

44
hi folks,
i installed tomcat 5.5... and there was already jdk 1.5.0.02 was installed. i cofigure the path JAVA_HOME and CLASSPATH corectly but i'm not able to compile servlet. do i need to add ne file in jdk folder... please help me configuring the tomcat ....please dont tell me to read the documentation coz frm last one week i'm just reading that and googling but i'm fail. i can run html and jsp file but servlet is not compiling.
Sep 5 '07 #1
9 4939
r035198x
13,262 8TB
hi folks,
i installed tomcat 5.5... and there was already jdk 1.5.0.02 was installed. i cofigure the path JAVA_HOME and CLASSPATH corectly but i'm not able to compile servlet. do i need to add ne file in jdk folder... please help me configuring the tomcat ....please dont tell me to read the documentation coz frm last one week i'm just reading that and googling but i'm fail. i can run html and jsp file but servlet is not compiling.
What kind of erorrs are you getting when compiling the servlet?
Sep 5 '07 #2
Nepomuk
3,112 Expert 2GB
hi folks,
i installed tomcat 5.5... and there was already jdk 1.5.0.02 was installed. i cofigure the path JAVA_HOME and CLASSPATH corectly but i'm not able to compile servlet. do i need to add ne file in jdk folder... please help me configuring the tomcat ....please dont tell me to read the documentation coz frm last one week i'm just reading that and googling but i'm fail. i can run html and jsp file but servlet is not compiling.
You can call the page http://localhost:8080/ correctly, can't you? If you can, there's something wrong with how you connect your Servlet to Tomcat. If not, there's something wrong in the configuration of Tomcat itself.

As r035198x asked, what error messages does Tomcat give?

Greetings,
Nepomuk
Sep 5 '07 #3
misaw
17
hi folks,
i installed tomcat 5.5... and there was already jdk 1.5.0.02 was installed. i cofigure the path JAVA_HOME and CLASSPATH corectly but i'm not able to compile servlet. do i need to add ne file in jdk folder... please help me configuring the tomcat ....please dont tell me to read the documentation coz frm last one week i'm just reading that and googling but i'm fail. i can run html and jsp file but servlet is not compiling.
A servlet entry is required in web.xml file of your web application folder
For example i have an application deployed on tomcat as MyApp
/MyApp
/WEB-INF
web.xml


OR you have to uncomment the invoker servlet entry and its mapping from web.xml file found in
<YOUR TAOMCAT FOLDER>/ conf/ web.xml

i think its solved ur problem
Sep 5 '07 #4
mak1084
44
A servlet entry is required in web.xml file of your web application folder
For example i have an application deployed on tomcat as MyApp
/MyApp
/WEB-INF
web.xml


OR you have to uncomment the invoker servlet entry and its mapping from web.xml file found in
<YOUR TAOMCAT FOLDER>/ conf/ web.xml

i think its solved ur problem
can you please elaborate i dint get wht you want to say.
in which statement or exactly where i have to uncomment the invoker?
Sep 5 '07 #5
first make sure you have this

JAVA_HOME=java installation directory path
CATALINA_HOME=tomcat installation directory path.

while compiling servlets you have to set the path
for example ,if your tomcat is installed in c:\program files\tomcat 5.5 then

set the path as

set path=c:\tomcat 5.5\common\lib\servlet-api.jar;%classpath%
then compile the servlet.

make sure you are following the directory structure of servlets.


with regards,
shailesh
Sep 6 '07 #6
misaw
17
can you please elaborate i dint get wht you want to say.
in which statement or exactly where i have to uncomment the invoker?
There are two ways to use a servlet in Tomcat

1) Entry in your application web.xml file see this
http://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.html?page=4

2) Uncomment the invoker servlet, see this
http://weblog.dangertree.net/category/servlets/

make sure you correctly compile and place the servlet before doing all this.
Sep 6 '07 #7
mak1084
44
i changed the codes now other codes are commented (except one which is very big)

Expand|Select|Wrap|Line Numbers
  1.     <servlet>
  2.         <servlet-name>default</servlet-name>
  3.         <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
  4.         <init-param>
  5.             <param-name>debug</param-name>
  6.             <param-value>0</param-value>
  7.         </init-param>
  8.         <init-param>
  9.             <param-name>listings</param-name>
  10.             <param-value>true</param-value>
  11.         </init-param>
  12.         <load-on-startup>1</load-on-startup>
  13.     </servlet>
  14.  
  15.     <servlet>
  16.         <servlet-name>invoker</servlet-name>
  17.         <servlet-class>
  18.           org.apache.catalina.servlets.InvokerServlet
  19.         </servlet-class>
  20.         <init-param>
  21.             <param-name>debug</param-name>
  22.             <param-value>0</param-value>
  23.         </init-param>
  24.         <load-on-startup>2</load-on-startup>
  25.     </servlet>
  26.  
  27.     <servlet>
  28.         <servlet-name>jsp</servlet-name>
  29.         <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
  30.         <init-param>
  31.             <param-name>fork</param-name>
  32.             <param-value>false</param-value>
  33.         </init-param>
  34.         <init-param>
  35.             <param-name>xpoweredBy</param-name>
  36.             <param-value>false</param-value>
  37.         </init-param>
  38.         <load-on-startup>3</load-on-startup>
  39.     </servlet>
  40.  
  41.  
  42.  
  43.     <!-- The mapping for the default servlet -->
  44.     <servlet-mapping>
  45.         <servlet-name>default</servlet-name>
  46.         <url-pattern>/</url-pattern>
  47.     </servlet-mapping>
  48.  
  49.     <!-- The mapping for the invoker servlet -->
  50.  
  51.     <servlet-mapping>
  52.         <servlet-name>invoker</servlet-name>
  53.         <url-pattern>/servlet/*</url-pattern>
  54.     </servlet-mapping>
  55.  
  56.  
  57.     <!-- The mapping for the JSP servlet -->
  58.     <servlet-mapping>
  59.         <servlet-name>jsp</servlet-name>
  60.         <url-pattern>*.jsp</url-pattern>
  61.     </servlet-mapping>
  62.  
  63.     <servlet-mapping>
  64.         <servlet-name>jsp</servlet-name>
  65.         <url-pattern>*.jspx</url-pattern>
  66.     </servlet-mapping>
  67.  
  68.  
  69.   <!-- ==================== Default Session Configuration ================= -->
  70.   <!-- You can set the default session timeout (in minutes) for all newly   -->
  71.   <!-- created sessions by modifying the value below.                       -->
  72.  
  73.     <session-config>
  74.         <session-timeout>30</session-timeout>
  75.     </session-config>
  76.  
  77.  
  78.     <welcome-file-list>
  79.         <welcome-file>index.html</welcome-file>
  80.         <welcome-file>index.htm</welcome-file>
  81.         <welcome-file>index.jsp</welcome-file>
  82.     </welcome-file-list>
  83.  
  84. </web-app>
  85.  
after these i'm able to get my .class file but i'm not able to run servlet in browser html and jsp are running fine.
in this folder i have kept my jsp and html file
Expand|Select|Wrap|Line Numbers
  1. G:\Tomcat 5.5\webapps\ROOT\Hjsp
and here servlet .class file
Expand|Select|Wrap|Line Numbers
  1. G:\Tomcat 5.5\webapps\ROOT\WEB-INF\classes
do i need to do ne thing else???? please help.
Sep 6 '07 #8
mak1084
44
please post the solution.
Sep 6 '07 #9
misaw
17
please post the solution.
Correct solution will not be post until and unless we correctly identify the root cause or error detail as asked by r035198x

the suggestion are made only on experiences we have

how u r accessing ur servlet thru browser ?????

http://localhost:8080/servlet/com.mypackage.HelloWorldExample

breaking URL as:
localhost = use ur server name if other than localhost
8080 = use ur port number if other than 8080
servlet as is since you have no web app name using ROOT
com.mypackage.HelloWorldExample = servlet name with packagename if any for example com.mypackage
Sep 11 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Martin | last post by:
I 've wrtien a simple jsp in Tomcat 5.0.16, but get error: "org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar...
0
by: Markus Wollny | last post by:
Hello! When I try to run ./configure --with-java, it complains that ant doesn't work. However ant is installed, as is the latest Java SDK 1.4.2 from sun, PATH and JAVA_HOME are set correctly; ...
0
by: Samuel M. Smith | last post by:
I am trying to build python2.4.2 on an arm 9 running Debian 3 Sarge when I run ./configure it fails with ../configure checking MACHDEP... linux2 checking EXTRAPLATDIR... checking for...
1
by: Markus Wollny | last post by:
Hi! I am trying to build PostgreSQL 7.4.3 with Java enabled; I've got Apache Ant version 1.5 and j2sdk1.4.1_05 installed: Verifiying ant: # which javac /usr/java/j2sdk1.4.1_05/bin/javac #...
0
by: Satish S Nandihalli | last post by:
following errors were found on executing configure file: 1) configure: WARNING: thread.h: present but cannot be compiled configure: WARNING: thread.h: check for missing prerequisite headers?...
0
by: Chen Yang | last post by:
Hi all, I have been working on this problem for two days, any suggestion would be very appreciated. I am installing Tomcat5 on CentOS 4.2 with the following instructions:...
0
by: Geethu03 | last post by:
Hi I am working with the Tomcat5.0 web apllication with JSP. Now i want to use the PHP programs so i want to confiure the PHP in my Tomcat5.0 version. I download the PHP5.2.3 windows version...
3
by: kodaliece | last post by:
Hello Everyone, I am trying to configure Tomcat5.5 to run PHP5.2.5 scripts on linux machine. I got some information from http://wiki.apache.org/tomcat/UsingPhp as how to do this. First, It says...
1
by: aradhanathawait | last post by:
Hi all Please tell me the default Login Id and password for Tomcat5.0 Admin. I have installed tomcat5 on Red hat linux 4, it didn't ask for admin password during installlation. Thanx and...
1
by: aradhanathawait | last post by:
hiii Please tell me the proceure to install tomcat5 in RHEL5.0 . I m a novice to Linux please help Regards, Aradhana
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.