Skip to content

jar 包上传到服务器后 autopoi 读取不到excel模版文件 #1505

Closed
@lihanxie

Description

@lihanxie
版本号:

2.2.1

问题描述:

jeecg-boot 打成jar包放服务器后, 读取不到excel模版文件

截图&代码:
   TemplateExportParams params = new TemplateExportParams();
    params.setTemplateUrl(**relativePath**);
    params.setScanAllsheet(true);
    ModelAndView mv = new ModelAndView(new JeecgTemplateExcelView());
    mv.addObject(TemplateExcelConstants.MAP_DATA, productMap);
    mv.addObject(TemplateExcelConstants.FILE_NAME, templateName);
    mv.addObject(TemplateExcelConstants.PARAMS, params);
    mv.addObject(TemplateExcelConstants.CLASS, TBaseProductEntity.class);

2020-07-24 15:34:59.452 [http-nio-6080-exec-9] ERROR org.jeecgframework.poi.cache.manager.FileLoade:58 - home/eps/jeecg-boot/tts-module-system-2.2.0.jar!/BOOT-INF/classes!/import/订单导入/FBA订单模板.xlsx (没有那个文件或目录)
java.io.FileNotFoundException: home/eps/jeecg-boot/tts-module-system-2.2.0.jar!/BOOT-INF/classes!/import/订单导入/FBA订单模板.xlsx (没有那个文件或目录)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileInputStream.(FileInputStream.java:93)
at org.jeecgframework.poi.cache.manager.FileLoade.getFile(FileLoade.java:47)
at org.jeecgframework.poi.cache.manager.POICacheManager$1.load(POICacheManager.java:48)
at org.jeecgframework.poi.cache.manager.POICacheManager$1.load(POICacheManager.java:45)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
at com.google.common.cache.LocalCache.get(LocalCache.java:3952)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
at org.jeecgframework.poi.cache.manager.POICacheManager.getFile(POICacheManager.java:56)

友情提示: 未按格式要求发帖,会直接删掉。

Activity

zhangdaiscott

zhangdaiscott commented on Jul 24, 2020

@zhangdaiscott
Member

是导入还是导出,那个功能?

lihanxie

lihanxie commented on Jul 24, 2020

@lihanxie
Author

导出功能。 放置了excel模版在resources 中, IDEA 中运行是可以成功下载excel 模版文件的, 但是打包jar 放到服务器后就不行

lihanxie

lihanxie commented on Jul 24, 2020

@lihanxie
Author

#1010 和这个有点类似

1298191366

1298191366 commented on Jul 30, 2020

@1298191366
Contributor

已修改,待新版本发布

zhangdaiscott

zhangdaiscott commented on Aug 16, 2020

@zhangdaiscott
Member

升到1.2.1就可以解决此问题

	<dependency>
		<groupId>org.jeecgframework</groupId>
		<artifactId>autopoi-web</artifactId>
		<version>1.2.1</version>
		<exclusions>
			<exclusion>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zhangdaiscott@lihanxie@1298191366

        Issue actions

          jar 包上传到服务器后 autopoi 读取不到excel模版文件 · Issue #1505 · jeecgboot/JeecgBoot