u011484075
Just_remember
2013-10-31 12:09

提问 问题标签用户 spring注入activiti的接口问题???

  • it技术
  • 互联网问答
  • IT行业问题
  • 编程语言问答
  • 计算机技术

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)。。。。。

看别人这样都可以 我照他的写就有问题

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

5条回答

为你推荐