Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Cannot start tomcat in Eclipse(JVM_Bind issue with tomcat in eclipse)
Cannot start tomcat in Eclipse [message #542109] Wed, 23 June 2010 21:22 Go to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
I have searched far and wide for anyone having the same issue, only problems where people cannot start because ports are already in use. So here goes.

Setup:
Windows 7
Eclipse Helios (same issue with Galileo)
Apache Tomcat 6.0.26

Error message from console:
------------
SEVERE: Error initializing endpoint
java.net.SocketException: Socket operation on nonsocket: JVM_Bind
------------

I have checked that none of the ports needed 8080, 8005, 8009 is used before and after opening Eclipse, by checking with netstat.

Once I start Tomcat in Eclipse the error message appears and the ports are taken by Tomcat, but I cannot access the service.

What is really odd, is that I can start Tomcat using the startup.bat file and it runs fine.

Thanks
Tommy
Re: Cannot start tomcat in Eclipse [message #542663 is a reply to message #542109] Fri, 25 June 2010 14:46 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 6/23/2010 5:22 PM, Tommy wrote:
> I have searched far and wide for anyone having the same issue, only
> problems where people cannot start because ports are already in use. So
> here goes.
>
> Setup:
> Windows 7
> Eclipse Helios (same issue with Galileo)
> Apache Tomcat 6.0.26
>
> Error message from console:
> ------------
> SEVERE: Error initializing endpoint
> java.net.SocketException: Socket operation on nonsocket: JVM_Bind
> ------------
>
> I have checked that none of the ports needed 8080, 8005, 8009 is used
> before and after opening Eclipse, by checking with netstat.
>
> Once I start Tomcat in Eclipse the error message appears and the ports
> are taken by Tomcat, but I cannot access the service.
> What is really odd, is that I can start Tomcat using the startup.bat
> file and it runs fine.
>
> Thanks
> Tommy

This is not one I've seen. If this Tomcat is not from a downloaded zip
or tar.gz, or if its configuration has been customized, you can try
creating a fresh Tomcat from a zip or tag.gz. Then see if Eclipse has
the same issue with that one. When the Tomcat plug-ins create a new
Tomcat server, the current server.xml will be imported from the Tomcat
installation. There can be customizations present that cause problems
within Eclipse because they require additional configuration beyond what
the plug-ins know how to import. This experiment would eliminate that
as the cause.

Cheers,
Larry
Re: Cannot start tomcat in Eclipse [message #542675 is a reply to message #542663] Fri, 25 June 2010 15:20 Go to previous messageGo to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
Hi Larry, thanks for your reply, it is a vanilla installation.

I got Tomcat from http://tomcat.apache.org/

apache-tomcat-6.0.26-windows-x86.zip

And I was thinking the same thing and tried also to use "apache-tomcat-6.0.14.zip" as I have used that one before on Windows XP.

Also as a side note I use jdk-6u20-windows-i586.exe

Some more notes on what I tried
* Enabled/disabled UAC just to see if that helped or would pop up an alert (no difference as result of that).
On "eclipse.exe" and "javaw.exe" (the one eclipse uses to launch tomcat) checked them to run as Administrator
* Enabled/disabled Windows XP compatiblity mode on javaw.exe
* Checked firewall (f-secure), did not see any blocks, and even unloaded it for a few attempts.

One thing that was interesting was,I tried disabling the containers in the server.xml (8080 and 8443) so it only ran the shutdown (8005) and then it started without the JVM_Bind error, but eclipse would still complain that the server did not start (after the default 45 seconds).

/Tommy
Re: Cannot start tomcat in Eclipse [message #544475 is a reply to message #542675] Fri, 02 July 2010 19:19 Go to previous messageGo to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
Update, as I am still at a lost on this problem

I have checked many more things, but still no luck, and I ran into another problem which seem to tell a little more about was may be the core issue.

I cannot run JUnit (junit4) tests. I will run fine, but no success/failed. I tried then running JUnit with debugging and Eclipse gave the following message:

----
Cannot connect to VM
Unrecognized Windows Sockets error: 0: JVM_Bind
----

Searching on this, I found that it possible that Eclipse is launching a different JVM that it cannot connect to. So I went to work on my PATH, and made sure that there was only the same JAVA available as I am using inside Eclipse. But no luck however.

-- The stacktrace from .metadata/.log ---
!SESSION 2010-07-02 12:10:54.065 -----------------------------------------------
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product

!ENTRY org.eclipse.jdt.launching 4 120 2010-07-02 12:11:20.297
!MESSAGE Cannot connect to VM
!STACK 0
java.net.SocketException: Socket operation on nonsocket: JVM_Bind
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.PlainSocketImpl.bind(Unknown Source)
	at java.net.ServerSocket.bind(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at java.net.ServerSocket.<init>(Unknown Source)
	at org.eclipse.jdi.internal.connect.SocketTransportService.startListening(SocketTransportService.java:277)
	at org.eclipse.jdi.internal.connect.SocketTransportImpl.startListening(SocketTransportImpl.java:47)
	at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.startListening(SocketListeningConnectorImpl.java:115)
	at org.eclipse.jdt.internal.launching.StandardVMDebugger.run(StandardVMDebugger.java:246)
	at org.eclipse.jdt.launching.JavaLaunchDelegate.launch(JavaLaunchDelegate.java:101)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Re: Cannot start tomcat in Eclipse [message #545095 is a reply to message #544475] Tue, 06 July 2010 15:14 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 7/2/2010 3:19 PM, Tommy wrote:
> Update, as I am still at a lost on this problem
>
> I have checked many more things, but still no luck, and I ran into
> another problem which seem to tell a little more about was may be the
> core issue.
>
> I cannot run JUnit (junit4) tests. I will run fine, but no
> success/failed. I tried then running JUnit with debugging and Eclipse
> gave the following message:
>
> ----
> Cannot connect to VM
> Unrecognized Windows Sockets error: 0: JVM_Bind
> ----
>
> Searching on this, I found that it possible that Eclipse is launching a
> different JVM that it cannot connect to. So I went to work on my PATH,
> and made sure that there was only the same JAVA available as I am using
> inside Eclipse. But no luck however.
>

<snip/>

Unfortunately, since I'm not able to duplicate this it is hard to offer
much help. If you are still having a problem, does starting Tomcat in
debug mode result in the same kind of behavior as JUnit, or can it start
with just 8005 in use?

Cheers,
Larry
Re: Cannot start tomcat in Eclipse [message #545113 is a reply to message #545095] Tue, 06 July 2010 16:35 Go to previous messageGo to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
Hi again Larry, thanks for the effort, good idea, I had not thought of that.

So as you suggested I tried debug the server with just the 8005, and then it fails immediately with the following message.

!SESSION 2010-07-06 09:22:02.555 -----------------------------------------------
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

!ENTRY org.eclipse.wst.server.core 4 0 2010-07-06 09:22:16.065
!MESSAGE Server Tomcat v6.0 Server at localhost failed to start.


Not that it says a whole lot, but it seems to me it is perhaps less of a Tomcat issue, and more an Eclipse issue. Well for now I will just have to run Tomcat using the batch script. That Junit does not work do bug me a bit though.

Also with regards to JUnit, I tried getting another Eclipse Helios, that only have basic Java (eclipse-java-helios-win32.zip), and problem is exactly the same.

Also (even further out, but never know what information is useful), I installed Oracle Weblogic 11g last week, and I can run the portal domain there from within "Eclipse for Weblogic" without any problems at all.

/ Tommy
Re: Cannot start tomcat in Eclipse [message #547495 is a reply to message #545113] Sat, 17 July 2010 17:38 Go to previous messageGo to next message
Johannes Schade is currently offline Johannes SchadeFriend
Messages: 3
Registered: July 2010
Junior Member
Dear Tommy
I seem to have the same problem. It occurs since I updated from Galileo to Helios. The ports seems always to be taken. I did not have this problem with Galileo, so I think it is well an Eclipse issue.
Best regards, Johannes
Re: Cannot start tomcat in Eclipse [message #547496 is a reply to message #547495] Sat, 17 July 2010 18:13 Go to previous messageGo to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
Hi Johannes, good to hear I am not entirely alone with this problem.

I am afraid I have not found a solution yet, but will post it here, if I ever do find out.

Two more things to the list of exploration.

I installed Oracle ATS (an Eclipse Galileo based testing tool) and it has the same issue with the server it launches.

And, since Oracle Weblogic worked fine, I tried using JRockit for the standard Eclipse (both as JAVA_HOME and as the JRE used), but same problem persisted.

Best regards
Tommy
Re: Cannot start tomcat in Eclipse [message #547665 is a reply to message #547496] Mon, 19 July 2010 10:18 Go to previous messageGo to next message
Johannes Schade is currently offline Johannes SchadeFriend
Messages: 3
Registered: July 2010
Junior Member
Dear Tommy

Thanks for your response. Luckily, the problem has disappeared from the workspace where encountered it, at least for now. I deleted the offending server, rebooted the machine and recreated the server. Since this time the server behaves as it was in Galileo. Of course I have not understood what happened and am afraid it may recur. I had a PermGen out-of-memory error at some stage. Perhaps this had something to do with it.

Best regards, Johannes
Re: Cannot start tomcat in Eclipse [message #548013 is a reply to message #547496] Tue, 20 July 2010 12:24 Go to previous messageGo to next message
Johannes Schade is currently offline Johannes SchadeFriend
Messages: 3
Registered: July 2010
Junior Member
Dear Tommy
The problem just recurred and I advanced a bit in its understanding.
I am running Tomcat outside of Eclipse on ports 8080, 8009 and 8005 and inside on ports 9090, 9009 and 9005. When Eclipse reported that the ports were taken, I looked up the file "server.xml" of the external Tomcat (C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf) and found that the ports were changed to 9090, 9009 and 9005. I have not touched that file. How they could have been changed I do not understand. I changed them back to 8080, 8009 and 8005, restarted Tomcat in the Windows Services panel and was fine.
I wonder whether the same is happening on your machine. Besides, mine is a laptop running under Windows XP.

Best regards, Johannes

[Updated on: Tue, 20 July 2010 12:25]

Report message to a moderator

Re: Cannot start tomcat in Eclipse [message #548028 is a reply to message #548013] Tue, 20 July 2010 13:34 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 7/20/2010 8:24 AM, Johannes Schade wrote:
> Dear Tommy
> The problem just recurred and I advanced a bit in its understanding.
> I am running Tomcat outside of Eclipse on ports 8080, 8009 and 8005 and
> inside on ports 9090, 9009 and 9005. When Eclipse reported that the
> ports were taken, I looked up the file "server.xml" of the external
> Tomcat (C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf) and
> found that the ports were changed to 9090, 9009 and 9005. I have not
> touched that file. How they could have been changed I do not understand.
> I changed them back to 8080, 8009 and 8005, restarted Tomcat in the
> Windows Services panel and was fine.
> I wonder whether the same is happening on your machine. Besides, mine is
> a laptop running under Windows XP.
>
> Best regards, Johannes

If you selected, even temporarily, the "Use Tomcat Installation (takes
control of Tomcat installation)" option for the Server Location in the
server editor, it would overwrite the server.xml in your installation
with the one under the Servers project in your workspace. This is the
meaning of "takes control of Tomcat installation". That's the only way
I know of that would "transfer" those port settings.

Cheers,
Larry
Re: Cannot start tomcat in Eclipse [message #548055 is a reply to message #548013] Tue, 20 July 2010 13:54 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3245
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/20/2010 6:24 AM, Johannes Schade wrote:
> Dear Tommy
> The problem just recurred and I advanced a bit in its understanding.
> I am running Tomcat outside of Eclipse on ports 8080, 8009 and 8005 and
> inside on ports 9090, 9009 and 9005. When Eclipse reported that the
> ports were taken, I looked up the file "server.xml" of the external
> Tomcat (C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf) and
> found that the ports were changed to 9090, 9009 and 9005. I have not
> touched that file. How they could have been changed I do not understand.
> I changed them back to 8080, 8009 and 8005, restarted Tomcat in the
> Windows Services panel and was fine.
> I wonder whether the same is happening on your machine. Besides, mine is
> a laptop running under Windows XP.
>
> Best regards, Johannes

For what it's worth, I install separate, private copies of the Sun JDK
and Apache Tomcat for dedicated use with Eclipse. That way, no matter
what else I might have occasion to do on my development host, nothing is
there to interfere or confuse me when writing code (apart from my own,
recurring moments of stupidity).

;-)
Re: Cannot start tomcat in Eclipse [message #548416 is a reply to message #548055] Wed, 21 July 2010 18:20 Go to previous messageGo to next message
aswini  is currently offline aswini Friend
Messages: 1
Registered: July 2010
Junior Member
I am getting the following errors when I am trying to run the server:

java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:21 6)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:39 1)

I am using Helios. Please help
Re: Cannot start tomcat in Eclipse [message #548426 is a reply to message #548416] Wed, 21 July 2010 18:53 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3245
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 7/21/2010 12:20 PM, aswini wrote:
> I am getting the following errors when I am trying to run the server:
> java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:21 6)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:39 1)
>
> I am using Helios. Please help


It's probably a better idea NOT to hijack this thread, Aswini. Start a
new one.

In the meantime, you don't give enough to go on. You're probably missing
one or more Tomcat libraries.

Do you have questions on how to set up Tomcat and Eclipse?

Russ Bateman
Re: Cannot start tomcat in Eclipse [message #548771 is a reply to message #548028] Thu, 22 July 2010 23:05 Go to previous messageGo to next message
Tommy Missing name is currently offline Tommy Missing nameFriend
Messages: 6
Registered: June 2010
Junior Member
Hi Johannes and Larry, thanks for your suggestions and hints I tried and looked if any of those were the problem.

I am using workspace as the location. I tried switching the port 8080 to port 48080, to see if somehow I was using the default server configuration from the tomcat install dir, and that was not the problem.

I could not figure out what you meant precisely by the "Server Editor" until I in the Servers tab selected Properties on the server, and then chose "Switch Location"

Changing it from "[workspace metadata]" to "/servers/Tomcat/... at localhost", then it appears under the Tomcat server configuration in the Project Explorer.

And in there it is set to "Use Workspace Metadata".

I find it a little odd, that the "Server Editor" does not appear all the time, since the setting is managed from the "Server Editor" anyway.

Best regards
Tommy
Re: Cannot start tomcat in Eclipse [message #548928 is a reply to message #548771] Fri, 23 July 2010 13:12 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 7/22/2010 7:05 PM, Tommy wrote:
> Hi Johannes and Larry, thanks for your suggestions and hints I tried and
> looked if any of those were the problem.
>
> I am using workspace as the location. I tried switching the port 8080 to
> port 48080, to see if somehow I was using the default server
> configuration from the tomcat install dir, and that was not the problem.
> I could not figure out what you meant precisely by the "Server Editor"
> until I in the Servers tab selected Properties on the server, and then
> chose "Switch Location"
>
> Changing it from "[workspace metadata]" to "/servers/Tomcat/... at
> localhost", then it appears under the Tomcat server configuration in the
> Project Explorer.
>
> And in there it is set to "Use Workspace Metadata".
>
> I find it a little odd, that the "Server Editor" does not appear all the
> time, since the setting is managed from the "Server Editor" anyway.
>
> Best regards
> Tommy

To get to the server editor, double-click the server in the Servers
view, or right-click it and select Open. The "Switch Location" is for
choosing where to store the metadata about the server configuration.
For additional details see the Tomcat_FAQ[1].

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: Cannot start tomcat in Eclipse [message #550062 is a reply to message #548928] Thu, 29 July 2010 01:51 Go to previous messageGo to next message
Jack, Liu is currently offline Jack, LiuFriend
Messages: 8
Registered: July 2010
Location: China
Junior Member
If you still did not find the root cause of JVM binding.
Maybe you can have a check on the JREs, to see if they are identical, The java_home, the jvm to start eclipse, the specific JRE of the java project, and the runtime jre setting.
I suffered similar JVM binding issue when I mixed IBM JRE and Sun JRE in developing.


Cheers

Jack
Re: Cannot start tomcat in Eclipse [message #871123 is a reply to message #542109] Fri, 11 May 2012 01:02 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 2
Registered: April 2011
Junior Member
I am also having this issue. I upgrade from helios to indigo, and it keeps telling me my shutdown port is JVM bind. If I change my server xml to use 8006 or 8007 same thing. What is the resolution ?
Re: Cannot start tomcat in Eclipse [message #871290 is a reply to message #871123] Fri, 11 May 2012 19:06 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
On 5/10/2012 9:02 PM, Missing name Mising name wrote:
> I am also having this issue. I upgrade from helios to indigo, and it
> keeps telling me my shutdown port is JVM bind. If I change my server xml
> to use 8006 or 8007 same thing. What is the resolution ?

Are you changing the server.xml down under the Server's project in
Eclipse? That's the one you need to be changing. You can change is
using the server editor. Double-click on the server in the Servers view
to open the server editor.

Cheers,
Larry
Re: Cannot start tomcat in Eclipse [message #897779 is a reply to message #542109] Wed, 25 July 2012 08:55 Go to previous messageGo to next message
Adrian Ng is currently offline Adrian NgFriend
Messages: 1
Registered: July 2012
Junior Member
Might want to check that Window 7 firewall isn't blocking the port, or some virus scanner is blocking it either.
Re: Cannot start tomcat in Eclipse [message #901293 is a reply to message #542109] Fri, 10 August 2012 16:19 Go to previous message
Feras Darweesh is currently offline Feras DarweeshFriend
Messages: 1
Registered: August 2012
Junior Member
I been stuck for a while with this issue , after reading all these posts, i figure it out by

go server properties --> General ----> switch location to [workspace metadata]

Thank all ...for triggering this.. Cool
Previous Topic:Remote Debug Weblogic 10.3.3 on Linux from Windows machine
Next Topic:WTP for eclipse Galileo
Goto Forum:
  


Current Time: Thu Nov 27 14:37:48 GMT 2014

Powered by FUDForum. Page generated in 0.03837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software