on 10-14-2016 12:39 PM
when i test this this code as follows: handlingUnitModel = modelService.create(HandlingUnitModel.class) but handlingUnitModel is null,and then throws the exception. can you tell me why? thank you very much.
Hi Devin,
In your-extension-spring.xml where you are defining the bean, have you injected the modelService
?
<bean id="mySpringBeanWithDependency" class="package.MySpringBeanWithDependency">
<property name="modelService" ref="modelService" />
</bean>
In your code file do you have the following?
public class MySpringBeanWithDependancy {
private ModelService modelService;
...
@Required public void setModelService(ModelService modelService) {
this.modelService = modelService
}
}
Regards,
Luke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Are you sure modelService is not null?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.