publicstaticvoidmain(String[] args)throws Exception { Book book = new Book(); PageFormat pf = new PageFormat(); pf.setOrientation(PageFormat.PORTRAIT);
Paper p = new Paper(); p.setSize(590, 840); p.setImageableArea(10, 10, 590, 840); pf.setPaper(p); book.append(new OneLabel(), pf);
Spring boot项目启动过一段较长时间后,在使用上传文件相关功能时,会出现错误。错误信息和下面的类似,临时目录不存在了
Could not parse multipart servlet request;
nested exception is java.io.IOException:
The temporary upload location [/tmp/tomcat.7313397276953595407.8090/work/Tomcat/localhost/ROOT] is not valid。
Could not parse multipart servlet request;
nested exception is java.io.IOException:
The temporary upload location [C:\Users\Administrator\AppData\Local\Temp\tomcat.7174298170552445669.8002\work\Tomcat\localhost\server] is not valid
publicstaticvoidmain(String[] argvs)throws Exception{ StringBuffer buf = new StringBuffer(); buf.append("package a.b.c;\r\npublic class ANumber{") .append("public int getNumber() {") .append("System.out.println(\"Hello World in getNumber()!\"); return 999;") .append("}") .append("}");
DynamicCompiler dc = new DynamicCompiler(); Class cls = dc.compile(buf.toString()); System.out.println(cls.getName()); Object obj = cls.getDeclaredConstructor().newInstance(); Method method = cls.getDeclaredMethod("getNumber"); Object r = method.invoke(obj); System.out.println("result is " + r); } }