org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.my.service.ProductService] for bean with name 'productService' defi报错解决方法


javaweb项目报错org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [XXX]

最近在webService服务,在CXF方面自己写了一个测试的小服务程序,发布到本地主机上边,程序大致框架是通过spring框架对数据库进行连接从而操作数据库,有一个接口,一个实现类,一个实体类,接口上边有WebSerivce注解,实现类通过在cxf.xml文件中进行配置,在类中用的是注解方法来操作事务。在发布程序的过程中出现来标题相关的内容,原来的错误是找不到ContextLoaderListener,通过重启服务器,重新builder一下,最终这个错误消失 ,接下来就是下边的错误,搞了半天,各种百度,最终在一个博客上,看到关于编译JDK和系统的jdk版本不一样等说法,自己就去慢慢尝试,果然搞定

从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description Resource Path Location Type Java compiler level does not match the version of the installed Java project facet.出现这个问题的原因是因为,eclipse/myeclipse的jdk编译版本与出现问题的项目JDK编译版本不一致所导致!

先设置好jdk,需要确定 项目,eclipse/myeclipse,系统 用的是同一个版本的JDK,我系统中安装的JDK是1.7,所以我把eclipse的jdk成1.7

进入 windows—proferences—java–compiler设置编译出来的文件使用的格式是 1.7版本的 (设置成多少都行,只要兼容,并且与你项目的编译版本一直就可以,我这里统一设置成1.7)

进入项目–properties—java Compiler 把项目编译版本也设置成 1.7 
进入项目–properties—Myeclipse—project Facets设置java文件的版本为 1.7


完成以上所有步骤,重启服务,即可解决!别忘记点赞


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



猜您在找 org.springframework.beans.factory.BeanCreationException: Could not autowire field org.springframework.beans.factory.CannotLoadBeanClassException: Error loading class [com.xxxx.service.sys.impl.ProcEn org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext之解决办法 新建项目用flyway数据迁移时报错找不到flyway org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class path resource springboot 报错 org.springframework.beans.factory.NoSuchBeanDefinitionException:No qualifying bean of type 'com.example.service.HrService' available: 有没有大佬出个主意,我找了一天,刚入门springboot JAVA Cannot find class [×××] for bean with name '××' defined in class path resource [×××] 问题解决方法 springMVC常见错误-解决org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.spring 报错Error creating bean with name 'orderController': Unsatisfied dependency expressed through field 'orderService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/ Redis——解决“org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisReferenceResolver': Unsatisfied dependency expressed through constructor parameter 0” 【实战问题】【14】org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'xxMapper'
 
粤ICP备18138465号  © 2018-2026 CODEPRJ.COM