在设计Java EE应用程序时,org.eclipse.swt.dnd包显示错误

时间:2013-03-21 19:00:50

标签: apache tomcat swt

设计界面时遇到的问题 如下:

为了结合拖放的功能,我正在使用SWT和所有 SWT拖放类在包中定义 org.eclipse.swt.dnd。现在我的问题在于开发一个 独立应用程序我已经包含了名为的外部jar swt-4.2.1-win32-win32-x86并且工作正常。但同时 如果我包含该包,则开发Java EE应用程序 jsp页面中的org.eclipse.swt.dnd <%@page language="java" import="org.eclipse.swt.SWT"%>它显示以下错误:

HTTP Status 500 - Unable to compile class for JSP:

--------------------------------------------------------------------------------

type Exception report

message Unable to compile class for JSP:

description The server encountered an internal error that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [16] in the generated java file:
[C:\javaPrograms\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\work\Catalina\localhost\wanem\org\apache\jsp\wanem_jsp.java]

只能导入一种类型。 org.eclipse.swt.SWT解析为包

Stacktrace:
        org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
        org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:331)
        org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:468)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
        org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
        org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.37 logs.

1 个答案:

答案 0 :(得分:0)

SWT用于编写桌面应用程序,不适用于JSP。您可能需要查看Remote Application Platform