Exception thrown while starting tomcat on Mac OS

I am on a Mac version 10.8.4 using tomcat 6.0.18 and Oracle JDK7. Recently upgraded from JDK6 to JDK 7. When I try to start tomcat the exceptions below are thrown at the very end..

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 51361 ms
Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: accept:
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.catalina.core.StandardServer.await(StandardServer.java:389)
      at org.apache.catalina.startup.Catalina.await(Catalina.java:662)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:614)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
      at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
      at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
      at java.lang.Thread.run(Thread.java:724)

Sep 17, 2013 6:01:44 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Sep 17, 2013 6:01:45 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
09/17 18:01:45 Information [Thread-49] - Stopping Event Gateways.
09/17 18:01:49 Information [Thread-24] - Same Serial Number found on another ColdFusion server.The server may be out of compliance.
09/17 18:01:50 Information [Thread-49] - ColdFusion stopped


I searched all over the internet for solutions to this, but nothing seems to work. I tried adding these parameters to the start-up script like some suggested and that did not work either.
-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false

One thing to note, it does not fail every time....about 60% of the time it fails to start correctly. Any pointers would be appreciated very much.
kalyancvAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
Try this. Restart your Mac, close any unnecessary applications running and then restart Tomcat. I have a feeling that this is related to this.
0
kalyancvAuthor Commented:
I tried restarting several times with no consistent behavior of the issue. Sometimes it works and sometimes it does not.

I also upgraded to the latest version of tomcat 6 (6.0.37), now I see a different stack trace when it fails

SEVERE: StandardServer.await: accept:
java.net.SocketException: Invalid argument
      at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
      at java.net.ServerSocket.implAccept(ServerSocket.java:530)
      at java.net.ServerSocket.accept(ServerSocket.java:498)
      at org.apache.catalina.core.StandardServer.await(StandardServer.java:431)
      at org.apache.catalina.startup.Catalina.await(Catalina.java:676)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:628)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Sep 18, 2013 11:03:31 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Sep 18, 2013 11:04:48 AM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.ConnectException: Operation timed out
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:579)
      at java.net.Socket.connect(Socket.java:528)
      at java.net.Socket.<init>(Socket.java:425)
      at java.net.Socket.<init>(Socket.java:241)
      at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:492)
      at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:288)
      at org.apache.jk.server.JkMain.pause(JkMain.java:739)
      at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
      at org.apache.catalina.connector.Connector.pause(Connector.java:1138)
      at org.apache.catalina.core.StandardService.stop(StandardService.java:578)
      at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
      at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Sep 18, 2013 11:04:49 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
09/18 11:04:49 Information [main] - Stopping Event Gateways.
09/18 11:04:54 Information [main] - ColdFusion stopped
0
girionisCommented:
Sometimes it works and sometimes it does not.

Can you see a pattern of when it works and when it doesn't?
0
kalyancvAuthor Commented:
No I cannot. I shutdown all applications except a terminal window and tried starting tomcat. It still fails.
0
girionisCommented:
I can't think of anything else, sorry... This is obviously related to java 7 so maybe you can ask the Oracle guys if you have technical support. You can also try the Tomcat mailing list, they will probably know more.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.