在SpringBoot中采用22.6.1版本的 Aspose-Cad 进行 dxf转pdf失败
代码和报错截图见附件
example.zip (158.6 KB)
感谢,有结果了请及时通知我
具体demo项目可以看我上传的附件,我用demo的jar包在centos7环境下部署并通过以下方式访问的时候报错
curl -X POST http://127.0.0.1:8080/test/convert
-d “src=conic.dxf&dst=conic.dxf.pdf”
错误信息
class com.aspose.cad.cadexceptions.ImageLoadException: Image loading failed: ---> class com.aspose.cad.cadexceptions.ImageLoadException ---> java.lang.NullPointerException
--- End of inner exception stack trace ---
com.aspose.cad.internal.kl.k.a(Unknown Source)
com.aspose.cad.Image.a(Unknown Source)
com.aspose.cad.Image.load(Unknown Source)
com.example.asposedemo.control.TestConvert.convert(TestConvert.java:26)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
aspose-test.zip (10.2 KB)
@Suerte,
你好。 似乎 Spring Boot Maven 重新组装了库,因此更改了命名空间,这对于我们的产品来说是不允许的用例。 可能,您可以针对您的情况使用类似 JarClassLoader 的内容。
好的,十分感谢你的支持。
1 Like