加载 iReport 4.5.1 新安装时出现以下错误消息:
java.lang.ArrayIndexOutOfBoundsException: 3184
at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:748)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:248)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:221)
at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$LazyWindowsIcon.createValue(WindowsLookAndFeel.java:1873)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:185)
at javax.swing.UIDefaults.get(UIDefaults.java:130)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getIcon(UIDefaults.java:411)
at javax.swing.UIManager.getIcon(UIManager.java:613)
at javax.swing.plaf.basic.BasicFileChooserUI.installIcons(BasicFileChooserUI.java:237)
at javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(BasicFileChooserUI.java:219)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:135)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:126)
at javax.swing.JComponent.setUI(JComponent.java:653)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1755)
at javax.swing.JFileChooser.setup(JFileChooser.java:366)
at javax.swing.JFileChooser.<init>(JFileChooser.java:341)
at javax.swing.JFileChooser.<init>(JFileChooser.java:300)
at com.jaspersoft.ireport.designer.options.IReportPanel.jButtonAddClasspathItemActionPerformed(IReportPanel.java:2216)
at com.jaspersoft.ireport.designer.options.IReportPanel.access$2000(IReportPanel.java:84)
at com.jaspersoft.ireport.designer.options.IReportPanel$27.actionPerformed(IReportPanel.java:938)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:5501)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
at java.awt.Component.processEvent(Component.java:5266)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3968)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
答案 0 :(得分:2)
这是 Vista 或 Windows 7 上运行的 iReport 的已知问题
您可以尝试将JVM升级到1.7(在某些情况下为1.6)版本。
有关详细信息,请参阅JasperForge.org上的这些帖子:
的更新:强> 的
您可以通过 ireport.conf
文件夹中的 iReport-x.y.z\etc
文件为iReport设置JDK。在jdkhome
属性的帮助下,我们可以设置JDK路径。
样本:
jdkhome="/path/to/jdk"
答案 1 :(得分:1)
我刚刚发现这个问题可能是由JDK版本之外的其他问题引起的。我在Windows 7上运行iReport 4.5.1并尝试JDK 1.6和1.7获得相同的错误。我发现问题与SQL语句(mssql 2008 R2中的存储过程)重新获得的某些字段有关。问题是将ntext字段转换为java.lang.String。我将字段类更改为java.sql.Clouds并发现生成了报告(但此列不可读)。当我弄乱不同的类型时,我发现问题是列宽。由于我的程序检索了许多参数,因此在向导生成的设计中有很多“瘦”列。当我在布局上调整(放大)ntext结果列并单击“预览”时,一切都很好,当列要填充数据时(一个字母宽度,因为换行是正确的)我收到此错误: 错误的填充打印... 0 java.lang.ArrayIndexOutOfBoundsException:0 我已经测试了几次,所以毫无疑问这是我的问题而不是JDK。