项目在eclipse中可以运行,在idea中出现java.io.FileNotFoundException

mac2024-05-28  47

最近经常在Eclipse上跑的项目打算尝试使用Idea 工具,但是启动的时候遇到棘手的一个问题:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adminCommonController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'captchaServiceImpl': Unsatisfied dependency expressed through field 'imageCaptchaService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'imageCaptchaService' defined in class path resource [net/shop/boot/WebConfig.class]: Unsatisfied dependency expressed through method 'imageCaptchaService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'captchaEngine' defined in file [F:\java\common\target\classes\net\shop\CaptchaEngine.class]: Invocation of init method failed; nested exception is com.octo.captcha.CaptchaException: All tried paths :'C:\Users\niannian\AppData\Local\Temp\tomcat-docbase.2219837587488879077.8099\WEB-INF\captcha F:\java\.\C:\Users\AppData\Local\Temp\tomcat-docbase.2219837587488879077.8099\WEB-INF\captcha F:\C:\Users\AppData\Local\Temp\tomcat-docbase.2219837587488879077.8099\WEB-INF\captcha F:\java\admin\target\classes\C:\Users\niannian\AppData\Local\Temp\tomcat-docbase.2219837587488879077.8099\WEB-INF\captcha F:\java\common\target\classes\C:\Users\niannian\AppData\Local\Temp\tomcat-docbase.2219837587488879077.8099\WEB-INF\captcha ' is not a directory or cannot be read  

 

<!- 截图涉及一些项目名称 此处删去-->

 

查了很多帖子和经验,最后发现是配置问题,不是原生使用Idea生成的springboot 项目 可能存在这个问题

,项目启动的时候静态资源访问地址问题!

 

解决办法:

Idea : Run -- > Edit Config.... --> 选中你要修改的model项目或者项目,如下图:

 

 

问题完美解决!NICE!

 

最新回复(0)