Marvin View and Sketch freeze browser when loading

User 77bcbbb206

21-03-2005 17:19:36

Moderators,


Please find below a description of my problem and our conversation to date. I apologize for not using this forum yet.





---------------------------------------------------------------------





My Current Question:





I've removed the try catch blocks from the JavaScript and I still get the same problem of my browser freezing. I'm using the same page I sent you in my previous email. Any other ideas?





Here is the code used for the Marvin View applet:


<script LANGUAGE="JavaScript1.1">


<!--


mview_name="Struc_2";


mview_begin("marvin/", "125", "125");


mview_param("rows", "1");


mview_param("cols", "1");


mview_param("bgcolor", "#FFFFFF");


mview_param("cell0", "|[C-]#[N+]Cc1ccccc1");


mview_param("preload", "MolExport,SmilesExport,GraphInvariants,Parity");


mview_end();


//-->


</script>





Thanks in advance,


Jim





---------------------------------------------------------------








My Original Question:





I'm developing a web application reagent management system and I've run into some intermittent problems using both applets. I'm using marvin 3.5.4, java runtime 1.4.2_06-b03. Internet Explorer 6.0.2800, smiles, and ASP.NET (C#). The first and probably the most important problem is that when you open a web page with either applet on it, and the page loses focus (you check your email quickly or look at another web page) while the applets are loading, they freeze the browser. The browser never recovers from this and you have to close and re-open it. In all other instances (if the page load is not interrupted) the applets load perfectly. Hopefully I'm doing something wrong. Upon further investigation, it looks like the java runtime is freezing. If I try to open the java console (in the windows taskbar) after the web page stops responding, it won't open. ??? I've read over the FAQ's in the marvin source I downloaded from the web site and tried a few things but nothing seemed to help. Are there common mistakes you could point me to or advice as to what to look out for? The page cause the most problems has 5 separate applets loading (list page for reagent browsing). Here is the javascript from one of the applets. Attached please find the whole page. It does work (unless interrupted).








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


<script LANGUAGE="JavaScript1.1">


<!--


try


{


mview_name="Struc_2";


mview_begin("marvin/", "125", "125");


mview_param("rows", "1");


mview_param("cols", "1");


mview_param("bgcolor", "#FFFFFF");


mview_param("cell0", "|[C-]#[N+]Cc1ccccc1");


mview_param("preload", "MolExport,SmilesExport,GraphInvariants,Parity");


mview_end();


}


catch(er)


{


alert(er.message);


}


//-->


</script>








Your Original Answer:





Dear Jim,


You should delete the try - catch blocks from your JavaScript code. It


seems that try - catch blocks does not permit displaying signed applet


certification window if the applet's window is not in the focus.


Normally, the certification window should pop-up. It hangs on the


browser running until you submit it.


When I removed try - catch blocks from your code, the example works fine.


Best regards,


Tamas

ChemAxon 7c2d26e5cf

21-03-2005 18:31:46

Is the signed applet's certification window displayed before the browser freezing?

User 77bcbbb206

21-03-2005 18:38:13

Tamas wrote:
Is the signed applet's certification window displayed before the brower freezing?
I've selected the "Always Trust" choice from the applet download dialog so I no longer see the applet certification window, it just attempts to open.

ChemAxon 7c2d26e5cf

22-03-2005 10:19:34

I have not managed to reproduce browser freezing, although I have granted "Always trusted" option in the certification window.


Perhaps, it may be a JRE specific bug. Your example run fine on my machine with JRE 1.4.2_06.


You can check it easily by trying my attached example.


I have modified your code a bit: applets load Marvin from chemaxon.com. Do you manage to reproduce browser freezing with this example?


If the attached example does not cause freezing, it means that the problem in your Marvin installation. In this case, you should reinstall it. If applets hang the browser, it means that the problem is in your configuration. In this case, you should use a newer Java version.

User 77bcbbb206

22-03-2005 17:05:51

Sorry about not providing you with a reproducible example of the browser freezing before, but here it is. The attached page attempts to open a child window when it loads. The child window does not exist which opens a 404 error page. The child window loads, but the parent window freezes while loading the applets. Hopefully this will help.


Tamas wrote:
I have not managed to reproduce browser freezing, although I have granted "Always trusted" option in the certification window.


Perhaps, it may be a JRE specific bug. Your example run fine on my machine with JRE 1.4.2_06.


You can check it easily by trying my attached example.


I have modified your code a bit: applets load Marvin from chemaxon.com. Do you manage to reproduce browser freezing with this example?


If the attached example does not cause freezing, it means that the problem in your Marvin installation. In this case, you should reinstall it. If applets hang the browser, it means that the problem is in your configuration. In this case, you should use a newer Java version.

ChemAxon 7c2d26e5cf

23-03-2005 15:16:40

I have not managed to reproduce browser freezing with your latest example.


I have no idea what can be the problem on your side.


Have you tried to update Java?


Try to tell me step by step what you have done until browser freezing.

User 77bcbbb206

23-03-2005 16:48:54

I clicked on the link to download the latest html file. My computer is set up to automatically open html files downloaded. the file downloaded. The main page opened and began to load. The child window popped up. The parent window froze. Here is a gif of the results. You can see the child window open (404 page) and the parent window frozen while loading.





I have not tried to the Java update. I currently have 1.4.2_06 b03. The latest is 1.4.2_07. I really doubt that's the problem, but maybe a re-install will help. I'll try and let you know as soon as possible.
Tamas wrote:
I have not managed to reproduce browser freezing with your latest example.


I have no idea what can be the problem on your side.


Have you tried to update Java?


Try to tell me step by step what you have done until browser freezing.

User 77bcbbb206

23-03-2005 17:11:12

I just uninstalled all of my java runtimes, restarted my computer, navigated to a Marvin View applet, automatically downloaded the latest java engine from the Internet (1.4.2 b28) and am still seeing the same problem. I tried the link I sent yesterday with the same results????
jamoeder wrote:
I clicked on the link to download the latest html file. My computer is set up to automatically open html files downloaded. the file downloaded. The main page opened and began to load. The child window popped up. The parent window froze. Here is a gif of the results. You can see the child window open (404 page) and the parent window frozen while loading.





I have not tried to the Java update. I currently have 1.4.2_06 b03. The latest is 1.4.2_07. I really doubt that's the problem, but maybe a re-install will help. I'll try and let you know as soon as possible.
Tamas wrote:
I have not managed to reproduce browser freezing with your latest example.


I have no idea what can be the problem on your side.


Have you tried to update Java?


Try to tell me step by step what you have done until browser freezing.

ChemAxon 7c2d26e5cf

23-03-2005 18:54:30

On an other machine (with IE 6.0 in Win XP) , I have managed to reproduce the browser freezing.


Loading a new URL into a new window with JavaScript during applets' loading may cause the problem.


If you wait with "window.open" until the applets are started, you can avoid browser freezing.





I suggest you to use the molChanged0 parameter in your example.


http://www.chemaxon.com/marvin/doc/dev/viewman.html#molChanged0


You would call a JavaScript function in each applet when the molecule is loaded.


This function would check that molecules are loaded in all MView. If yes, it can already call the window.open function.

User 77bcbbb206

28-03-2005 17:14:11

Sorry about not getting back to you earlier.





This solutions works ("molChanged0"). Not the most elegant, but it works. I have also tried a javascript "selfTimeout()", which calls the window.open with the timeout period set to 50 ms, and this also works.





Is there javascript in the marvin.js function that might be attempting to run that would act in the manner seen when other javascript is attempting to run? Is this the browser trying to multi-thread and breaking itself?





Regardless, thanks very much for keeping on this one. I appreciate it.





-Jim
Tamas wrote:
On an other machine (with IE 6.0 in Win XP) , I have managed to reproduce the browser freezing.


Loading a new URL into a new window with JavaScript during applets' loading may cause the problem.


If you wait with "window.open" until the applets are started, you can avoid browser freezing.





I suggest you to use the molChanged0 parameter in your example.


http://www.chemaxon.com/marvin/doc/dev/viewman.html#molChanged0


You would call a JavaScript function in each applet when the molecule is loaded.


This function would check that molecules are loaded in all MView. If yes, it can already call the window.open function.

ChemAxon 7c2d26e5cf

29-03-2005 09:21:39

No, functions of "marvin.js" do not watch other tasks.


Actually, "marvin.js" checks if your browser supports Swing or not, then loads the AWT or Swing version of a Marvin applet (depends on the result of the detection).


In my experience, JavaScript cannot be multithreaded in the browsers.
Quote:
Is there javascript in the marvin.js function that might be attempting to run that would act in the manner seen when other javascript is attempting to run? Is this the browser trying to multi-thread and breaking itself?