我嘗試將我的應用程序的版本從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