1.RuntimeInstance ri = new RuntimeInstance();
2.
3......
4.ri.parse(new StringReader(script), name); //進行渲染腳本處理
換成jetty后,會莫名的出現一個異常信息,截取了一個異常描述:
1.caused by: java.lang.RuntimeException: Error configuring Log4JLogChute :
2. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
3. at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
4. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
5. at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
6. at org.apache.velocity.util.ExceptionUtils.createWithCause(ExceptionUtils.java:67)
7. at org.apache.velocity.util.ExceptionUtils.createRuntimeException(ExceptionUtils.java:45)
8. at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:133)
9. at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:85)
10. at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:157)
11. ... 33 more
12.Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)
13. at java.io.FileOutputStream.openAppend(Native Method)
14. at java.io.FileOutputStream.(FileOutputStream.java:177)
15. at java.io.FileOutputStream.(FileOutputStream.java:102)
16. at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
17. at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
18. at org.apache.log4j.FileAppender.(FileAppender.java:109)
19. at org.apache.log4j.RollingFileAppender.(RollingFileAppender.java:72)
20. at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:118)
21. ... 35 more