从IntelliJ 14中启动我的应用程序时,应用程序服务器TomEE 7.0.62给出以下错误消息:
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:109)
系统:OSX、IntelliJ 14、TomEE Plume 7.0.62(自制)、Java 8(自制容器)
Java版本:
/usr/libexec/java_home -V
Matching Java Virtual Machines (1):
1.8.0_60, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
部署:来自Vaadin Framework 7 的基本Hello World示例应用程序
Infos:
- 使用startup.sh在终端上启动TomEE工作正常,默认的tomcat欢迎屏幕显示在localhost:8080上
- 尝试添加JVM选项以使用chmod 777权限将java.io.tmpdir设置到另一个目录。
VM options: -Djava.io.tmpdir=<new temp dir>
- 尝试使用
export _JAVA_OPTIONS=-Djava.io.tmpdir=<new temp dir>
导出env变量 - 使用Tomcat8 helloworld应用程序运行正常
完整错误日志:
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.openejb.util.Classes.forName(Classes.java:64)
at org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:151)
at org.apache.openejb.config.rules.CheckMethods.check_unusedCreateMethods(CheckMethods.java:318)
at org.apache.openejb.config.rules.CheckMethods.validate(CheckMethods.java:55)
at org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:50)
at org.apache.openejb.config.AppValidator.validate(AppValidator.java:101)
at org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:38)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:526)
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:591)
at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:459)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:438)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:298)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:256)
at org.apache.tomee.catalina.ServerListener.install(ServerListener.java:168)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:55)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:280)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
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:109)
... 32 more
谢谢大家。。
您可以在conf/system.properties中添加openejb.system.apps=false,也可以将CATALINA_TMPDIR导出到"新tmp-dir值"