gpt4 book ai didi

java - 使用Payara-Micro部署JavaEE应用程序时出现"org.apache.jasper.JasperException: PWC6345"错误

转载 作者:行者123 更新时间:2023-11-30 02:42:19 29 4
gpt4 key购买 nike

我正在以编程方式在 Payara Micro 上部署 JavaEE 应用程序。它在 Netbeans IDE 中工作正常,但在 cmd 中使用 java -jar myapp.jar 时出现以下错误。

Payara Micro 似乎找不到 javac。关于如何解决这个问题的建议将不胜感激。

  • 我将 JAVA_HOME 设置为 C:\Program Files\Java\jdk1.8.0_111
  • 我在 Windows 7 上使用 Payara-micro 4.1.1.164。
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)
]]

最佳答案

检查 java 命令是否引用 JDK 而不是 JRE。如果没有,请使用 C:\Program Files\Java\jdk1.8.0_111 中的 java 命令,或设置 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.home 系统属性定义的文件夹中查找 java 编译器来编译 JSP,但找不到它。

详情参见 ToolPovider.getSystemJavaCompiler() 源码,Payara Micro 使用它来查找 Java 编译器。

关于java - 使用Payara-Micro部署JavaEE应用程序时出现"org.apache.jasper.JasperException: PWC6345"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41278193/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com