정적 HTML 페이지와 서블릿을 제공하기 위해 Android 플랫폼에서 Jetty를 실행 중입니다. 지금은 JSP 페이지에 대한 지원을 추가하기 위해 노력했습니다하지만 난 어떤 JSP를 요청할 때 나는이 예외를 가지고 : 여기 Android (Jetty 임베디드)에서 JSP 컴파일
HTTP ERROR 500
Problem accessing /time.jsp. Reason:
Server Error
Caused by:
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
PWC6199: Generated servlet error:
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
PWC6199: Generated servlet error:
The type java.lang.Throwable cannot be resolved. It is indirectly referenced from required .class files
PWC6199: Generated servlet error:
The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files
PWC6199: Generated servlet error:
org.apache.jasper.runtime.HttpJspBase cannot be resolved to a type
PWC6199: Generated servlet error:
org.apache.jasper.runtime.JspSourceDependent cannot be resolved to a type
PWC6199: Generated servlet error:
JspFactory cannot be resolved to a type
PWC6199: Generated servlet error:
JspFactory cannot be resolved
PWC6199: Generated servlet error:
java.util.List cannot be resolved to a type
PWC6199: Generated servlet error:
Syntax error, parameterized types are only available if source level is 1.5 or greater
PWC6199: Generated servlet error:
String cannot be resolved to a type
PWC6199: Generated servlet error:
org.glassfish.jsp.api.ResourceInjector cannot be resolved to a type
PWC6199: Generated servlet error:
java.util.List cannot be resolved to a type
PWC6199: Generated servlet error:
Syntax error, parameterized types are only available if source level is 1.5 or greater
PWC6199: Generated servlet error:
String cannot be resolved to a type
PWC6199: Generated servlet error:
_jspx_dependants cannot be resolved to a variable
PWC6199: Generated servlet error:
HttpServletRequest cannot be resolved to a type
PWC6199: Generated servlet error:
HttpServletResponse cannot be resolved to a type
PWC6199: Generated servlet error:
java.io.IOException cannot be resolved to a type
PWC6199: Generated servlet error:
ServletException cannot be resolved to a type
PWC6199: Generated servlet error:
PageContext cannot be resolved to a type
PWC6199: Generated servlet error:
HttpSession cannot be resolved to a type
PWC6199: Generated servlet error:
ServletContext cannot be resolved to a type
PWC6199: Generated servlet error:
ServletConfig cannot be resolved to a type
PWC6199: Generated servlet error:
JspWriter cannot be resolved to a type
PWC6199: Generated servlet error:
Object cannot be resolved to a type
PWC6199: Generated servlet error:
JspWriter cannot be resolved to a type
PWC6199: Generated servlet error:
PageContext cannot be resolved to a type
PWC6199: Generated servlet error:
_jspxFactory cannot be resolved
PWC6199: Generated servlet error:
_jspx_resourceInjector cannot be resolved to a variable
PWC6199: Generated servlet error:
org.glassfish.jsp.api.ResourceInjector cannot be resolved to a type
PWC6197: An error occurred at line: 3 in the jsp file: /time.jsp
PWC6199: Generated servlet error:
java.util.Date cannot be resolved to a type
PWC6199: Generated servlet error:
Throwable cannot be resolved to a type
PWC6199: Generated servlet error:
SkipPageException cannot be resolved to a type
PWC6199: Generated servlet error:
ServletException cannot be resolved to a type
PWC6199: Generated servlet error:
_jspxFactory cannot be resolved
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:129)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:299)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:392)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:856)
Powered by Jetty://
이 주요 활동에서 내 구성 코드 :
public void startServer()
{
server = new Server(8080);
System.setProperty("org.apache.jasper.compiler.disablejsr199", "true");
// Create a resource handler for static content.
ResourceHandler staticResourceHandler = new ResourceHandler();
staticResourceHandler.setResourceBase(Environment.getExternalStorageDirectory().getAbsolutePath() + "/web/static/");
staticResourceHandler.setDirectoriesListed(false);
// Create context handler for static resource handler.
ContextHandler staticContextHandler = new ContextHandler();
staticContextHandler.setContextPath("/static");
staticContextHandler.setHandler(staticResourceHandler);
// Create WebAppContext for JSP files.
WebAppContext webAppContext = new WebAppContext();
webAppContext.setContextPath("/");
webAppContext.setResourceBase(Environment.getExternalStorageDirectory().getAbsolutePath() + "/web/");
webAppContext.setInitParameter("org.eclipse.jetty.servlet.Default.dirAllowed", "false");
// Create servlet context handler for main servlet.
ServletContextHandler servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
servletContextHandler.setContextPath("/servlet");
servletContextHandler.setResourceBase(Environment.getExternalStorageDirectory().getAbsolutePath() + "/web/servlet/");
terminalServlet = new TerminalServlet(this);
networkServlet = new NetworkDrawerServlet(this);
servletContextHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
servletContextHandler.addServlet(new ServletHolder(terminalServlet),"/terminal");
servletContextHandler.addServlet(new ServletHolder(networkServlet),"/topology");
//servletContextHandler.addServlet(new ServletHolder(new DefaultServlet()), "/*");
// Create a handler list to store our static, jsp and servlet context handlers.
HandlerList handlers = new HandlerList();
handlers.setHandlers(new org.eclipse.jetty.server.Handler[] { staticContextHandler, webAppContext, servletContextHandler });
// Add the handlers to the server and start jetty.
server.setHandler(handlers);
try {
server.start();
} catch (Exception e) {
}
}
나는를 배치 extarnal 스토리지의 "/ web /"디렉토리 아래에있는 웹 서버 파일 (정적 컨텐츠 및 JSP 파일) (정적 컨텐츠의 경우 작동합니다. 매니페스트 파일에서 읽기 및 쓰기 권한을 설정했습니다).
나는 안드로이드에서 일반적인 confgiuration 문제라고 생각한다. 데스크탑에서 컴파일되고 실행되는 동일한 코드가 잘 동작하기 때문이다.
는 없었다. 거기서 잘 잡는다. 모든 일을하고 있지만 놀랍습니다. – stu