Home » Language IDEs » ServerTools (WTP) » Cannot start tomcat in Eclipse(JVM_Bind issue with tomcat in eclipse)
|
Re: Cannot start tomcat in Eclipse [message #542663 is a reply to message #542109] |
Fri, 25 June 2010 14:46 |
Larry Isaacs Messages: 1354 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 #544475 is a reply to message #542675] |
Fri, 02 July 2010 19:19 |
Tommy Missing name 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 |
Larry Isaacs Messages: 1354 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 |
Tommy Missing name 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 #548013 is a reply to message #547496] |
Tue, 20 July 2010 12:24 |
Johannes Schade 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 |
Larry Isaacs Messages: 1354 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 |
|
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 #548426 is a reply to message #548416] |
Wed, 21 July 2010 18:53 |
|
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 #548928 is a reply to message #548771] |
Fri, 23 July 2010 13:12 |
Larry Isaacs Messages: 1354 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
|
|
| | | | | |
Goto Forum:
Current Time: Sun Sep 22 19:03:25 GMT 2024
Powered by FUDForum. Page generated in 0.05701 seconds
|