Applet not Loading

User 3d7989d1a7

09-06-2010 21:28:21

I have worked at this off and on for a couple of weeks, but am not being successful in getting Marvin running on my campus web server.  I can serve it off my machine on the local home network just fine.   I can set the path for the license and the configuration files to the campus server and they are read locally just fine, so I know they are correct.  However, when I try to launch the applet on a simple page on the campus server, I get the following error message in the Java Console:



load: class chemaxon/marvin/applet/JMSketch not found.


java.lang.ClassNotFoundException: chemaxon.marvin.applet.JMSketch


at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:211)


at java.lang.ClassLoader.loadClass(ClassLoader.java:307)


at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:144)


at java.lang.ClassLoader.loadClass(ClassLoader.java:248)


at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:662)


at sun.applet.AppletPanel.createApplet(AppletPanel.java:785)


at sun.plugin.AppletViewer.createApplet(AppletViewer.java:2354)


at sun.applet.AppletPanel.runLoader(AppletPanel.java:714)


at sun.applet.AppletPanel.run(AppletPanel.java:368)


at java.lang.Thread.run(Thread.java:637)


The HTML file (Trial.htm) is located in the directory called Drawing. Right next to it is the marvin directory and Trial points to that directory.  The fact that it can be found locally indicates that the pointer is correct.


Here is my fear.  My campus server is very case dependent.  Where is JMSketch.jar and is it really named exactly that, including caps.  If not, it will fail on the campus server and is currently the only thing I can think of.


The following script is what I am using to load the file -- with addresses changed to protect the innocent:-).




<script LANGUAGE="JavaScript1.1" SRC="marvin/marvin.js"></script>

<script LANGUAGE="JavaScript1.1">


marvin_jvm = "builtin"; // "builtin" or "plugin"
msketch_name = "MSketch"
msketch_begin("Marvin", 550, 375); // arguments: CODEBASE, WIDTH, HEIGHT
msketch_param("molbg","#eaf2ff");
msketch_param("menubar","false");
//msketch_param("menuconfig", "xxxxxxxxx/Sites/chemaxon/BaysConfig.xml"); // local Sites Configuration Path
//msketch_param("menuconfig", "xxxxxxx/Sites/chemaxon/license.cxl"); // local Sites License Path
msketch_param("menuconfig", "http://xxxxxx/chemaxon/BaysConfig.xml"); // SMC path
msketch_param("licenseFile", "http://xxxxxxx/chemaxon/license.cxl"); // SMC License Path
msketch_end();

</script>


ChemAxon 7c2d26e5cf

09-06-2010 22:13:29



<script LANGUAGE="JavaScript1.1" SRC="marvin/marvin.js"></script>

<script LANGUAGE="JavaScript1.1">

marvin_jvm = "builtin"; // "builtin" or "plugin"
msketch_name = "MSketch"
msketch_begin("Marvin", 550, 375); // arguments: CODEBASE, WIDTH, HEIGHT
msketch_param("molbg","#eaf2ff");
msketch_param("menubar","false");
//msketch_param("menuconfig", "xxxxxxxxx/Sites/chemaxon/BaysConfig.xml"); // local Sites Configuration Path
//msketch_param("menuconfig", "xxxxxxx/Sites/chemaxon/license.cxl"); // local Sites License Path
msketch_param("menuconfig", "http://xxxxxx/chemaxon/BaysConfig.xml"); // SMC path
msketch_param("licenseFile", "http://xxxxxxx/chemaxon/license.cxl"); // SMC License Path
msketch_end();

</script>





To be able to load the applet, both marvin.js reference and codebase value has to be correct.
I have highlighted the differences between the two references in your code.
Since the browser could evaluate JavaScript code (msketch_begin(....)) whose definition is located in marvin.js from the marvin directory, it means the the relative URL is fine in this case.
If Java console is displayed, it indicates that generating applet code (by marvin.js) is correct.
The error is thrown by Java because it could not find the required jmarvin.jar in the directory that is given in the codebase attribute (first parameter of msketch_begin).
I assume if you modify the codebase value from "Marvin" to "marvin", the problem will be solved.
If it does not help, give the absolute URL of the marvin directory as codebase in the above example.

User 3d7989d1a7

09-06-2010 23:28:58

Sorry, I should have caught that.   Thanks!!