无法启动 Apache TomEE 服务器 - 未找到部署:openejb/Deployer
Cannot start Apache TomEE server - Deployment not found: openejb/Deployer
我正在尝试使用 java servlet 制作一个简单的演示。当我 运行 本地主机上的 TomEE 服务器失败并出现错误时:
java.lang.Exception: deployment not found: openejb/Deployer
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.360 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication undeployException original cause
java.lang.Exception: deployment not found: openejb/ConfigurationInfo
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.360 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication undeployException original cause
java.lang.Exception: deployment not found: MEJB
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.361 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.buildContainerSystem Application could not be deployed: openejb
org.apache.openejb.OpenEJBException: Creating application failed: openejb: Error building bean 'openejb/Deployer'. Exception: class java.lang.ExceptionInInitializerError: null: null
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1104)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.apache.openejb.OpenEJBException: Error building bean 'openejb/Deployer'. Exception: class java.lang.ExceptionInInitializerError: null: null
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:85)
at org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1501)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:962)
... 18 more
Caused by: java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:415)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:429)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:405)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:82)
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:68)
... 20 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:112)
... 26 more
Caused by: java.io.IOException: Access is denied
at java.base/java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1024)
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:96)
... 26 more
我正在使用 JDK 12 和 TomEE webprofile 8.0.1。我尝试从 {tomee}/bin/startup.bat 启动服务器,但不幸的是没有任何区别。
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>demoServlet</groupId>
<artifactId>demoServlet</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>12</source>
<target>12</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
HomeServlet.java:
package web;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/")
public class HomeServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().println("Hello world!");
}
}
webapp/WEB-INF/web.xml:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
项目结构:
root
│──src
│──main
│ └──java
│ └──web
│ └──HomeServlet.java
│──webapp
└──WEB-INF
└──web.xml
从堆栈跟踪错误看来,tmp 目录中存在权限问题。
Caused by: org.apache.openejb.OpenEJBRuntimeException: cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
这意味着应用程序没有对 tmp 目录的写入权限。
因此您可以在 conf/system.properties 中添加 openejb.system.apps=false 或仅将 CATALINA_TMPDIR 导出到 "new tmp dir value"
我正在尝试使用 java servlet 制作一个简单的演示。当我 运行 本地主机上的 TomEE 服务器失败并出现错误时:
java.lang.Exception: deployment not found: openejb/Deployer
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.360 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication undeployException original cause
java.lang.Exception: deployment not found: openejb/ConfigurationInfo
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.360 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication undeployException original cause
java.lang.Exception: deployment not found: MEJB
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2366)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1100)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
15-Apr-2020 14:04:54.361 SEVERE [main] org.apache.openejb.assembler.classic.Assembler.buildContainerSystem Application could not be deployed: openejb
org.apache.openejb.OpenEJBException: Creating application failed: openejb: Error building bean 'openejb/Deployer'. Exception: class java.lang.ExceptionInInitializerError: null: null
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:1104)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:759)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:637)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:494)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:307)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:245)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:169)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:137)
at org.apache.catalina.startup.Catalina.load(Catalina.java:584)
at org.apache.catalina.startup.Catalina.load(Catalina.java:607)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.apache.openejb.OpenEJBException: Error building bean 'openejb/Deployer'. Exception: class java.lang.ExceptionInInitializerError: null: null
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:85)
at org.apache.openejb.assembler.classic.Assembler.initEjbs(Assembler.java:1501)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:962)
... 18 more
Caused by: java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:415)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.load(EnterpriseBeanBuilder.java:429)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.loadClass(EnterpriseBeanBuilder.java:405)
at org.apache.openejb.assembler.classic.EnterpriseBeanBuilder.build(EnterpriseBeanBuilder.java:82)
at org.apache.openejb.assembler.classic.EjbJarBuilder.build(EjbJarBuilder.java:68)
... 20 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:112)
... 26 more
Caused by: java.io.IOException: Access is denied
at java.base/java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.base/java.io.File.createNewFile(File.java:1024)
at org.apache.openejb.assembler.DeployerEjb.<clinit>(DeployerEjb.java:96)
... 26 more
我正在使用 JDK 12 和 TomEE webprofile 8.0.1。我尝试从 {tomee}/bin/startup.bat 启动服务器,但不幸的是没有任何区别。
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>demoServlet</groupId>
<artifactId>demoServlet</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>12</source>
<target>12</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
HomeServlet.java:
package web;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/")
public class HomeServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.getWriter().println("Hello world!");
}
}
webapp/WEB-INF/web.xml:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
</web-app>
项目结构:
root
│──src
│──main
│ └──java
│ └──web
│ └──HomeServlet.java
│──webapp
└──WEB-INF
└──web.xml
从堆栈跟踪错误看来,tmp 目录中存在权限问题。
Caused by: org.apache.openejb.OpenEJBRuntimeException: cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder
这意味着应用程序没有对 tmp 目录的写入权限。
因此您可以在 conf/system.properties 中添加 openejb.system.apps=false 或仅将 CATALINA_TMPDIR 导出到 "new tmp dir value"