This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When running a platform application from the IDE, I noticed that the command line parameters sometimes don't get passed to my OptionProcessor extensions. Debugging into the source, I found the reason. When an unknown command line parameter is encountered in CommandLine.process, an exception is thrown indicating that the parameter was not processed (line 156). Hence the processing stops after the first unknown parameter. If the lock file was not deleted after a debugging session, an extra command line parameter is passed: --test-userdir-lock-with-invalid-arg. This parameter is not recognised by any OptionProcessors and hence my parameters (which follow after it) do not get processed. The lock file not being deleted is a separate issue of course. But is it possible to ignore the unknown parameter and continue processing after it?
Reassigning to apisupport/project. Related to issue 141069.
Can try putting the bogus arg at the end, after ${run.args.extra}. Please verify fix.
core-main #84db594dbf6e
Integrated into 'main-golden', will be available in build *201101090000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/84db594dbf6e User: Jesse Glick <jglick@netbeans.org> Log: #193649: OptionProcessor not called after unknown parameter was encountered
Tested on development build #201101100000. Thank you for the change in the order of the parameters, it is definitely a welcome one. However, the issue remains. An exception is still thrown in the class org.netbeans.api.sendopts.CommandLine before the option processors are called, just slightly later than before. So it appears that there is no way to fix this by simply changing the order of the parameters. Additionally, in a deployed application where the user can specify any command line parameters, it would not be ideal to disregard all the parameters if one is misspelled or simply unknown.
Then nothing more to be done, I think; you need to delete $userdir/lock if you forcibly terminate the app.
*** Bug 195885 has been marked as a duplicate of this bug. ***