Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JEditorPane.setText() failed with JRE 6 update 14

843807Jun 22 2010 — edited Jun 22 2010
Recently our organization decided to upgrade all the software versions the application is based upon. As a part of the effort, JRE was upgraded from Java 6 update 3 to update 20.
Application has a thick client (front end) with lot of usage of applets and various swing components. In one of the applets, JEditorPane is used to display some rich text format to the user. The content that is set onto the JEditorPane is huge, however the code works fine with JRE update 3 and same is in the production.

When tried to run the same code with update 20 (with next-generation plugin disabled) it throws ArrayIndexOutOfBound exception while generating the view.
Hence tested against all the JRE versions starting with JRE 6 update 4 and found that the issue occurs between update 13 and update 14

Exception that is genetated on the console is copied below. You can see below that up until EPane.setText(EPane.java:453) is our application code and the view is getting generated by underlying code after that.

Any input on this would be helpful!!

Thanks in advance,

Umesh

Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: -1
at javax.swing.text.CompositeView.getView(Unknown Source)
at javax.swing.text.TextLayoutStrategy$AttributedSegment.getFont(Unknown Source)
at javax.swing.text.TextLayoutStrategy$AttributedSegment.getAttribute(Unknown Source)
at javax.swing.text.TextLayoutStrategy$AttributedSegment.getAttributes(Unknown Source)
at java.awt.font.TextLine.getFontAtCurrentPos(Unknown Source)
at java.awt.font.TextMeasurer.initAll(Unknown Source)
at java.awt.font.TextMeasurer.<init>(Unknown Source)
at java.awt.font.LineBreakMeasurer.<init>(Unknown Source)
at javax.swing.text.TextLayoutStrategy.sync(Unknown Source)
at javax.swing.text.TextLayoutStrategy.insertUpdate(Unknown Source)
at javax.swing.text.FlowView.loadChildren(Unknown Source)
at javax.swing.text.CompositeView.setParent(Unknown Source)
at javax.swing.text.FlowView.setParent(Unknown Source)
at javax.swing.text.html.ParagraphView.setParent(Unknown Source)
at javax.swing.text.CompositeView.replace(Unknown Source)
at javax.swing.text.BoxView.replace(Unknown Source)
at javax.swing.text.CompositeView.loadChildren(Unknown Source)
at javax.swing.text.CompositeView.setParent(Unknown Source)
at javax.swing.text.html.BlockView.setParent(Unknown Source)
at javax.swing.text.CompositeView.replace(Unknown Source)
at javax.swing.text.BoxView.replace(Unknown Source)
at javax.swing.text.CompositeView.loadChildren(Unknown Source)
at javax.swing.text.CompositeView.setParent(Unknown Source)
at javax.swing.text.html.BlockView.setParent(Unknown Source)
at javax.swing.text.CompositeView.replace(Unknown Source)
at javax.swing.text.BoxView.replace(Unknown Source)
at javax.swing.text.CompositeView.loadChildren(Unknown Source)
at javax.swing.text.CompositeView.setParent(Unknown Source)
at javax.swing.text.html.BlockView.setParent(Unknown Source)
at javax.swing.text.html.HTMLEditorKit$HTMLFactory$BodyBlockView.setParent(Unknown Source)
at javax.swing.text.CompositeView.replace(Unknown Source)
at javax.swing.text.BoxView.replace(Unknown Source)
at javax.swing.text.CompositeView.loadChildren(Unknown Source)
at javax.swing.text.CompositeView.setParent(Unknown Source)
at javax.swing.text.html.BlockView.setParent(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.setView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.setView(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI.modelChanged(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.fireInsertUpdate(Unknown Source)
at javax.swing.text.DefaultStyledDocument.create(Unknown Source)
at javax.swing.text.html.HTMLDocument.create(Unknown Source)
at javax.swing.text.html.HTMLDocument$HTMLReader.flushBuffer(Unknown Source)
at javax.swing.text.html.HTMLDocument$HTMLReader.addContent(Unknown Source)
at javax.swing.text.html.HTMLDocument$HTMLReader.addContent(Unknown Source)
at javax.swing.text.html.HTMLDocument$HTMLReader.handleText(Unknown Source)
at javax.swing.text.html.parser.DocumentParser.handleText(Unknown Source)
at javax.swing.text.html.parser.Parser.handleText(Unknown Source)
at javax.swing.text.html.parser.Parser.endTag(Unknown Source)
at javax.swing.text.html.parser.Parser.parseTag(Unknown Source)
at javax.swing.text.html.parser.Parser.parseContent(Unknown Source)
at javax.swing.text.html.parser.Parser.parse(Unknown Source)
at javax.swing.text.html.parser.DocumentParser.parse(Unknown Source)
at javax.swing.text.html.parser.ParserDelegator.parse(Unknown Source)
at javax.swing.text.html.HTMLEditorKit.read(Unknown Source)
at endoworks.ui.editors.EPane.setText(EPane.java:453)
at endoworks.ui.editors.EStyledEditorPane.setText(EStyledEditorPane.java:2233)
at endoworks.ui.procedurenote.ProcedureNote.generateText(ProcedureNote.java:4750)
at endoworks.ui.procedurenote.ProcedureNote.textGenerated(ProcedureNote.java:4621)
at endoworks.ui.procedurenote.KBTabPanel.fireTextGenerated(KBTabPanel.java:1471)
at endoworks.ui.procedurenote.KBTabPanel.textGenerated(KBTabPanel.java:1398)
at endoworks.ui.procedurenote.TreePanel.fireTextGenerated(TreePanel.java:416)
at endoworks.ui.procedurenote.TreePanel.clickGenerateButton(TreePanel.java:1521)
at endoworks.ui.procedurenote.TreePanel$ButtonHandler.actionPerformedHandler(TreePanel.java:1609)
at endoworks.ui.procedurenote.TreePanel$ButtonHandler.actionPerformed(TreePanel.java:1589)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2010
Added on Jun 22 2010
1 comment
204 views