[BLOSSOM-5] NullPointerExeption in BlossomDispatcherServlet while detecting DialogFactories Created: 07/Jul/10  Updated: 06/Dec/14  Resolved: 08/Jul/10

Status: Closed
Project: Blossom
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.1.1

Type: Bug Priority: Critical
Reporter: Thomas Kalmar Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.5h
Original Estimate: 0.5h

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

context.getType can be null the following fixes the detectDialogFactories Method

private void detectDialogFactories() throws RepositoryException {
WebApplicationContext context = getWebApplicationContext();
String[] beanDefinitionNames = context.getBeanDefinitionNames();
for (String beanDefinitionName : beanDefinitionNames) {
Class<?> type = context.getType(beanDefinitionName);
if (type!=null && type.isAnnotationPresent(DialogFactory.class))

{ BlossomModule.getDialogRegistry().registerDialogFactory(context.getBean(beanDefinitionName)); }

}
}



 Comments   
Comment by Tobias Mattsson [ 08/Jul/10 ]

Added null check.

Comment by Tobias Mattsson [ 08/Jul/10 ]

Just out of curiosity, what kind of bean did you have this problem with? I'm guessing a FactoryBean that didn't know the type in advance.

Comment by Thomas Kalmar [ 08/Jul/10 ]

It was an abstract bean which has no type.
<bean id="abstractBean" abstract="true" scope="prototype">
...
</bean>

Comment by Jan Haderka [ 06/Dec/14 ]

Bulk close of old resolved issues.

Generated at Sun Feb 11 23:29:10 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.