Defect #348

Null pointer exception in solutionType Login

Added by Imre Tokai over 2 years ago. Updated almost 2 years ago.

Status:Closed Start date:07/28/2011
Priority:Normal Due date:
Assignee:Robert Ivens % Done:

0%

Category:-
Target version:-
Client type:Web client OS version:any
In developer?:No Java version:1.6
Servoy version:5.2 Browser (if web client):
Component version:1.1.3
Votes: 0

Description

Hi,

Not able to open non of dialogs in solutionType Login of my main solution? Anyway it works as expected in whole Main solution.
Tried to include mod_dialog as module in main solution, in login solution (module) and in both but get same error for
@globals.DIALOGS.showInfoDialog('Info dialog test', 'Did you know that....\n...you can actually use long button text?', "Really? I didn't know that.", 'Old News');
@when tried from Login solution.

Wrapped java.lang.NullPointerException
\mod_dialog\globals.js:32 (newFormBluePrint)
\mod_dialog\globals.js:55 (showDialog)

function newFormBluePrint(_sFormName, _sBaseFormName, _nWidth, _nHeight) {
if (!forms[_sFormName]) {
var _oForm = solutionModel.newForm(_sFormName, forms[_sBaseFormName].controller.getDataSource(), _sStyleSheet, false, _nWidth, _nHeight);
_oForm.extendsForm = _sBaseFormName;
} else {
application.output("Form '" + _sFormName + "' already exists.", LOGGINGLEVEL.ERROR);
}
}

Any idea?
Regards

servoy_log.txt (4.4 kB) Imre Tokai, 07/29/2011 03:50 pm

History

Updated by Robert Ivens over 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Robert Ivens

What version of Servoy is this ?
And do you also see the error when you load the demo solution?

Updated by Imre Tokai over 2 years ago

Thank you for your fast response Robert,

Servoy ver 5.2.8.;
Demo solution doesn't have a login module; Should I create it if this supposed to be possible?
Below is expert's comment:
This is a known restriction. Security on login solutions only allows you to see current form. Dialog module uses SolutionModel to make and show new forms, so that won't work in a login solution for security reasons.

Updated by Rob Gansevles over 2 years ago

Imre Tokai wrote:

Thank you for your fast response Robert,

Servoy ver 5.2.8.;
Demo solution doesn't have a login module; Should I create it if this supposed to be possible?
Below is Scott's comment:
This is a known restriction. Security on login solutions only allows you to see current form. Dialog module uses SolutionModel to make and show new forms, so that won't work in a login solution for security reasons.

Imre,

The login works just as a normal solution with a restriction that there is no data access.
You can have modules and multiple forms.
Once logged in the login solution is automatically replaced with the main solution.

Can you show the stack trace from the nullpointer exception?

Rob

Updated by Imre Tokai over 2 years ago

Thanks Rob,

Mentioned in Description, only erased the physical path to the solution (specific to my hard-drive):
Wrapped java.lang.NullPointerException
\mod_dialog\globals.js:32 (newFormBluePrint)
\mod_dialog\globals.js:55 (showDialog)

Null pointer exception happens in method newFormBluePrint(_sFormName, _sBaseFormName, _nWidth, _nHeight) line:
var _oForm = solutionModel.newForm(_sFormName, forms[_sBaseFormName].controller.getDataSource(), _sStyleSheet, false, _nWidth, _nHeight);

Try to reproduce the issue by invoking the dialog in any solution that has login module and explicitly add mod_dialog as referenced module (Properties->modulesNames)

Updated by Rob Gansevles over 2 years ago

Imre,

I meant from the servoy_log.txt file, there is probably a java-stacktrace with the exception.

Rob

Updated by Imre Tokai over 2 years ago

See attached please

Updated by Rob Gansevles over 2 years ago

Imre,

I see the reason for the exception, this is currently a limitation in Servoy, you cannot use the solution model in a login solution.
Please create a case in the Servoy support system for a feature request to support solution model in login solution.

Rob

Updated by Robert Ivens almost 2 years ago

  • Status changed from In Progress to Closed
  • Client type set to Web client
  • In developer? set to No
  • Servoy version set to 5.2
  • Component version set to 1.1.3
  • OS version set to any
  • Java version set to 1.6

Issue should be fixed in 6.0.4 and 6.1
See https://support.servoy.com/browse/SVY-1204

Looks like this will remain a limitation in 5.2.x

Also available in: Atom PDF