我需要在MySql数据库中显示我们作为记录输入的图像作为报告中的徽标我在JReport中创建,列存储blob,我得到跟随错误并且图像被破坏。 错误:
> UnSupportedImageFormat, pls use standard gif, jpg, bmp, png image. [AWT-EventQueue-0][ERROR][10 Mar 2017 15:50:02,480]
jet.datastream.render.UnSupportedImageTypeException: Unsupported image format
at jet.datastream.render.RenderGraphicsToolkit.createImage(SEDU:460)
at jet.datastream.render.RenderImage.locate(SEDU:66)
at jet.datastream.render.RenderCreator.createConcreteRender(SEDU:184)
at jet.datastream.DSField.createRender(SEDU:827)
at jet.datastream.DSField.getRender(SEDU:911)
at jet.thinviewer.JReportField.setProperty(SEDU:108)
at jet.thinviewer.JReportContainer.createComponent(SEDU:172)
at jet.thinviewer.JReportContainer.createChildren(SEDU:110)
at jet.thinviewer.JReportViewer.addChildWithoutNotify(SEDU:913)
at jet.thinviewer.JReportViewer.addChild(SEDU:785)
at jet.thinviewer.JReportViewer.run(SEDU:410)
at jet.thinviewer.JReportViewer.runThread(SEDU:337)
at jet.thinviewer.JReportViewer.reload(SEDU:756)
at com.jinfonet.designer.ui.formsheet.DesignerViewerPane.run(SEDU:342)
at com.jinfonet.designer.ui.formsheet.DesignerForm.addWindow(SEDU:482)
at com.jinfonet.designer.ui.formsheet.DesignerForm.runReportwithProgress(SEDU:404)
at com.jinfonet.designer.ui.formsheet.DesignerForm.add(SEDU:298)
at com.jinfonet.designer.ui.formsheet.DesignerForm.cancelRefreshDataView(SEDU:764)
at com.jinfonet.designer.ui.formsheet.DesignerForm.stateChanged(SEDU:753)
at javax.swing.JTabbedPane.fireStateChanged(JTabbedPane.java:416)
at javax.swing.JTabbedPane$ModelListener.stateChanged(JTabbedPane.java:270)
at javax.swing.DefaultSingleSelectionModel.fireStateChanged(DefaultSingleSelectionModel.java:132)
at javax.swing.DefaultSingleSelectionModel.setSelectedIndex(DefaultSingleSelectionModel.java:67)
at javax.swing.JTabbedPane.setSelectedIndexImpl(JTabbedPane.java:616)
at javax.swing.JTabbedPane.setSelectedIndex(JTabbedPane.java:591)
at javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.mousePressed(BasicTabbedPaneUI.java:3647)
at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:279)
at java.awt.Component.processMouseEvent(Component.java:6532)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4522)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

答案 0 :(得分:0)
问题不在于我的代码,经过检查和研究后,我通过将图像首选项更改为jpg类型确定问题与JReport的自动检测器有关,问题已得到解决。