error in IE 9 loading MSketch with empty molecule

User 870ab5b546

03-10-2012 19:28:31

I recently got a dual-boot machine, so I've been trying some things on Internet Explorer 9.


Loading a JSP page with a Marvin applet recently, I got this error:


ERROR: 
No such child: -1

STACK TRACE:
java.lang.ArrayIndexOutOfBoundsException: No such child: -1
at java.awt.Container.getComponent(Unknown Source)
at chemaxon.marvin.sketch.swing.SketchPanel.setStatusBarVisible(Unknown Source)
at chemaxon.marvin.sketch.swing.SketchPanel.molInit(Unknown Source)
at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source)
at chemaxon.marvin.applet.AbstractMarvinApplet$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(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)

MarvinSketch then hung, and never finished loading.  I did not get this error in any other browser that I tried (e.g., Chrome on PC).


Here's the code we use to load MarvinSketch:


<script type="text/javascript">
// <!--
startMSketch('', MARVIN, 'evalApplet', !LOAD_SELECTIONS, 'marvin');
// -->
</script>


var LOAD_SELECTIONS = true;
function startMSketch(marvinMol, qFlagsJS, appletName, loadSelections,
marvinVersion) {
// if qFlagsJS is negative, size of panel is opposite from usual
var qFlagsNeg = qFlagsJS < 0;
qFlagsJS = Math.abs(qFlagsJS);
var majorType = qFlagsJS & MAJORTYPEMASK;
var isMechanism = majorType == MECHANISM;
var isSynthesis = majorType == SYNTHESIS;
var panelWidth = 450;
var panelHeight = (appletName == 'responseApplet'
|| appletName == 'synthAuthApplet'
|| appletName == 'hybridMarvin'
|| appletName == 'pKaMarvin'
|| appletName == 'targetapplet'
|| appletName == 'queryapplet'
|| appletName == 'evalApplet'
? 400 : 350);
if (((isMechanism || isSynthesis) && !qFlagsNeg)
|| (!isMechanism && !isSynthesis && qFlagsNeg)) {
panelWidth = 500;
panelHeight = (appletName == 'responseApplet' ? 530 : 500);
}
var is3D = (qFlagsJS & THREEDIM) != 0;
var valenceErrorVisible = new String((qFlagsJS & BADVALENCEINVISIBLE) == 0);
// special case for public/comparetwo.jsp, skeletons.jsp,
// public/ACEStructure/synthTest.jsp, pasteSynthTest.jsp,
// authortool/evaluators/loadEvaluatorStruct.jsp.h
var extraBonds = (appletName == 'targetapplet'
|| appletName == 'queryapplet'
|| appletName == 'synthAuthApplet'
|| appletName == 'evalApplet'
? 'wedge,either,coordinate,arom,any,aromany,1or2,ctu'
: 'wedge,either,arom,coordinate');
// special case for public/hybrids.jsp, pKa.jsp, parity.jsp, testMarvin.jsp
var atomNumbers = (appletName == 'hybridMarvin' ? 'true' : 'false');

msketch_name = appletName;
msketch_begin('/nosession/' + marvinVersion, panelWidth, panelHeight);
msketch_param('molbg', '#ffffff');
var hydrogensVisible = getHVisibility(qFlagsJS);
var configurationFile = 'configuration'
+ (appletName == 'synthAuthApplet'
|| appletName == 'targetapplet'
|| appletName == 'queryapplet' ? 'SynthAuth'
: isSynthesis ? 'Synth'
: isMechanism ? 'Mech'
: is3D ? '3D'
: hydrogensVisible != 'heteroterm' ? 'ImplicitH'
: 'Normal')
+ '.xml';
msketch_param('menuconfig', configurationFile);
// tried to change name of ACENewmanProjs.mrv to ACEConformers.mrv, but
// wouldn't work; don't know why not
msketch_param('ttmpls0', '*Generic*chemaxon/marvin/templates/ACE'
+ (is3D ? 'NewmanProjs.mrv' : 'Generics.t'));
if (!is3D) msketch_param('tmpls6',
':Conformers:chemaxon/marvin/templates/ACENewmanProjs.mrv');
msketch_param('abbrevgroups', 'chemaxon/marvin/templates/ACE.abbrevgroups');
msketch_param('scale', '32'); // C-C bond length in pixels; also increases font size
msketch_param('implicitH', hydrogensVisible);
msketch_param('sketchCarbonVisibility', getCVisibility(qFlagsJS));
msketch_param('lonePairsVisible', getLonePairsVisible(qFlagsJS));
msketch_param('valenceErrorVisible', valenceErrorVisible);
msketch_param('valencePropertyVisible', 'false');
msketch_param('chiralitySupport', getRSLabelsVisible(qFlagsJS));
msketch_param('atomMappingVisible', getAtomMapping(qFlagsJS));
msketch_param('atomNumbersVisible', atomNumbers);
msketch_param('atomPropertiesVisible', 'false');
msketch_param('mol', marvinMol);
msketch_param('extraBonds', extraBonds);
msketch_param('reactionSupport', 'false');
msketch_param('skin', 'javax.swing.plaf.metal.MetalLookAndFeel');
msketch_param('legacy_lifecycle', !isLeopardSafari());
msketch_param('statusBar', 'true');
msketch_param('defaultTool', 'select');
if (loadSelections) msketch_param('molLoaderFinishedEvent',
'javascript:loadSelections();');
msketch_mayscript = true;
msketch_end();
} // startMSketch()

I did not get the error when the molecule to load into MarvinSketch was not empty:


<script type="text/javascript">
// <!--
startMSketch('<?xml version="1.0" ?>\r\n<MDocument>\r\n <MChemicalStruct>\r\n <molecule molID="m1">\r\n <atomArray\r\n atomID="a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11"\r\n elementType="C C C C C C C C C S C"\r\n x2="-7.350000000000001 -7.350000000000001 -8.683733333333334 -6.0162666666666675 -1.9282666666666668 -3.2522933333333337 -1.915386666666667 -0.5848266666666668 -0.5913600000000001 -4.682720000000001 -3.2586400000000006"\r\n y2="6.381760000000001 4.841760000000001 4.07176 4.07176 4.637360000000001 2.3215733333333337 1.5571733333333337 2.332773333333334 3.872960000000001 4.841760000000001 3.8617600000000003"\r\n \/>\r\n <bondArray>\r\n <bond atomRefs2="a2 a4" order="1" \/>\r\n <bond atomRefs2="a2 a1" order="1" \/>\r\n <bond atomRefs2="a2 a3" order="1" \/>\r\n <bond atomRefs2="a4 a10" order="1" \/>\r\n <bond atomRefs2="a5 a11" order="1" \/>\r\n <bond atomRefs2="a11 a6" order="2" \/>\r\n <bond atomRefs2="a6 a7" order="1" \/>\r\n <bond atomRefs2="a7 a8" order="2" \/>\r\n <bond atomRefs2="a8 a9" order="1" \/>\r\n <bond atomRefs2="a5 a9" order="2" \/>\r\n <bond atomRefs2="a10 a11" order="1" \/>\r\n <\/bondArray>\r\n <\/molecule>\r\n <\/MChemicalStruct>\r\n<\/MDocument>\r\n',
MARVIN, 'evalApplet', !LOAD_SELECTIONS,
'marvin');
// -->
</script>

Any ideas?

ChemAxon 5433b8e56b

13-11-2012 00:45:04

Hi Bob,


I am so sorry for the very late response on this issue, I tracked down lot's of things regarding your report, and it turned out that I am not able to find any scenario when this exception can be thrown that point, and i were not able to reproduce the issue.


Can you check that the problem still persists with the latest Marvin version, and if yes, can you give me some more simpler example where the exception happens on your site (as less parameter used as possible)? Also the used Java version can be useful.


Thank you for your patience, and sorry again for the long silence from me.


Regards,
Istvan