This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to test Java Servlets !

 
SrinivasaRao Sanagapalli
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 732
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just download tomcat the free web server that supports servlets. that with a regular J2SE is enough.
http://jakarta.apache.org
 
SrinivasaRao Sanagapalli
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
Follow this
cheers
 
SrinivasaRao Sanagapalli
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3271
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
ersin eser
Ranch Hand
Posts: 1072
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1072
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic