NPObject Error, Not able to interact with Marvin Editor

User 4616a6b00d

30-01-2014 04:03:45

Hi,


I came across a very strange issue, When I try to get the data from the Marvin Applet Editor using the getMol() method. The browser Java console throws the below error. This issue is faced only in some systems. So its very hard to find the actual reason for the issue.  This is one of the critical issue we are facing due to which development is paused. Does it have anything to do with Java update?. Pls respond ASAP.


Uncaught Error : Error calling method on NPObject 


regards,


MK



ChemAxon 4fa3cf533c

30-01-2014 10:18:43

Hello,


 


Could you provide us the html code which you use to deploy the applet? Preferably the method calls you use in it, and references to contentDocument would help.


Regards,


Tamas Fazekas-Vigh

User 4616a6b00d

30-01-2014 10:43:12

Here is the XHTML code :


Here is the code :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.org/schema/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:richext="http://java.sun.com/jsf/composite/richext"
xmlns:str="http://chemia/stringfunctions"
template="../layout/landingTemplateChemist.xhtml">

<ui:define name="body">
<!-- Start Molecule Editor Code -->
<script type="text/javascript" src="../marvin/marvin.js"></script>
<script type="text/javascript">

/** Javascript code to get MRV Data from Scheme Editor **/
function getMol(format) {
if(document.MSketch != null) {
var val = document.MSketch.getMol('mrv');

document.getElementById("frmMarvinSketch:moleculeTxt").value = val;
document.getElementById("form1:moleculeTxtM").value = val;
} else {
alert("Cannot import molecule:\n" +
"no JavaScript to Java communication in your browser.\n");
}
}
</script>
<h:form id="frmMarvinSketch">
<h:inputHidden id="moleculeTxt" value="#{experimentHome.mrvData}" />
<p:dialog id="marvinSketchEditor" modal="true" autosized="true"
minWidth="350" style="border-color:#3282BC;" width="850"
minHeight="130" left="100" top="50" resizable="false"
draggable="false" styleClass="globalPopupStyle" closable="false"
widgetVar="marvinSketchEditorVar">
<f:facet name="header">
<h:outputText id="alertHeader" value="Scheme Editor"></h:outputText>
<h:panelGroup style="float: right;">
<p:commandLink onclick="marvinSketchEditorVar.hide();showApplet('Y')" >
<h:graphicImage value="../img/close.png" id="hidelink1"
style="margin-top:1px;margin-right:1px;cursor:pointer;">
</h:graphicImage>
</p:commandLink>
</h:panelGroup>
</f:facet>
<h:panelGrid style="width:100%">
<center>
<script type="text/javascript">
var mrvData = document.getElementById("frmMarvinSketch:moleculeTxt").value;
var mrvLicensePath = document.getElementById("frmMarvinSketch:marvinLicenseTxt").value;

if(mrvData == null){
mrvData = "";
}
msketch_name="MSketch";
msketch_begin("../marvin/",800,400);
msketch_param("mol",mrvData);
msketch_end();
</script>
</center>
</h:panelGrid>
<richext:spacer height="10" />
<h:panelGrid style="width:100%">
<h:column>
<p:commandLink value="Cancel" styleClass="blueButton floatRight"
onclick="marvinSketchEditorVar.hide();showApplet('Y')">
</p:commandLink>
<!-- This method calls the getMol() method-->
<h:commandLink value="Save"
onclick="OkayToLeave(); getMol('mol');schemeEditorComplete(); showApplet('Y')" styleClass="blueButton floatRight" id="schemeSaveButton">
</h:commandLink>
</h:column>
</h:panelGrid>
</p:dialog>
</h:form>

<!-- Other Code-->

<!-- Section that displays the Applet-->
<h:inputHidden id="moleculeTxtM" value="#{experimentHome.mrvData}" />
<s:div id="appletContainer" rendered="#{experimentHome.mrvData != null and experimentHome.schemeEditorDataFlag}">
<center>
<script>
var mrvData = document.getElementById("frmMarvinSketch:moleculeTxt").value;
if(null == mrvData ){
mrvData = document.getElementById("form1:moleculeTxtM").value;
}
mview_begin("../marvin",600,250);
mview_param("mol",mrvData);
mview_end();
</script>
</center>
</s:div>
<!-- Other Code-->
</h:form>
</ui:define>
</ui:composition>de 



ChemAxon 4fa3cf533c

30-01-2014 12:41:13

Hi there,


 


Does this problem occur while using mozilla firefox web broswer ? Does the same thing happens when using other browsers ? Also, which java versions were used when the problem occured ?


 


Lastly, could it be related to this issue : https://www.chemaxon.com/forum/ftopic12000.html ?


 


Regards,


Tamas Fazekas-Vigh