Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 新FileOutputStream导致Jhipster应用程序重新启动_Java_Spring Boot_Itext_Jhipster_Fileoutputstream - Fatal编程技术网

Java 新FileOutputStream导致Jhipster应用程序重新启动

Java 新FileOutputStream导致Jhipster应用程序重新启动,java,spring-boot,itext,jhipster,fileoutputstream,Java,Spring Boot,Itext,Jhipster,Fileoutputstream,我在问之前已经找了很多了。我创建了一个Jhipster microservice应用程序(V3.12),并使用iText库根据模板生成自己的PDF 我在另一个项目(不是Spring Boot,而是一个简单的maven项目)中测试了GeneratePDDFFromPDFTemplate类,它工作得很好;但当我在JHipster项目中运行它时,新的FileOutputStream指令会导致问题: 公共静态void generatePdf(字符串src、字符串dest、字符串codiceAvviso)

我在问之前已经找了很多了。我创建了一个Jhipster microservice应用程序(V3.12),并使用iText库根据模板生成自己的PDF

我在另一个项目(不是Spring Boot,而是一个简单的maven项目)中测试了
GeneratePDDFFromPDFTemplate类,它工作得很好;但当我在JHipster项目中运行它时,新的
FileOutputStream
指令会导致问题:

公共静态void generatePdf(字符串src、字符串dest、字符串codiceAvviso){

调试时,新的FileOutputStream(dest);强制重新启动我的应用程序,导致出现以下日志:

2017-04-05 14:15:50.160  INFO 12432 --- [       Thread-1] c.c.xenia.config.CacheConfiguration      : Closing Cache Manager
2017-04-05 14:15:50.165 DEBUG 12432 --- [       Thread-1] c.e.c.E.consoft.xenia.domain.Authority   : Close successful.
2017-04-05 14:15:50.166 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.x.d.User.persistentTokens      : Close successful.
2017-04-05 14:15:50.168 DEBUG 12432 --- [       Thread-1] .E.c.x.d.p.w.p.w.I.datiSingoloVersamento : Close successful.
2017-04-05 14:15:50.169 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.x.d.p.w.p.w.InviaCarrPosOutput : Close successful.
2017-04-05 14:15:50.171 DEBUG 12432 --- [       Thread-1] .d.p.w.g.w.InserimentoPosizioneInputType : Close successful.
2017-04-05 14:15:50.172 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.xenia.domain.PlacementTest     : Close successful.
src和dest字符串分别为: src:

C:\Users\Administrator\Documents\NetBeansProjects\Xenia\src\main\resources\templateAgid.pdf

目的地:

C:\Users\Administrator\Documents\NetBeansProjects\Xenia\src\main\resources\Avviso_Pagamento_001385698469599575.pdf


您不应该在这些位置创建文件,因为它旁边的类路径在我们的实际生产环境中很可能会失败…为tom编写一些其他路径,如
/tmp
java.io.tmpdir
…是的,应用程序会重新启动,因为您的pom.xml具有监视源路径更改的sprinb引导开发工具并重新加载你的应用程序。
2017-04-05 14:15:50.160  INFO 12432 --- [       Thread-1] c.c.xenia.config.CacheConfiguration      : Closing Cache Manager
2017-04-05 14:15:50.165 DEBUG 12432 --- [       Thread-1] c.e.c.E.consoft.xenia.domain.Authority   : Close successful.
2017-04-05 14:15:50.166 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.x.d.User.persistentTokens      : Close successful.
2017-04-05 14:15:50.168 DEBUG 12432 --- [       Thread-1] .E.c.x.d.p.w.p.w.I.datiSingoloVersamento : Close successful.
2017-04-05 14:15:50.169 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.x.d.p.w.p.w.InviaCarrPosOutput : Close successful.
2017-04-05 14:15:50.171 DEBUG 12432 --- [       Thread-1] .d.p.w.g.w.InserimentoPosizioneInputType : Close successful.
2017-04-05 14:15:50.172 DEBUG 12432 --- [       Thread-1] c.e.c.E.c.xenia.domain.PlacementTest     : Close successful.