gpt4 book ai didi

java.net.MalformedURLException : no protocol:

转载 作者:行者123 更新时间:2023-11-30 07:33:44 30 4
gpt4 key购买 nike

我正在使用 birt-2_6_1 和 tomcat 7 以及 eclipse IDE 来生成报告。我已经完成了生成图表的编码并将它们以 png 格式保存在 tem 位置。但是当我在我的可下载 pdf 文件中导出这些图像时,它不会将这些图像显示到下载的文件中,既不是 pdf 格式也不是 excel 格式。是否抛出此异常:

java.net.MalformedURLException: no protocol: /Softwares/new_tomcat/tomcat7/temp/jfreechart-299441806335424490.png
at java.net.URL.<init>(URL.java:567)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.eclipse.birt.report.engine.emitter.ImageReader.readImage(ImageReader.java:179)
at org.eclipse.birt.report.engine.emitter.ImageReader.read(ImageReader.java:80)
at org.eclipse.birt.report.engine.nLayout.area.impl.ImageAreaLayout.initialize(ImageAreaLayout.java:83)
at org.eclipse.birt.report.engine.nLayout.area.impl.ImageAreaLayout.layout(ImageAreaLayout.java:72)
at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startContent(LayoutEngine.java:488)
at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startImage(ContentEmitterAdapter.java:174)
at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startImage(CompositeContentEmitter.java:274)
at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:74)
at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:116)
at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:287)
at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:139)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:99)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:180)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at com.i10n.fleet.util.ReportExporter.**exportReport(ReportExporter.java:98**)
at com.i10n.fleet.web.controllers.ExportReportOperations.**ExportVehicleReport(ExportReportOperations.java:596)**
at com.i10n.fleet.web.controllers.ExportReportOperations.**generateVehicleReport(ExportReportOperations.java:497)**
at com.i10n.fleet.web.controllers.ExportReportsController.**processRequest(ExportReportsController.java:131)**
at com.i10n.fleet.web.controllers.ExportReportsController.**handleRequestInternal(ExportReportsController.java:71)**
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at com.i10n.fleet.web.controllers.CascadedFormController.handleRequest(CascadedFormController.java:47)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:859)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:282)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:357)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1687)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

我用于此任务的所有上述粗体字母文件。但它在这一行中显示错误:

vehicleReportTask.run();

其中 vehicleReportTaskRunAndRenderTask,它保存着要在报告中显示的 png 图像。这就是我存储到任务中的方式:

vehicleReportTask.setParameterValue("image", imgPath + filename);

它从很久以前就给出了同样的错误,所以如果有人能帮助我解决这个问题,那将对我很有帮助。如果需要任何输入,请随时询问。我可以给你发邮件,我的电子邮件 ID 是:vikramfartyal@gmail.com

最佳答案

java.net.MalformedURLException: no protocol表示缺少协议(protocol),如file://http://

尝试通过向 imgPath 添加协议(protocol)前缀来传递这样的 URL:file:///Softwares/new_tomcat/tomcat7/temp/jfreechart-299441806335424490.png

关于java.net.MalformedURLException : no protocol: <user url>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5661899/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com