报错如下:
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [proj.zoie.api.DefaultZoieVersion.DefaultZoieVersionFactory] for bean with name 'defaultZoieVersionFactory1' defined in class path resource [liyan.xml]; nested exception is java.lang.ClassNotFoundException: proj.zoie.api.DefaultZoieVersion.DefaultZoieVersionFactory
DefaultZoieVersionFactory是DefaultZoieVersion的内部类
由于编译时编译成DefaultZoieVersion$DefaultZoieVersionFactory。
索引在spring.xml配置文件中不能直接用proj.zoie.api.DefaultZoieVersion.DefaultZoieVersionFactory
而要改成proj.zoie.api.DefaultZoieVersion$DefaultZoieVersionFactory
如下:
<bean id="defaultZoieVersionFactory" class="proj.zoie.api.DefaultZoieVersion$DefaultZoieVersionFactory">
</bean>