|
From: Benoit X. (JIRA) <no...@sp...> - 2008-04-07 15:47:19
|
NPE in MessagesDialogExceptionHandler
-------------------------------------
Key: RCP-552
URL: http://jira.springframework.org/browse/RCP-552
Project: Spring Framework Rich Client Project
Issue Type: Bug
Components: Dialog System
Affects Versions: 1.0.0
Environment: JDK5, WinXP
Reporter: Benoit Xhenseval
Hi
I still get an NPE whenever I use MessagesDialogExceptionHandler.
For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
Caused by: java.lang.NullPointerException
at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
I am using the sample configuration:
<bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
<property name="delegateList">
<list>
<bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
<property name="throwableClassList">
<list>
<value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
<value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
</list>
</property>
<property name="exceptionHandler">
<bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
<property name="logLevel" value="WARN" />
<property name="shutdownPolicy" value="NONE" />
</bean>
</property>
</bean>
<bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
<property name="throwableClass" value="java.lang.Error" />
<property name="exceptionHandler">
<bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
<property name="logLevel" value="FATAL" />
<property name="shutdownPolicy" value="OBLIGATE" />
<property name="issueReporter" ref="issueReporter" />
</bean>
</property>
</bean>
<!-- The order is important: if Throwable would be first then the others would be ignored -->
<bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
<property name="throwableClass" value="java.lang.Throwable" />
<property name="exceptionHandler">
<bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
<property name="logLevel" value="ERROR" />
<property name="shutdownPolicy" value="ASK" />
<property name="issueReporter" ref="issueReporter" />
</bean>
</property>
</bean>
</list>
</property>
</bean>
Any suggestion why this happens immediately at startup?
<bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
....
<property name="registerableExceptionHandler" ref="exceptionHandler" />
</bean>
I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
Thanks
Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Benoit X. (JIRA) <no...@sp...> - 2008-04-07 15:56:07
|
[ http://jira.springframework.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benoit Xhenseval updated RCP-552:
---------------------------------
Attachment: AbstractDialogExceptionHandler.java.patch
the afterPropertiesSet calls a method that checks that ApplicationServicesLocator.services() != null before calling it.
Whenever the messageSourceAccessor is required, it will check if it has managed to get it first.
This patch does not modify the interfaces and is transparent in the current usage, it also works for me!
Thanks for considering it
Benoit
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springframework.org/browse/RCP-552
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Dialog System
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Jan H. (JIRA) <no...@sp...> - 2008-04-14 17:32:46
|
[ http://jira.springframework.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_34683 ]
Jan Hoskens commented on RCP-552:
---------------------------------
You can control the order of instantiation by adding a depends-on="serviceLocator" attribute. I do wonder where your setup differs from the sample setups.
Just on top of my head I'm guessing that in the sample context the applicationObjectConfigurer has such a depends-on attribute and additionally that bean is a BeanPostProcessor, so therefor the whole applicationServices part is probably instantiated quite early.
You could check if there's some bean triggering an early instantiation of your advisor (maybe you've implemented some spring interfaces?).
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springframework.org/browse/RCP-552
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Dialog System
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 19:30:21
|
[ http://jira.springframework.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=40220#action_40220 ]
Lieven Doclo commented on RCP-552:
----------------------------------
Status of this issue?
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springframework.org/browse/RCP-552
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Dialog System
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Fix For: 1.x
>
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2008-10-09 19:30:24
|
[ http://jira.springframework.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lieven Doclo updated RCP-552:
-----------------------------
Assignee: Lieven Doclo
Fix Version/s: 1.x
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springframework.org/browse/RCP-552
> Project: Spring Framework Rich Client Project
> Issue Type: Bug
> Components: Dialog System
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Assignee: Lieven Doclo
> Fix For: 1.x
>
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Lieven D. (JIRA) <no...@sp...> - 2009-07-09 22:16:11
|
[ http://jira.springsource.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45386#action_45386 ]
Lieven Doclo commented on RCP-552:
----------------------------------
Issue will be closed if no response in 2 weeks
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springsource.org/browse/RCP-552
> Project: Spring Rich Client Project
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Assignee: Lieven Doclo
> Fix For: 1.x
>
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springsource.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Benoit X. (JIRA) <no...@sp...> - 2009-07-10 14:59:04
|
[ http://jira.springsource.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45415#action_45415 ]
Benoit Xhenseval commented on RCP-552:
--------------------------------------
Still an issue.
I'm unable to find which bean would be causing this premature instantiation.
In any case, this is not obvious for users of the library, therefore I'd recommend applying the patch (it is very basic!)
Thanks
Benoit
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springsource.org/browse/RCP-552
> Project: Spring Rich Client Project
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Assignee: Lieven Doclo
> Fix For: 1.x
>
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springsource.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
|
From: Geoffrey De S. (JIRA) <no...@sp...> - 2009-07-11 14:46:01
|
[ http://jira.springsource.org/browse/RCP-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45425#action_45425 ]
Geoffrey De Smet commented on RCP-552:
--------------------------------------
I have some work todo on the exception handlers we use and I 'll see if I can take this issue along
> NPE in MessagesDialogExceptionHandler
> -------------------------------------
>
> Key: RCP-552
> URL: http://jira.springsource.org/browse/RCP-552
> Project: Spring Rich Client Project
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0.0
> Environment: JDK5, WinXP
> Reporter: Benoit Xhenseval
> Assignee: Geoffrey De Smet
> Fix For: 1.x
>
> Attachments: AbstractDialogExceptionHandler.java.patch
>
>
> Hi
> I still get an NPE whenever I use MessagesDialogExceptionHandler.
> For some reason, may be due to my xml configuration (??), the method afterPropertiesSet is called before ApplicationServicesLocator.services() is fully setup:
> Caused by: java.lang.NullPointerException
> at org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.afterPropertiesSet(AbstractDialogExceptionHandler.java:51)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1390)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1359)
> I am using the sample configuration:
> <bean id="exceptionHandler" class="org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler">
> <property name="delegateList">
> <list>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClassList">
> <list>
> <value type="java.lang.Class">org.acegisecurity.AuthenticationException</value>
> <value type="java.lang.Class">org.acegisecurity.AccessDeniedException</value>
> </list>
> </property>
> <property name="exceptionHandler">
> <bean class="org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler">
> <property name="logLevel" value="WARN" />
> <property name="shutdownPolicy" value="NONE" />
> </bean>
> </property>
> </bean>
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Error" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="FATAL" />
> <property name="shutdownPolicy" value="OBLIGATE" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> <!-- The order is important: if Throwable would be first then the others would be ignored -->
> <bean class="org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate">
> <property name="throwableClass" value="java.lang.Throwable" />
> <property name="exceptionHandler">
> <bean class="net.objectlab.safemargin.gui.SafeMarginExceptionHandler">
> <property name="logLevel" value="ERROR" />
> <property name="shutdownPolicy" value="ASK" />
> <property name="issueReporter" ref="issueReporter" />
> </bean>
> </property>
> </bean>
> </list>
> </property>
> </bean>
> Any suggestion why this happens immediately at startup?
> <bean id="safemarginLifecycleAdvisor" class="net.objectlab.safemargin.gui.SafeMarginLifecycleAdvisor">
> ....
> <property name="registerableExceptionHandler" ref="exceptionHandler" />
> </bean>
> I will suggest a workaround and a patch that delays the access to ApplicationServicesLocator.services().
> Thanks
> Benoit.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springsource.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|