问题描述
- spring注入activiti的接口问题???
- spring注入
@Autowired
protected RepositoryService repositoryService;代码把注入的接口转换为子类
RepositoryServiceImpl repositoryServiceImpl=(RepositoryServiceImpl) repositoryService;抛出的:
严重: Servlet.service() for servlet spring3 threw exception
java.lang.ClassCastException: $Proxy26 cannot be cast to org.activiti.engine.impl.RepositoryServiceImpl
at com.zx.appsupport.web.activiti.LeaveController.traceProcess(LeaveController.java:869)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)。。。。。看别人这样都可以 我照他的写就有问题
解决方案
在spring配置文件中写这个了吗?
context:annotation-config/