我是Eclipse的新手。我想在Apache-Tomcat中运行一个简单的HelloWorld servlet程序。我被迫使用Eclipse和Tomcat组合。我使用的是Ubuntu 13.10中的Eclipse-Juno和Apache-Tomcat-6.0.39。我将服务器添加到Eclipse中,并通过创建一个新的动态web项目来键入我的整个HelloWorld程序。当我尝试使用"Run on server“运行我的代码时,在询问哪个服务器继续运行之后,我的eclipse窗口被强制关闭。我可以在eclipse文件夹中看到一个错误日志文件。这说明:
#A fatal error has been detected by the Java Runtime Environment:
#SIGSEGV (0xb) at pc=0x00007f339758b680, pid=6672, tid=139862181361408
#JRE version: OpenJDK Runtime Environment (7.0_51) (build 1.7.0_51-b00)
#Java VM: OpenJDK 64-Bit Server VM (24.45-b08 mixed mode linux-amd64 compressed oops)
Problematic frame:
#C [libwebkitgtk-1.0.so.0+0x112b680] void WTF::freeOwnedGPtr<_GdkEvent>((_GdkEvent*)+0x16b50但是,当我尝试在没有eclipse的情况下运行我的代码时,它工作得很好。
这是我的HelloWorld程序。我确信问题不在这段代码上。
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
private String message;
public void init() throws ServletException
{
message = "Hello World";
}
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<h1>" + message + "</h1>");
}
}为什么会发生这个错误,为什么我的eclipse会自动关闭?任何帮助都将不胜感激。
发布于 2014-03-13 10:30:35
有两种方法可以解决这个400626:
-Dorg.eclipse.swt.browser.XULRunnerPath=/dev/null -Dorg.eclipse.swt.browser.DefaultType=mozilla
在我的Kubuntu13.10 x64上,第二种解决方案解决了这个问题。
发布于 2014-02-20 00:54:20
这可能是Eclipse bug 392967。这在Eclipse4.3(开普勒)中被标记为已修复。
https://stackoverflow.com/questions/21886406
复制相似问题