File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes How to start TOMCAT and run the servlet 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 » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "How to start TOMCAT and run the servlet" Watch "How to start TOMCAT and run the servlet" New topic
Author

How to start TOMCAT and run the servlet

sivasankar Ilangovan
Greenhorn

Joined: Dec 09, 2003
Posts: 8
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.


Siva.
Amit Delve
Ranch Hand

Joined: Dec 22, 2003
Posts: 33
Do you have Oracle 9i installed on your machine?
- Amit.
sivasankar Ilangovan
Greenhorn

Joined: Dec 09, 2003
Posts: 8
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

Joined: Dec 22, 2003
Posts: 33
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

Joined: May 23, 2003
Posts: 46
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

Joined: Dec 09, 2003
Posts: 8
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

Joined: Dec 22, 2003
Posts: 33
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

Joined: Nov 07, 2003
Posts: 4982
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.


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to start TOMCAT and run the servlet
 
Similar Threads
Can't start Tomcat on win2000
Creating Multiple Tomcat Instances on a Server
Creating Multiple Tomcat Instances on a Server
Can not run Tmacat on Win2k
Tomcat Config problem