[ 
https://issues.apache.org/jira/browse/ISIS-1455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15346645#comment-15346645
 ] 

ASF subversion and git services commented on ISIS-1455:
-------------------------------------------------------

Commit 44d4b2e505ef9bf596f807f78d06f64f6ce60b00 in isis's branch 
refs/heads/master from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=44d4b2e ]

ISIS-1455: improves bootstrapping in event of an invalid metamodel exception.

IsisSessionFactoryBuilder now always completes the initialization (of the 
authenticationManager, authorizationManadater and persistenceSessionFactory) 
even in the case of invalid metamodel.  This means that any custom 
implementations of SPI services, eg ThemeProvider - do not need special case 
logic as to whether the framework is properly or only half initialized.

Instead, in WebRequestCycleForIsis, we use the "onRequestHandlerResolved" 
callback hoop (previously not overridden) to throw the 
MetaModelInvalidException if need be (but peeking inside first to ensure that 
we're not already on the way to rendering an error page)

In addition:
- no need to hold the list of validation errors on the IsisWicketApplication, 
can simply use IsisContext#getMetaModelValidationExceptionIfAny()
  - to support this, added overloaded constructor to MmvErrorPage
- added isInitialized() method on PersistenceSessionFactory (though not 
actually used elsewhere in this implementation).
- IsisSignInPanel no longer uses doInSession for its 
setVisibilityAllowedBasedOnAvailableServices(...) (though this is just a 
simplfication of code, and would still be fine to have left it as is).


> Improve metamodel invalid exception handling
> --------------------------------------------
>
>                 Key: ISIS-1455
>                 URL: https://issues.apache.org/jira/browse/ISIS-1455
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core, Core: Viewer: Wicket
>    Affects Versions: 1.12.2
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.13.0
>
>
> At the moment the MMV error handling works only "by accident":
> - if an validation failure is found then the remaining initialization of 
> authentication manager and persistence is skipped.
> - attempting to go to the login causes a null pointer exception
> - this exception is caught and then the MMV thrown
> This also raises an issue for implementations of - say - the ThemeProvider 
> that want to make database queries, eg via Settings service.  The todoapp 
> does this.
> So, instead, we should always do the complete initialization even if there is 
> a metamodel validation exception, but then intercept any such exceptions and 
> route the MmvErrorPage thereafter.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to