标签: spring-boot glassfish-5
正如标题所述,该程序在tomcat中部署时运行良好。但是,当部署到我们的生产服务器glassfish中时,它将在此行中引发空指针异常。
@Autowired ServletContext context; FileOutputStream fileOut = new FileOutputStream(new File(context.getRealPath("resources/"+filename)));