获取java.lang.noclassdeffounderror:com/aspose/cell
运行方法时,我会遇到错误,当我将代码作为tomcat服务器运行时。 “ java.lang.noclassdeffounderror:com/aspose/cells/fileformatutil” 我创建了一个春季启动项目。 我能够执行该方法:ISSAFE运行项目时,以Spring Boot
public static boolean isSafe(File f) throws Exception {
boolean safeState = false;
// try {
if ((f != null) && f.exists() && f.canRead()) {
// Perform a first check on Excel document format
FileFormatInfo formatInfo = FileFormatUtil.detectFileFormat(f.getAbsolutePath());
String formatExtension = FileFormatUtil.loadFormatToExtension(formatInfo.getLoadFormat());
''
我有错误, 当相同的项目作为服务器
I am getting error while running method, when i run the code as tomcat server.
"java.lang.NoClassDefFoundError: com/aspose/cells/FileFormatUtil"
I have created a spring boot project.
I am able to execute the method:isSafe when I run the project as Spring Boot
public static boolean isSafe(File f) throws Exception {
boolean safeState = false;
// try {
if ((f != null) && f.exists() && f.canRead()) {
// Perform a first check on Excel document format
FileFormatInfo formatInfo = FileFormatUtil.detectFileFormat(f.getAbsolutePath());
String formatExtension = FileFormatUtil.loadFormatToExtension(formatInfo.getLoadFormat());
'''
I have got the error,
When the same project run as a server
I have added the latest dependency for aspose cells.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我是一个想法用户。但是,认为您应该将图书馆包括在档案中(jar,war,ear)中。现在看来,它分别提供给了Class Path,而独立的Tomcat则没有他自己的Libs中的图书馆。
I'm an idea user. But think that you should include library as maven dependency and library will be packed in archive (jar,war,ear). Now it seems like it provided to classpath separately and standalone tomcat doesn't have that library in his own libs.