File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to test Java Servlets ! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to test Java Servlets !" Watch "How to test Java Servlets !" New topic
Author

How to test Java Servlets !

SrinivasaRao Sanagapalli
Greenhorn

Joined: Dec 11, 2001
Posts: 10
Hi,
I have question of which software I need to download inorder to test simple Java Servlets. I go to the Java site it is saying I need to install J2EE. But after all loading it is like GUI interface there we need to go so many steps inorder to run a simple Servlet. How can I test servlets other than using J2EE !
Greatly appreicate the reply.
Thanks
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
just download tomcat the free web server that supports servlets. that with a regular J2SE is enough.
http://jakarta.apache.org
SrinivasaRao Sanagapalli
Greenhorn

Joined: Dec 11, 2001
Posts: 10
Thanks for your early reply.
Can you explain me how to procedure. I mean what all I need to do for eg. classpath, path and how to run.
Thanks a lot
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
Hi.
Follow this
cheers


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
SrinivasaRao Sanagapalli
Greenhorn

Joined: Dec 11, 2001
Posts: 10
Andres,
I downloaded and configured the server as per the link which u sent. I do have some problems while starting up the server. Here I am giving the errors, pls look into that and help me if you can. I would greatly appreciate it.
C:\Tomcat403\bin>startup
Using CATALINA_BASE: C:\Tomcat403
Using CATALINA_HOME: C:\Tomcat403
Using CATALINA_TMPDIR: C:\Tomcat403\temp
Using JAVA_HOME: C:\j2sdk14
C:\Tomcat403\bin>
In the other window:
Catalina.start: LifecycleException: null.open: java.net.BindException: Address
already in use: JVM_Bind:80
LifecycleException: null.open: java.net.BindException: Address already in use:
JVM_Bind:80
at org.apache.catalina.connector.http.HttpConnector.initialize(HttpConne
ctor.java:1130)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:553)
at org.apache.catalina.startup.Catalina.start(Catalina.java:780)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
----- Root Cause -----
java.net.BindException: Address already in use: JVM_Bind:80
at org.apache.catalina.connector.http.HttpConnector.open(HttpConnector.j
ava:950)
at org.apache.catalina.connector.http.HttpConnector.initialize(HttpConne
ctor.java:1128)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:553)
at org.apache.catalina.startup.Catalina.start(Catalina.java:780)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
I couldn't understand why it is coming like this.
Thanks
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
If you're having problems with Tomcat (which it would appear that you are), you'd probably get a better response in the Apache/Tomcat forum.
Corey


SCJP Tipline, etc.
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
You get this error because it is already running as a service on the back ground. So, go to services window and swicth Tomcat to run on manual mode.
SrinivasaRao Sanagapalli
Greenhorn

Joined: Dec 11, 2001
Posts: 10
Hi,
I think the problem is with the port number. I had Oracle in my machine. When I used the http://localhost:8080 some oracle related stuff is coming up. I think the 80 port is using Oracle. How to use the other and how can I choose and if I choose one how to call the servlets like instead of http://localhost:8080 we need to use other alternative.
Appreciate the reply
Thanks
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
In tomcat 4.0.4 beta 3
there is a file under C:\Apache Tomcat 4.0\conf called server.xml in that xml change the 8080 to whatever value you want in the following tag.
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
SrinivasaRao Sanagapalli
Greenhorn

Joined: Dec 11, 2001
Posts: 10
Thanks a lot. It worked now.
I changed the port 8080 to 8090 now it is working. I think Oracle in my system is using 8080 port.
Anyway thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to test Java Servlets !
 
Similar Threads
JAVA on MAC OS 10.4
JSDK or J2EE?
Messaging Newbie!!
jdk1.3 or j2ee?
What technology next