我正在以编程方式在Payara Micro上部署JavaEE应用程序。它在Netbeans IDE中运行良好,但在使用java -jar myapp.jar
中的cmd
时出现以下错误。
看起来Payara Micro无法找到javac
。关于如何解决这个问题的建议将不胜感激。
C:\Program Files\Java\jdk1.8.0_111
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac.
A full JDK (not just JRE) is required
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH
andler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j
ava:378)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j
ava:119)
at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompi
ler.java:208)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:384)
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:375)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:4
73)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java
:1693)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:214)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:316)
at org.springframework.security.web.access.intercept.FilterSecurityInter
ceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInter
ceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.ExceptionTranslationFilter.do
Filter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.session.SessionManagementFilter.doFi
lter(SessionManagementFilter.java:122)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AnonymousAuthenticati
onFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.servletapi.SecurityContextHolderAwar
eRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter
.doFilter(RequestCacheAwareFilter.java:48)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AbstractAuthenticatio
nProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.logout.LogoutFilter.d
oFilter(LogoutFilter.java:120)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterIn
ternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.request.async.WebAsyncManage
rIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerR
equestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.session.ConcurrentSessionFilter.doFi
lter(ConcurrentSessionFilter.java:133)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.SecurityContextPersistenceFi
lter.doFilter(SecurityContextPersistenceFilter.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.
doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(Fi
lterChainProxy.java:213)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChai
nProxy.java:176)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(D
elegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegat
ingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:161)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.j
ava:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.j
ava:416)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:283)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallab
le.call(ContainerMapper.java:466)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(Container
Mapper.java:169)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.
java:206)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.ja
va:180)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpSer
verFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(Executor
Resolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(De
faultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart
(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultF
ilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultF
ilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.jav
a:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNI
OTransport.java:526)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(Abstr
actIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerTh
readIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(Wo
rkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadR
unnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(Abs
tractThreadPool.java:593)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(Abstra
ctThreadPool.java:573)
at java.lang.Thread.run(Unknown Source)
]]
答案 0 :(得分:2)
检查java
命令是指JDK而不是JRE。如果没有,请使用java
中的C:\Program Files\Java\jdk1.8.0_111
命令,或将C:\Program Files\Java\jdk1.8.0_111
设置为java.home
系统属性,如下所示:
java -Djava.home="C:\Program Files\Java\jdk1.8.0_111" -jar myapp.jar
Payara Micro试图找到java编译器来编译类路径或java.home
系统属性定义的文件夹中的JSP,但找不到它。
有关详细信息,请参阅Payara Micro用于查找Java编译器的ToolPovider.getSystemJavaCompiler()源代码。