Search code examples
mysqljspreportreportingbusiness-intelligence

how display blob image from mysql database in jreport


I need to display an image that we are entering as an record in MySql database as logo in the report i'm creating in JReport ,the column stores blob ,i'm getting follow error and image is broken. Error:

> 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)


Solution

  • The issue was not with my code ,after examining and researching I determined that issues was with auto-detector of JReport by changing the image preference to type jpg the issue was resolved.