我一直在为Spring4和RestWS集成做一个poc.我是两个新手,只有几个星期的曝光.我正在按照博客的说明进行操作.据我所知,在Spring 4和restWS设置中,jackson-core/anotation/databind 2用于正确的JSON < - > Java对象的消息转换.也org.springframework.http.converter.json.MappingJackson2HttpMessageConverter用于消息转换.我满足了所有这些要求.但是,当我尝试启动应用程序时,我得到bean创建异常.堆
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'regionController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.web.servlet.View com.leggmason.lmpamfs.controllers.RegionController.jsonView_i; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.view.json.MappingJacksonJsonView#0' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.servlet.view.json.MappingJacksonJsonView]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: …
我试图谷歌这个,但我没有得到我正在寻找的答案.我有两个单独的模块(在单独的html页面 - 这些执行完全不相关的任务).我创建了一个授权服务并将其与模块1相关联,我通过DI在我的控制器中使用这个$ auth服务.现在我想在module2中使用相同的服务.我怎样才能做到这一点?这就是服务的样子:
module1.service('$authService', function($http) {
this.authorise = function(userid,accessKey) {
// logic for performing auth
};
});
Run Code Online (Sandbox Code Playgroud)