Eclipse:Glassfish 和 Tomcat 不起作用
我重新安装了java JDK 6.0.25,(安装java出现一些问题后,终于成功了)。我已经设置了路径(JAVA_HOME指向C:\Program Files\Java\jdk1.6.0_25,并且在Path中还添加了C:\Program Files\Java\jdk1.6.0_25\bin)。
在 eclipse 中,我已经将所有内容都指向了这个新的 JDK,也在服务器中。当我安装 Glassfish 3.1 时,安装后未创建域。因此,当我在 Eclipse 中添加此服务器时,找不到该域。
因此,我提取了 Glassfish 的 ZIP 版本,并在 Eclipse 中将服务器配置为该 ZIPPED Glassfish。我还再次安装了 tomcat 7.0.14 并添加到 eclipse 但两者都不起作用。
主要问题:当我在 Eclipse 中启动 Tomcat 或 Glassfish 时,它们无法启动。 Tomcat 正在启动,但 45 秒后它说时间已到。我已经阅读了论坛以增加启动时间,我将其设置为 240 秒,但它不起作用,因为它会弹出错误,该端口已被其他服务器使用。
通过 Glassfish,当我启动它时,它就启动了,但几分钟后出现错误:无法启动。看起来某些端口或某些东西阻止了该服务器。我也关闭了防火墙和防病毒软件,但什么也没有。
我查看了所有有关“未启动 Glassfish 或 Tomcat”的论坛,但没有找到解决方案。我不想为此重新安装 Windows。 因此,如果有人知道有关此问题的任何信息,请提供帮助。
更新:
我尝试更改domain.xml中的端口并使用netstat -b检查(一切都已建立),但服务器(Glassfish)没有启动。它显示错误“本地主机上的服务器 GlassFish Server Open Source Edition 3 (Java EE 6) 无法启动。”。我还尝试从 marketspace 和 eclipse 的“安装新软件”安装“内置 Eclipse”Glassfish,但出现相同的错误。目前,为了满足我在 Windows 7 中使用 XP 模式的需要,服务器可以正常工作,没有任何问题。
I have reinstalled java JDK 6.0.25,(after some problems installing java, finally succeeded). I have set paths (JAVA_HOME points to C:\Program Files\Java\jdk1.6.0_25 and in Path also added C:\Program Files\Java\jdk1.6.0_25\bin).
In eclipse I have pointed everything to this new JDK, also in servers. When I have installed Glassfish 3.1, after installation the domain wasn't created. So when I add this server in Eclipse, the domain wasn't found.
So I did extract an ZIP version of Glassfish and in Eclipse configure the server to this ZIPPED Glassfish. Also I have installed tomcat 7.0.14 again and add to eclipse but both did not work.
Main problem: When I start Tomcat or Glassfish in Eclipse they don't start. Tomcat is starting but after 45 seconds it says, that the time is run out. I have read the forums to increase starting time, I have putted it to 240 sec, but it does not work, because it pop out error in which sazs, that the port is already used by a different server.
By Glassfish, when I start it, its starting, but after few minutes gives me error: Failed to start. It looks like some ports or something is blocking this servers. I have turned off firewall also and antivirus but nothing.
I have looked all the forum about "not starting Glassfish or Tomcat" but didn't found the solution. I don't want to reinstall windows for this.
So if anyone know anything about this problem, please HELP.
Update:
I've tried to change the ports in domain.xml and checked with netstat -b (everything was established), but the server (Glassfish) didn't start. It shows an error "Server GlassFish Server Open Source Edition 3 (Java EE 6) at localhost failed to start.". I've also tried install "built in Eclipse" Glassfish from marketspace and from "Install new software" from eclipse, but it comes out with the same error. Currently, for needs I'm using XP Mode in Windows 7, there servers work, without any problems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来你的安装奥德赛弄乱了你的系统。
但您无需重新安装 Windows 即可使其正常工作。也许旧服务器安装的碎片会阻塞 Glassfish 和 Tomcat 运行所需的端口。
请尝试以下操作:
检查您的“新”服务器尝试访问哪些端口(应该类似于 8080,并且应该在启动期间写入服务器日志中)
使用
netstat -b
(从以管理员权限启动的 cmd 中)检查哪个应用程序阻止了此/这些端口(可以是 java .exe 如果有旧安装仍然挂起)删除旧安装(卸载或禁用服务)
重试启动新服务器。
It seems your installation odyssey messed up your system.
But you should get it working without reinstalling Windows. Maybe the fragment of an old server installation blocks the ports Glassfish and Tomcat need for operation.
Try the following:
Check which ports your "new" servers try to access (should be something like 8080 and should be written in server logs during startup)
Use
netstat -b
(from cmd started with admin rights) to check which application blocks this / these ports (could be java.exe if there is an old installation still hanging)Remove the old installation (uninstall or disable service)
Try again to start your new server(s).
尝试告诉 GF 或 TC 将默认的 Web 侦听器绑定到 8080 以外的其他端口,因为这是问题的根源。
我不太了解 TC,但是对于 GF 来说,这很容易。只需编辑 $GLASSFISH_HOME/domains/domain1/config/domain.xml 并找到类似的内容:
并将 8080 替换为其他端口(但与 TC 不同)。对于你的情况,我可以选择 8888,它很容易记住,但你可以很确定这与 TC 的端口不同。
注意:在启动 GF 之前编辑此文件!
Try tell to GF or TC to bind the default web listener other port than 8080, because this is a root of problem.
I doesn't know well TC, but in GF case, this is very easy. Simply edit $GLASSFISH_HOME/domains/domain1/config/domain.xml and find something similar:
And replace 8080 with other port (but not same with TC). In your case I could choose 8888 which is easy to remember but you can pretty sure this is differs from TC's port.
Note: Edit this file before you start GF!