编译环境完全是一样,jdk版本什么的都一样,区别只是一个是windows一个是linux。问题如下:
1. @Autowired
在windows下时,直接用这个没有任何问题,但是当部署到linux上时,就会报
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.xxx.service.XXXService] is defined: expected single matching bean but found 89
这时如果在代码里添加@Qualifier("xxxxDao")
一切就正常了。。2. @PathVariable
在windows下时,直接用@PathVariable int type,一切都是那么正常,但是当部署到linux下,就会报
Name for argument type [int] not available, and parameter name information not found in class file either.
这时必须写成@PathVariable("type") int type哪位有这方面经验者知道这个问题怎么解决啊。太烦人了,我想知道是什么原因导致的怎么解决才可以。
我不想把windows下的代码都改一遍,这样也许还会存在我不知道其他诡异问题。