OK folks, I’m not sure where to post this question. I’m sure there’s something simple I’m missing, but I’m having problems with the file plugin on 4.1. I am trying to call the showDirectorySelectDialog function, but it errors out and throws a dialog that simply says Error 3184.
Not sure what I’m missing here. The same code worked fine in 3.5.7. We’ve just moved to 4.1 and I thought we had the plugins taken care of.
Here’s a snipit of test code:
function testFilePlugin()
{
var vFile = plugins.file.copyFolder(‘c:/test/snagit’, ‘c:/test/test1’)
plugins.dialogs.showInfoDialog(“plugins response”,'vFile = ’ + vFile,‘OK’)
var vCreateFile = plugins.file.createFile(‘c:/test/snagit.tmp’)
plugins.dialogs.showInfoDialog(“plugins response”,'vCreateFile = ’ + vCreateFile,‘OK’)
var vShowDir = plugins.file.showDirectorySelectDialog(‘c:/test’)
//var vShowDir = application.showDirectorySelectDialog(‘c:/test’) ← this has been deprecated - however, the reference guide shows this command
plugins.dialogs.showInfoDialog(“plugins response”,'vShowDir = ’ + vShowDir,‘OK’)
}
I did this just as a test. The first two file plugin commands work fine. But it throws an error on the showDirectorySelectDialog.
Here’s the error from the log:
2008-12-17 22:42:37,490 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable
org.mozilla.javascript.WrappedException: Wrapped java.lang.ArrayIndexOutOfBoundsException: 3184 (C:\Users\Chuck\servoy_workspace_Lincage\forms\wf_rep_dash\wf_rep_dash_methods.js#221)
at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1828)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:199)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:347)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
at script.testFilePlugin(C:\Users\Chuck\servoy_workspace_Lincage\forms\wf_rep_dash\wf_rep_dash_methods.js:221)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3122)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
at com.servoy.j2db.scripting.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:109)
at com.servoy.j2db.FormController.Za(FormController.java:23)
at com.servoy.j2db.FormController.executeFunction(FormController.java:117)
at com.servoy.j2db.FormController.actionPerformed(FormController.java:536)
at com.servoy.j2db.Zfb.actionPerformed(Zfb.java:3)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3184
at sun.awt.shell.Win32ShellFolder2.getFileChooserIcon(Win32ShellFolder2.java:748)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.java:248)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:221)
at com.sun.java.swing.plaf.windows.WindowsLookAndFeel$LazyWindowsIcon.createValue(WindowsLookAndFeel.java:1865)
at javax.swing.UIDefaults.getFromHashtable(UIDefaults.java:185)
at javax.swing.UIDefaults.get(UIDefaults.java:130)
at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:44)
at javax.swing.UIDefaults.getIcon(UIDefaults.java:411)
at javax.swing.UIManager.getIcon(UIManager.java:613)
at javax.swing.plaf.basic.BasicFileChooserUI.installIcons(BasicFileChooserUI.java:237)
at javax.swing.plaf.basic.BasicFileChooserUI.installDefaults(BasicFileChooserUI.java:219)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserUI.java:135)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(WindowsFileChooserUI.java:126)
at javax.swing.JComponent.setUI(JComponent.java:652)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1755)
at javax.swing.JFileChooser.setup(JFileChooser.java:366)
at javax.swing.JFileChooser.(JFileChooser.java:332)
at javax.swing.JFileChooser.(JFileChooser.java:315)
at com.servoy.j2db.util.FileChooserUtils.getFileChooser(FileChooserUtils.java:48)
at com.servoy.j2db.util.FileChooserUtils.getAReadFile(FileChooserUtils.java:21)
at com.servoy.extensions.plugins.file.FileProvider.js_showDirectorySelectDialog(FileProvider.java:841)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
… 36 more
Any suggestions? It’s frustrating because this worked fine in 3.5.7. What am I missing?
The error 'Wrapped java.lang.ArrayIndexOutOfBoundsException: 3184 ’ says that there is an error while working on an array (I guess the array of found files) at index 3184 (so not error code 3184.
Thanks for the response. I have checked this, and confirmed that it is NOT turn on. I did try and set it to XP compatibility just to see what would happen, and the results were the same. Any other ideas?
Another update: I have confirmed that this functionality does work when run on an XP machine. It’s definitely got something to do with Vista. Thoughts?
Same error. It seems that it has something to do with the way Vista handles dialogs, but since 3.5.7 worked fine, it’s a bit confusing. I’m wondering if it’s an issue with eclipse.
Do you get this error only in servoy developer, or also when you start a smart client using java webstart from a servoy server?
If it does not happen in the normal client then probably a workaround would be to develop on a non-vista system and use clients from any system.
I’ve tested on Vista. And it works okey.
Did you checked who is the owner of the folder?
Do you have permissions for it?
Have you tried opening a different folder on a different drive?