我们有具有Java 8和Javac 8的服务器。 但是,当尝试访问应用程序中的模块(使用servlet开发)时,它会显示为“需要完整的JDK(而不仅仅是JRE)” 的异常。
使用命令时...
[pdpadmin@HKDVLE805 /]$ javac -version
javac 1.8.0_144
[pdpadmin@HKDVLE805 /]$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
[pdpadmin@HKDVLE805 /]$ which java
/PDP/current-jdk8/bin/java
[pdpadmin@HKDVLE805 /]$ which javac
/PDP/current-jdk8/bin/javac
堆栈跟踪
[2018-08-17T14:24:20.709 + 0800] [Payara 4.1] [警告] [] [javax.enterprise.web.core] [tid:_ThreadID = 27 _ThreadName = http-thread-pool :: http -listener-1(3)] [timeMillis:1534487060709] [levelValue:900] [[ Servlet JSP的Servlet.service()抛出异常 org.apache.jasper.JasperException:PWC6345:调用javac时出错。需要完整的JDK(不仅仅是JRE) 在org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92) 在org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378) 在org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119) 在org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208) 在org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384) 在org.apache.jasper.compiler.Compiler.compile(Compiler.java:453) 在org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625) 在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) 在org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) 在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 在org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1606) 在org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:821) 在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:685) 在org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:641) 在org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:573) 在com.flextronics.servlet.admin.LoginManagement.processRequest(LoginManagement.java:169) 在com.flextronics.servlet.admin.LoginManagement.handleRequest(LoginManagement.java:276) 在org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:67) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 在org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1606) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) 在org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:654) 在org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:593) 在com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 在org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238) 在com.sun.enterprise.v3.services.impl.ContainerMapper $ HttpHandlerCallable.call(ContainerMapper.java:466) 在com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:169) 在org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) 在org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) 在org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) 在org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) 在org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539) 在org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) 在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56) 在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)中 在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:593) 在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:573) 在java.lang.Thread.run(Thread.java:748) ]]
[2018-08-17T14:24:20.711 + 0800] [Payara 4.1] [警告] [] [javax.enterprise.web] [tid:_ThreadID = 27 _ThreadName = http-thread-pool :: http-listener -1(3)] [timeMillis:1534487060711] [levelValue:900] [[ StandardWrapperValve [LoginManagement]:Servlet LoginManagement的Servlet.service()抛出异常 org.apache.jasper.JasperException:PWC6345:调用javac时出错。需要完整的JDK(不仅仅是JRE) 在org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:92) 在org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:378) 在org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:119) 在org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:208) 在org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384) 在org.apache.jasper.compiler.Compiler.compile(Compiler.java:453) 在org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:625) 在org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) 在org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473) 在org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 在org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1606) 在org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:821) 在org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:685) 在org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:641) 在org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:573) 在com.flextronics.servlet.admin.LoginManagement.processRequest(LoginManagement.java:169) 在com.flextronics.servlet.admin.LoginManagement.handleRequest(LoginManagement.java:276) 在org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:67) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:790) 在org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1606) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160) 在org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:654) 在org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:593) 在com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99) 在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) 在org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238) 在com.sun.enterprise.v3.services.impl.ContainerMapper $ HttpHandlerCallable.call(ContainerMapper.java:466) 在com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:169) 在org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206) 在org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180) 在org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235) 在org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133) 在org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) 在org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) 在org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539) 在org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) 在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56) 在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)中 在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:593) 在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:573) 在java.lang.Thread.run(Thread.java:748) ]]
尽管Javac和Java相同,但是却显示出惊人的发展。您能帮我了解为什么我会收到JasperException吗?
答案 0 :(得分:0)
您的应用程序使用JSP并进行编译,Payara需要与JDK一起运行,而不仅与JRE一起运行。检查在Payara Server中配置的路径-通常使用默认的Java安装,但是可以在glassfish/config/asenv.conf
或bin/asadmin
中进行配置。如果有疑问,请启动Payara Server,检查正在运行哪个进程。