Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to start TOMCAT and run the servlet

 
sivasankar Ilangovan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm new to this forum and I'm preparing for this certification.
I'm having difficulty in starting the tomcat. I just folowed exact steps given in the book. I'm reading the SCWCD Exam Study Kit by Hanumant Deshmukh.
I installed the Tomcat server and the PATH variables as mentioned in the book. But when I start the tomcat server it throws this message.
"
Catalina.start: LifecycleException: Error creating server socket: java.net.Bin
dException: Address already in use: JVM_Bind
LifecycleException: Error creating server socket: java.net.BindException: Addr
ess already in use: JVM_Bind
at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne
ctor.java:483)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:552)
at org.apache.catalina.startup.Catalina.start(Catalina.java:775)
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
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
at java.net.ServerSocket.bind(ServerSocket.java:309)
at java.net.ServerSocket.<init>(ServerSocket.java:183)
at java.net.ServerSocket.<init>(ServerSocket.java:139)
at org.apache.catalina.net.DefaultServerSocketFactory.createSocket(Defau
ltServerSocketFactory.java:118)
at org.apache.catalina.connector.warp.WarpConnector.initialize(WarpConne
ctor.java:477)
at org.apache.catalina.core.StandardService.initialize(StandardService.j
ava:454)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.jav
a:552)
at org.apache.catalina.startup.Catalina.start(Catalina.java:775)
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)"
Can anybody help me to fix this issue and tell me how to go about it.
 
Amit Delve
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have Oracle 9i installed on your machine?
- Amit.
 
sivasankar Ilangovan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I don't have Oracale installed on my m/c.
I have Win 2000.
Again I tried uninstalling and re-install.
I'm just trying out various options....
If I just give http://localhost:8080/index.html in the web browser
it is showing the page even before I start the Tomcat server.
 
Amit Delve
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siva,
I had a similar problem. The problem was that one of the services of Oracle was conflicting with the services started by tomcat. There is a port conflict I think on port 8080 (I am not sure about the port number). Try shutting down some services which you do not need and try running tomcat.
It worked for me.
Amit.
 
Derek Baker
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That particular exception is generally an indication that something is listening on that port, and given that the page comes up, I'd guess it's Tomcat already running. It may start on its own after installing. I'd run the command to stop it (can't remember what that is off the top of my head) and then start it again, or check to see if it's running already by looking at the Windows services, or checking for the process using ps -ef if you're on some unix variant.
Derek
 
sivasankar Ilangovan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the port to 8081.
Now I'm able to start the Tomcat server without any error
and i'm able to work with the examples.
 
Amit Delve
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you change the port number for tomcat? I would like to know since I want to do it too.
Thank you.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can change the port number by editing the Tomcat's config file, located at $CATALINA_HOME/conf/server.xml.
Change the default port 8080 to other "usable" ports.
Nick.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic