unable to load marvinsketch into a web browser

User ddf03b522f

22-07-2006 08:56:14

Hi





I've been trying to load marvin sketch into a web browser but I keep getting the following status bar error message





Code:
unable to initiate Msketch and java.lang.NullpointerException









I have been using the following applet code in a test.html web page to initiate the applet, the test.html page and the marvin.jar files are in the same directory:





Code:
<applet ARCHIVE="marvin.jar" CODE="MSketch" WIDTH=460 HEIGHT=380>


<strong>(YOU CANNOT SEE A JAVA APPLET HERE)</strong>


</applet>











I dont think there is any thing wrong with the browser settings becuase the applets loads fine from your example developer sites.

ChemAxon 7c2d26e5cf

24-07-2006 16:17:32

Probably, one or more files are missing for running the applet. In the following topic, you can read which files are required for Marvin applets: http://www.chemaxon.com/forum/ftopic64.html

User ddf03b522f

24-07-2006 19:36:27

I dont think any files are missing becuase the marvinsketch applet loads fine from another computer using the the same browser, however only the AWT version seems to load. I still cant get the swing version to load.





how is it that it loads on one computer using the same browser version but not another yet on the computer/browser on which both the AWT and Swing versions do not work, seems to load both these applet versions fine from your example sites?

ChemAxon 7c2d26e5cf

25-07-2006 09:54:50

Giving the "codebase" attribute may be help.


Code:
<applet ARCHIVE="marvin.jar" CODE="MSketch" CODEBASE="." WIDTH=460 HEIGHT=380></applet>
Quote:
however only the AWT version seems to load. I still cant get the swing version to load.
Probably, you use Internet Explorer and there is no installed Sun's Java Plugin on your machine. IE includes a built in Java (1.1 compatible) that can run only the AWT version of the applet. To use the swing version, install a Sun's Java to your machine.


If you use the marvin.js interface and specify "plugin" as prefered JVM, the browser will run the swing applet with Java Plugin. If the Java Plugin is missing, the browser can install it automatically by loading of the applet.


Code:
marvin_jvm="plugin"


msketch_begin(".", 460,380);


msketch_end();

User ddf03b522f

25-07-2006 10:39:09

The browser does have plugin support becuase it loads both the swing and AWT versions fine from your example site. If it did not have plugin support applets from your example sites would not load either.





It just doesnt seem to load the applet from the web server i am hosting it on. however when i view the same page from a different computer the AWT version seems to load. It seems that marvinsketch applet does have some compatiblity issues.





Any suggestions?

ChemAxon 7c2d26e5cf

25-07-2006 11:20:17

Check the access log of the server. If clients' http requests are logged, you can investigate that which file is missing from server (which request was not completed).


I use Tomcat web server (for debugging), its access log looks like this:


Code:
10.0.0.106 - - [25/Jul/2006:12:23:56 1000] "GET /test/0725/marvin/img/loading.gif HTTP/1.1" 200 304


10.0.0.106 - - [25/Jul/2006:12:23:56 1000] "GET /test/0725/marvin/jmarvin.jar HTTP/1.1" 200 719825


10.0.0.106 - - [25/Jul/2006:12:24:03 1000] "GET /test/0725/marvin/chemaxon/marvin/dict.class HTTP/1.1" 404 797



You can find the log file in the Tomcat's log subdirectory (e.g.: jakarta-tomcat-4.1.24/logs/localhost_access_log.2006-07-25.txt )


If a file is not found on the server, the HTTP status of the request will be "404". ("200" signs that the request was completed.)


You can read more about HTTP status codes in the following document: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html





Checking the Java Console of the browser can also be useful. There can be a stack trace about the error.


You can also print debug messages in Java console by increasing trace level to 4 (by pressing '4'). On level 4, net communication and caching info are also printed.

User ddf03b522f

25-07-2006 20:23:08

Hi





I get the following error message in the java console:


Code:
load: class MSketch not found.


java.lang.ClassNotFoundException: MSketch


   at sun.applet.AppletClassLoader.findClass(Unknown Source)


   at java.lang.ClassLoader.loadClass(Unknown Source)


   at sun.applet.AppletClassLoader.loadClass(Unknown Source)


   at java.lang.ClassLoader.loadClass(Unknown Source)


   at sun.applet.AppletClassLoader.loadCode(Unknown Source)


   at sun.applet.AppletPanel.createApplet(Unknown Source)


   at sun.plugin.AppletViewer.createApplet(Unknown Source)


   at sun.applet.AppletPanel.runLoader(Unknown Source)


   at sun.applet.AppletPanel.run(Unknown Source)


   at java.lang.Thread.run(Unknown Source)


Caused by: java.io.IOException: open HTTP connection failed.


   at sun.applet.AppletClassLoader.getBytes(Unknown Source)


   at sun.applet.AppletClassLoader.access$100(Unknown Source)


   at sun.applet.AppletClassLoader$1.run(Unknown Source)


   at java.security.AccessController.doPrivileged(Native Method)


   ... 10 more


Exception in thread "Thread-4" java.lang.NullPointerException


   at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)


   at sun.plugin.AppletViewer.showAppletException(Unknown Source)


   at sun.applet.AppletPanel.runLoader(Unknown Source)


   at sun.applet.AppletPanel.run(Unknown Source)


   at java.lang.Thread.run(Unknown Source)


java.lang.NullPointerException


   at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)


   at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)


   at sun.applet.AppletPanel.run(Unknown Source)


   at java.lang.Thread.run(Unknown Source)


Exception in thread "thread applet-MSketch" java.lang.NullPointerException


   at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)


   at sun.plugin.AppletViewer.showAppletException(Unknown Source)


   at sun.applet.AppletPanel.run(Unknown Source)


   at java.lang.Thread.run(Unknown Source)


Trace level set to 4: basic, net, security, ext ... completed.








The access log for the server is as follows:





Code:
#Software: Microsoft Internet Information Services 6.0


#Version: 1.0


#Date: 2006-07-25 20:49:17


#Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken


2006-07-25 20:49:17 W3SVC6457 S3 85.13.212.67 GET /marvin/dev/doc/index.html - 80 - 193.63.48.48 HTTP/1.0 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) - - www.bio-farma.com 404 0 3 1606 550 15


2006-07-25 20:49:17 W3SVC6457 S3 85.13.212.67 GET /marvin/dev/doc/custom404.css - 80 - 193.63.48.48 HTTP/1.0 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) ASPSESSIONIDAQARABRA=JPKBAIDDMPAKOIJALGPINOLO http://www.bio-farma.com/marvin/dev/doc/index.html www.bio-farma.com 404 0 3 1539 508 15


2006-07-25 20:50:16 W3SVC6457 S3 85.13.212.67 GET /marvin/img/loading.gif - 80 - 193.63.48.48 HTTP/1.0 Mozilla/4.0+(Windows+XP+5.1)+Java/1.5.0_06 ASPSESSIONIDAQARABRA=JPKBAIDDMPAKOIJALGPINOLO - www.bio-farma.com 304 0 0 237 509 46


2006-07-25 20:50:16 W3SVC6457 S3 85.13.212.67 GET /marvin/JMSketch.class - 80 - 193.63.48.48 HTTP/1.0 Mozilla/4.0+(Windows+XP+5.1)+Java/1.5.0_06 ASPSESSIONIDAQARABRA=JPKBAIDDMPAKOIJALGPINOLO - www.bio-farma.com 404 0 2 1539 458 0


2006-07-25 20:50:17 W3SVC6457 S3 85.13.212.67 GET /marvin/JMSketch.class - 80 - 193.63.48.48 HTTP/1.0 Mozilla/4.0+(Windows+XP+5.1)+Java/1.5.0_06 ASPSESSIONIDAQARABRA=JPKBAIDDMPAKOIJALGPINOLO - www.bio-farma.com 404 0 2 1539 458 0








Any suggestions whats wrong?





Please view the following site upon which I am trying to test this marvinsketch applet:


Code:
http://www.bio-farma.com/marvin/doc/dev/example-sketch1.1.html?jvm=builtin&gui=awt















This same computer/browser will load the same applet from your example site without any problems! Can't understand whats wrong with the above site?

ChemAxon 7c2d26e5cf

26-07-2006 12:46:59

There may be a configuration problem on your local machine. I have checked the MarvinSketch example on bio-farma site. It works fine for me.





Cleaning Java cache may be help. Probably, old and new versions of classes/jars are mixing that causes this error.


In the following topic, you can read how to clean cache: http://www.chemaxon.com/forum/ftopic556.html





If it is not help, try to reinstall your Java Runtime Environment (JRE).


Probably, something is wrong in Java's settings.

User ddf03b522f

26-07-2006 21:14:21

Hi





I have tried everything you have suggested but the applet from the bio-farma site will not load from my computer. Yet the applet from chemaxons example site loads fine





Whne i try to refresh the page on bio-farma site i keep getting the following iexplore.exe - application error message:





Code:
The instruction at " 0x76235686" referenced memory at "0x00000010". The memory could not be "read"






Any idea why that is?





Also can you check if the swing version loads from the following site:





Code:
http://www.bio-farma.com/marvin/doc/dev/example-sketch1.1.html?jvm=builtin&gui=swing

ChemAxon 7c2d26e5cf

26-07-2006 22:40:30

If the problem exists only with applets from the bio-farma site, update Marvin (remove current marvin directory and expand marvin-all-4.0.6.zip to the same location). I am not sure that it will help but I have no more idea.