JMSketch Applet not working ?

User 512caa4d13

25-09-2008 12:07:04

I am calling JMSketch applet is in a HTML page, but it has given following exception....





java.lang.NullPointerException


at chemaxon.marvin.sketch.swing.actions.AbstractSketchModeAction.isModeSelected(Unknown Source)


at chemaxon.marvin.sketch.swing.actions.AbstractSketchModeAction.update(Unknown Source)


at chemaxon.marvin.sketch.swing.actions.AbstractSketchModeAction.a(Unknown Source)


at chemaxon.marvin.sketch.swing.actions.AbstractSketchModeAction.isEnabled(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.ButtonBinding.k(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.ButtonBinding.p(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.ButtonBinding.h(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.ButtonBinding.<init>(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.ToggleButtonBinding.<init>(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.Bindings.bind(Unknown Source)


at chemaxon.marvin.uif.controller.impl.binding.BindingProvider.bind(Unknown Source)


at chemaxon.marvin.uif.controller.impl.item.ActionGroupToolbarController.createAndBindItem(Unknown Source)


at chemaxon.marvin.uif.controller.impl.item.AbstractItemController.getComponent(Unknown Source)


at chemaxon.marvin.uif.controller.impl.item.AbstractToolBarItemController.fill(Unknown Source)


at chemaxon.marvin.uif.controller.impl.ToolBarControllerImpl.fillContainer(Unknown Source)


at chemaxon.marvin.uif.controller.impl.AbstractTopLevelController.contentChanged(Unknown Source)


at chemaxon.marvin.uif.controller.impl.AbstractTopLevelController.getContainer(Unknown Source)


at chemaxon.marvin.uif.controller.impl.ToolBarControllerImpl.getToolBar(Unknown Source)


at chemaxon.marvin.uif.module.GUIModule.getToolBar(Unknown Source)


at chemaxon.marvin.uif.aloe.AloeDockHandler.a(Unknown Source)


at chemaxon.marvin.uif.aloe.AloeDockHandler.f(Unknown Source)


at chemaxon.marvin.uif.aloe.AloeDockHandler.a(Unknown Source)


at chemaxon.marvin.uif.aloe.AloeDockHandler.<init>(Unknown Source)


at chemaxon.marvin.sketch.swing.SketchPanel.molInit(Unknown Source)


at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source)


at chemaxon.marvin.common.swing.MolPanel.init(Unknown Source)


at JMSketch.a(Unknown Source)


at JMSketch.a(Unknown Source)


at JMSketch$1.run(Unknown Source)


at java.awt.event.InvocationEvent.dispatch(Unknown Source)


at java.awt.EventQueue.dispatchEvent(Unknown Source)


at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)








when I serched for the exception on internet it has given zero results. Please help to run the JMSketch applet to get the editor at client side.

ChemAxon 7c2d26e5cf

25-09-2008 17:01:03

There may be a configuration problem on your side. One or more jars or other resources are missing from your Marvin directory that are required for the MarvinSketch applet.


Please read the following topic: required files to run Marvin applets

User 512caa4d13

26-09-2008 06:12:15

Thank you for your reply Mr. Tamas,





Actually I was using the old version of MarvinBeans.jar; so was facing the exception.





I set the java.policy file also, so the exceptions related to security permissions and AWT Permission are sorted out. The JMSketch applet is now displaying the editor.





All versions of marvinbeans are available at





http://www.chemaxon.com/download.php?d=/data/download/marvin/archives/





I have used marvinbeans-lib-5_0_07-signed.zip, which solved my problems.





Also the following is an useful link to work with Java Policies:





http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/policytool.html








Thanks a lot once again.

ChemAxon 7c2d26e5cf

26-09-2008 15:20:06

The situation is not clear for me.


What do you use for display MarvinSketch applet?


The Marvin Appelts package is recommended for deploy applets.


The Marvin Beans package is designed for application developer or for server side support of JSP pages. The Marvin Beans API does not include the JMSketch.class.


The signed lib package for Marvin Beans is required for web start developers since web start accept only signed jars.


The jars in the Marvin Applets package is already signed.


Mixing of resources of Marvin Applets and Beans are not recommended, it can cause unexpected exceptions at runtime. (Both packages include more or less the same classes but they are compiled with different options.)

ChemAxon 7c2d26e5cf

26-09-2008 18:05:28

I assume that this problem is linking to your other post:


Extending JMSketch Applet in a java class, but giving errors

User 512caa4d13

29-09-2008 05:20:45

No, not really.





This is not related to my other post of extending JMSketch applet.





But when I tried to get the editor on browser with the following code:





<applet CODE="JMSketch.class" CODEBASE="config/appletjar" ARCHIVE="jmarvin.jar" WIDTH=540 HEIGHT=480>


<strong>Your browser does not support the applet tag.</strong>


</applet>





the java console thrown an exception stating that the DocPane class of aloe.jar file not found and similar class not found exception for MarvinBeans.jar file. So I added these jar files as a value in the archive attribute of applet tag in the HTML page. But then after adding the AWT and Security permissions, I got the mole editor in my browser.





Is there any other settings do I need to do, to avoid explicitly specifying the aloe.jar and MarvinBeans.jar file names in the Applet tag on HTML page?

ChemAxon 7c2d26e5cf

29-09-2008 10:12:35

Probably, one or more jars are missing from the "marvin" directory (where "jmarvin.jar" is located).


If the full content of marvin-bin-VERSION.zip is in this directory, the problem may be with the jar file.


Have you modified jmarvin.jar?


The the "Class-Path" record in the META-INF/MANIFEST.MF file contains the CLASSPATH info for the main jar of the applet. If it is missing, aloe and other required jars can not load-in.

User 512caa4d13

01-10-2008 06:08:53

Yes, It works.





I put all the jar files from marvin-all-5_0_07.zip and now it works with the following code





<applet CODE="JMSketch.class" CODEBASE="config/appletjar" ARCHIVE="jmarvin.jar" WIDTH=540 HEIGHT=480>


<strong>Your browser does not support the applet tag.</strong>


</applet>





for which I was facing some exceptions initially becaus I placesd on jmarvin.jar file at the mentioned codebase location. Thanks a lot for your guidance.