我尝试将我的应用程序的版本从Hybris 4.8迁移到Hybris 5.6.0.5。HybrisContextFactory - 初始化全局应用程序上下文时出错
服务器启动时我有这样的例外:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'csTicketFacade' defined in class path resource [CoopAcceleratorFrontEndfacades-spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.accenture.hybris.facades.customerservice.impl.CoopCSTicketFacade]: Constructor threw exception; nested exception is java.lang.NullPointerException
INFO | jvm 1 | main | 2016/01/20 11:41:54.777 | Caused by: java.lang.NullPointerException
INFO | jvm 1 | main | 2016/01/20 11:41:54.790 | at com.accenture.facades.common.FlexSelector.getPropertiesReader(FlexSelector.java:27)
INFO | jvm 1 | main | 2016/01/20 11:41:54.797 | at com.accenture.hybris.facades.customerservice.impl.CoopCSTicketFacade$TicketFlexSelector.getCsAgentGroupUID(CoopCSTicketFacade.java:68)
INFO | jvm 1 | main | 2016/01/20 11:41:54.805 | at com.accenture.hybris.facades.customerservice.impl.CoopCSTicketFacade$TicketFlexSelector.getCsAgentGroupModel(CoopCSTicketFacade.java:31)
INFO | jvm 1 | main | 2016/01/20 11:41:54.809 | at com.accenture.hybris.facades.customerservice.impl.CoopCSTicketFacade.<init>(CoopCSTicketFacade.java:80)
INFO | jvm 1 | main | 2016/01/20 11:41:54.820 | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO | jvm 1 | main | 2016/01/20 11:41:54.823 | at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
INFO | jvm 1 | main | 2016/01/20 11:41:54.828 | at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO | jvm 1 | main | 2016/01/20 11:41:54.834 | at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
INFO | jvm 1 | main | 2016/01/20 11:41:54.838 | at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
INFO | jvm 1 | main | 2016/01/20 11:41:54.843 | ... 35 more
因为在类FlexSelector:
protected static final ApplicationContext ctx = Registry.getApplicationContext();
弹簧的应用程序上下文为null。 如果有人有任何想法,请告诉我。
难道你不能只是让类beanfactoryaware或applicationcontextaware? – thijsraets
你可以发布类CoopCSTicketFacade的内容吗?或者至少是它的主要部分? – Juan