I have been working on a comprehensive solution to handle all new patients seen throughout the Cancer Center (not just Lymphoma like in the past). It is virtually completed in 3.5.8 but I was hoping (especially for demonstration purposes) to launch it using 4.1. I was able to import it just fine with very few problems which I then fixed. However in launching one of the main methods it totally freezes when it throws up a dialog box using the debugger (it runs fine otherwise). Because it freezes completely without even fully launching the dialog box I can’t seem to figure anything out about as I just have to force quit Servoy completely. The code where this happens is pretty straight forward:
var dtmgr = plugins.dialogs.showSelectDialog('Choose DataManager','Which data manager should handle this patient?',new Array('Karen','Beth'))
if(dtmgr == 'Karen')
{
forms.lpp_patient.datamgr = 102
}
if(dtmgr == 'Beth')
{
forms.lpp_patient.datamgr = 101
}
The dialog is completely blank apart from the ‘OK’ button. Hitting that or trying to close the dialog box doesn’t work and I can’t get back to Developer and the debugger. I was really hoping to launch this and especially demo it using 4.1. But unfortunately I have had very little time to learn 4.1 since Servoy World so maybe it is a mistake! I’d really like to step through some methods, show off a bit how it works in Eclipse (there will probably be some Java developers there as well) and highlight some of the new features. But I’m really worried that even though the solution seems to work fine, I’ll come unstuck if I am trying to demo it. Any thoughts?
I don’t think that the app is frozen, looks like you have entered debug mode and servoy is sitting on a breakpoint waiting for you (I’ve seen this behavior before on MacOS when debugging FID or Dialogs).
Try to bring the Eclipse window to the foreground, switch to the Debug perspective and have a look if you see a small blue arrow next to the line of code that shows the dialog.
If this is not the case you should report this in the Servoy Support System so that R&D can have a look at it.
Thanks Nicola. I was running it in debug mode but when it switched to show the dialog I could no longer get back to the Eclipse window; it wouldn’t allow it. (Even though I could ‘see’ the Eclipse window, clicking on it did no good: it was still ‘frozen’ on that partially completed dialog box). All I could do was force quit. Ran and still runs fine in non-debug mode. I guess I’ll submit it. I still am so unfamiliar with 4 that I keep thinking I’m just making some simple mistake… There was no breakpoint, by the way, at that point in the method nor was there one after that.
This issue is caused by java 1.6 on mac. The ‘showSelectDialog’ method just calls a single java function to display the dialog ( after parsing the arguments). Not much we can do about this.
This issue is caused by java 1.6 on mac. The ‘showSelectDialog’ method just calls a single java function to display the dialog ( after parsing the arguments). Not much we can do about this.
If this is the case there are a number of things I don’t get:
Why does the other ‘showSelectDialog’ in the SAME method work?
Why does it work fine when NOT using the debugger?
Why does it freeze up the whole application meaning that I have to force-quit Servoy Eclipse which is not good. (In that particular method I’m in the middle of a transaction too). Can’t there be at least some way of trapping it so that one can get out of it? Or maybe throw it into ‘non-debug’ mode while it runs through the ‘showSelectDialog’ part since in non-debug mode it runs fine? This is a big problem if you are developing on a Mac.
This is a deadlock/error in java 1.6 for mac. We have no control over it. Probably some hacks would be possible to avoid this but we don’t like to introduce hacks in our code. We recommend to use Java 1.5 on Mac (1.6 has other issues as well).
I certainly don’t want you to run some hack and I understand that the problem needs to get resolved by Apple. My problem is that I run two different Java apps constantly at the same time on my Mac, namely Servoy and Aqua Data Studio (which to my mind is the best SQL query tool around especially if you have to access different vendors). Aqua Data Studio 7 though requires Java 1.6. I know I still have 1.5 on my Mac but is it possible to run both 1.5 and 1.6 at the same time? Is there a way to tell Servoy 4.1 to use Java 1.5 even though 1.6 is currently up and running with Aqua Data Studio? These are my three indispensable tools: Servoy, Aqua Data Studio and my Mac!
Sorry but the problem actually seems to persist using Java 1.5 as well. I changed my Java preferences so that the first choice was Java 1.5 (I tried both the 32-bit and the 64-bit). Launched Servoy 4.1, confirmed that it was using Java 1.5 (
. Dumbed down the servoy method to just have the part with the offending showSelectDialog as below. When it comes to the showSelectDialog line in debug mode then it brings out the dialog but the dialog is blank, nothing else is accessible, I cannot shut the dialog box and my only alternative is to force-quit Servoy. The problem seems to be deeper than the Java 1.6 implementation. Again it runs fine when NOT in debug mode but just running it as a ‘normal’ client… Suggestions?
function test()
{
globals.g_username = security.getUserName();
if(globals.g_username == 'corb')
{
var x = 102
}
else if(globals.g_username == 'bigm')
{
var x = 101
}
else if(globals.g_username == 'john')
{
var dtmgr = plugins.dialogs.showSelectDialog('Choose DataManager','Which data manager should handle this patient?',new Array('Karen','Beth'))
if(dtmgr == 'Karen')
{
var x = 102
}
if(dtmgr == 'Beth')
{
var x = 101
}
}
else {
return;
}
}
We also have these sort of issues with Servoy 4, also with Java 1.5. From the behaviour we see/saw this is quite sureley not a Java but a Servoy problem. As John describes, after a while you get a “feeling” where the problem lies, even if I can’t support it with stright facts (as these sort of problems are always quite complex in terms of breaking it down to a repeatable example). But in this case I have the feeling telling it’s a Mac Java problem seems a (nice) excuse which in my experience is used quite too often for the Mac Java implementation (for whatever reasons). There are for sure issues with Java on all platforms, though.
Sorry I can’t deliver more details but these problems have to be solved with Servoy 4.
I tried the sample on Mac 1.4 and java 1.5 but couldn’t reproduce the issue. Also the code for showSelectDialog is basically a wrapper of java JOptionPane.showInputDialog which does all logic. I will further try this on Mac 10.5 after I install it ( end of this week/beginning of next one). If there is a way to constantly reproduce this you can reopen the case.
I have only been running Mac OS 10.5 (Leopard). I tried to run it using Java 1.4 by moving that up in my preferences but it defaulted anyway to 1.5 (the next option in the Java Preferences). I’m surprised you were able to run Servoy 4.1 with Java 1.4 as there is this message under ‘about Servoy/configuration’ : ‘-Dosgi.requiredJavaVersion=1.5’. Perhaps it does work under Mac OS 10.4 (Tiger) but I don’t currently have the ability to test that.
In running with debug off there is no problem. And once I was able to run it without debug (i.e. successfully) and then followed it by running WITH debug and it worked. When I ran it a second time though under debug it again froze just like every other time. It is very ‘reproducable’ on my system as it has done it every time under debug other than that one time.
I have looked at the log a bit and I’m copying what I thing might be relevant. First of all this is what I see when just logging in:
!ENTRY org.eclipse.ui.workbench 2 0 2009-02-18 08:02:55.684
!MESSAGE A handler conflict occurred. This may disable some commands.
!SUBENTRY 1 org.eclipse.ui.workbench 2 0 2009-02-18 08:02:55.684
!MESSAGE Conflict for ‘AUTOGEN:::org.eclipse.ui.cheatsheets.actionSet/org.eclipse.ui.cheatsheets.actions.CheatSheetHelpMenuAction’:
HandlerActivation(commandId=AUTOGEN:::org.eclipse.ui.cheatsheets.actionSet/org.eclipse.ui.cheatsheets.actions.CheatSheetHelpMenuAction,
handler=ActionDelegateHandlerProxy(null,org.eclipse.ui.cheatsheets.CheatSheetExtensionFactory:helpMenuAction),
expression=AndExpression(ActionSetExpression(org.eclipse.ui.cheatsheets.actionSet,org.eclipse.ui.internal.WorkbenchWindow@719a8d),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@719a8d)),sourcePriority=16640)
HandlerActivation(commandId=AUTOGEN:::org.eclipse.ui.cheatsheets.actionSet/org.eclipse.ui.cheatsheets.actions.CheatSheetHelpMenuAction,
handler=ActionDelegateHandlerProxy(null,org.eclipse.ui.cheatsheets.CheatSheetExtensionFactory:helpMenuAction),
expression=AndExpression(ActionSetExpression(org.eclipse.ui.cheatsheets.actionSet,org.eclipse.ui.internal.WorkbenchWindow@719a8d),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@719a8d)),sourcePriority=16640)
!ENTRY org.eclipse.core.net 1 0 2009-02-18 08:02:55.803
!MESSAGE System property http.nonProxyHosts has been set to local|.local|169.254/16|.169.254/16 by an external source. This value will be overwritten using the values from the preferences
After the freeze when running it in debug, force quitting and then restarting I saw this which sounds relevant although I don’t know if it helps:
ENTRY org.eclipse.debug.core 4 2 2009-02-18 08:22:00.634
!MESSAGE Problems occurred when invoking code from plug-in: “org.eclipse.debug.core”.
!STACK 0
java.lang.NullPointerException
at org.eclipse.debug.core.Launch.removeEventListener(Launch.java:115)
at org.eclipse.debug.core.Launch.fireTerminate(Launch.java:403)
at org.eclipse.debug.core.Launch.handleDebugEvents(Launch.java:571)
at org.eclipse.debug.core.DebugPlugin$EventNotifier.run(DebugPlugin.java:1074)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.debug.core.DebugPlugin$EventNotifier.dispatch(DebugPlugin.java:1108)
at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:360)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!ENTRY org.eclipse.core.jobs 4 2 2009-02-18 08:22:00.636
!MESSAGE An internal error occurred during: “Debug Event Dispatch”.
!STACK 0
java.lang.NullPointerException
at org.eclipse.debug.core.DebugPlugin.log(DebugPlugin.java:902)
at org.eclipse.debug.core.DebugPlugin$EventNotifier.handleException(DebugPlugin.java:1060)
at org.eclipse.core.runtime.SafeRunner.handleException(SafeRunner.java:68)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:39)
at org.eclipse.debug.core.DebugPlugin$EventNotifier.dispatch(DebugPlugin.java:1108)
at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:360)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
This is a big problem for me as I’m trying to get a number of more ‘evolved’ Java developers to buy into using Servoy here at Stanford. These guys are Java developers so I’d really like to introduce them to 4.1 not 3.5.
Thanks,
John
P.S. Oh one other thing I am running this method attached to a button with the ‘OnAction’ property calling this method if that is relevant.
I tried this in 10.5 (with all updates installed) but still works well. Tried both sample from case and the method above. So if I have a simple solution with one form which has a button (onaction = test method), and global variable g_username. I start Debug Smart Client from developer, login with John, then press the button. This is the scenario or am I doing something different ?
function test()
{
globals.g_username = security.getUserName();
if(globals.g_username == ‘corb’)
{
var x = 102
}
else if(globals.g_username == ‘bigm’)
{
var x = 101
}
else if(globals.g_username == ‘john’)
{
var dtmgr = plugins.dialogs.showSelectDialog(‘Choose DataManager’,‘Which data manager should handle this patient?’,new Array(‘Karen’,‘Beth’))
if(dtmgr == ‘Karen’)
{
var x = 102
}
if(dtmgr == ‘Beth’)
{
var x = 101
}
}
else {
return;
}
}
Just a tip if your servoy 4.1 developer hangs for you
When it does, go to the admin pages of your localhost
and dump the stack. We can then see what is blocking what.