当我将 spring 与 smartfox 服务器一起使用时,出现错误:
Exception: java.lang.IllegalStateException
Message: Cannot load configuration class: com.lagente.sfs2x.AppConfig
Description: Extension initialization failed.
+--- --- ---+
Stack Trace:
+--- --- ---+
org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:410)
org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:263)
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:284)
org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:130)
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:677)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519)
org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:84)
com.lagente.sfs2x.ExampleSFSZoneExtension.initAppContext(ExampleSFSZoneExtension.java:32)
com.lagente.sfs2x.ExampleSFSZoneExtension.init(ExampleSFSZoneExtension.java:26)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.createExtension(SFSExtensionManager.java:303)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.createZone(SFSZoneManager.java:433)
com.smartfoxserver.v2.entities.managers.SFSZoneManager.initializeZones(SFSZoneManager.java:249)
com.smartfoxserver.v2.SmartFoxServer.start(SmartFoxServer.java:266)
com.smartfoxserver.v2.Main.main(Main.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
com.install4j.runtime.launcher.Launcher.main(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
这是 AppConfig 类:
@Configuration
@ComponentScan({"com.lagente.sfs2x.*"})
public class AppConfig
{
@Bean
public APIExtesion exampleExtension() {
return new ExampleZoneExtension();
}
@Bean
public ExtensionConfiguration extensionConfig() {
return new ExtensionConfiguration();
}
}
这是 ZoneExtension 的 init 函数中的源代码片段:
appContext =
new AnnotationConfigApplicationContext(AppConfig.class);
有人帮我解决吗?非常感谢。