Class<SpringJUnit4ClassRunner> cannot be resolved to a type

练习搭建maven web项目,用尝试用junit测试时一直报Class<SpringJUnit4ClassRunner> cannot be resolved to a type错,第一次报的原因是pom.xml中没有填加

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.2.4.RELEASE</version>
<scope>provided</scope>
</dependency>

依赖,第二次报是由于版本号中间多了空格,第三次报是因为需要手动输入下方红框中的包,eclipse不会自动导入。

时间: 2024-07-29 02:48:37

Class<SpringJUnit4ClassRunner> cannot be resolved to a type的相关文章

(转)eclipse报错及解决说明 &quot;XX cannot be resolved to a type &quot;

场景:在项目开发时,一个工程引用另一个工程中的文件,出现报错“XX cannot be resolved to a type”,但是在实际通过跟踪“F3”能够找到相应的文件,最终用方法4解决. 引言: eclipse新导入的项目经常可以看到“XX cannot be resolved to a type”的报错信息.本文将做以简单总结. 正文: 1 jdk不匹配(或不存在) 项目指定的jdk为“jdk1.6.0_18”,而当前eclipse使用的是“jdk1.6.0_22”.需要在BuildPa

cannot be resolved to a type in same package 问题解决

在 STS 上,一个类引用在相同 package 中另一个类,但是报 cannot be resolved to a type 错误. 解决方法 : Alternatively, you can highlight the project : Choose Clean ... from Project menu and if you have activated the Build Automatically option (in the same menu), the classes will

使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type

使用Maven创建Web项目后,jsp引入静态文件提示报错. 错误提示:javax.servlet.ServletException cannot be resolved to a type 错误如下图: 解决方案: 在Maven的pom文件中引发如下依赖即可: <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <versio

javax.servlet.jsp cannot be resolved to a type

把MyEclipse里的项目导入到Eclipse Luna版中后出现了个莫名其妙的错误,注:Eclipse Luna是新装的. 错误描述:jsp页面中引用的js报错,鼠标放上去以后提示:javax.servlet.jsp cannot be resolved to a type.图片为证: 类似以上底下有红色波浪线的错误,好多jsp页面都有,还各不相同. 解决办法: 点击菜单栏:Window→Preferences→Validation,在右侧找"JSP Syntax Validator&quo

HttpServletRequest cannot be resolved to a type。

问题描述:HttpServletRequest cannot be resolved to a type.Multiple markers at this line - The import javax.servlet.http cannot be resolved - The import javax.servlet.http cannot be resolved - The import javax.servlet.http cannot be resolved解决方案: 1.这个错误可能是

MyEclipse报错:String cannot be resolved to a type

往MyEclipse导入项目后,java 类总是报出n 多红叉,实在是惨不忍睹,String cannot be resolved to a type 都出来了, 开始以为是Myeclipse的事,但重启后发现问题还存在,于是在网上搜,结果说是JDK的问题 解决方法: 右键项目: properties--java build path- Libraries 找到JRE System Library, 发现 JRE System Library 1.7 后面是unbond , 点击edit ,al

javax.servlet.jsp cannot be resolved to a type,javax.servlet

可能是jdk 里不包括servlet-api.jar这个包,到tomcat里找到这个包复制到java项目里. 项目名-->右键 Property-->选择 Java Build Path-->选择 Add External JARs-->选择 把servlet-api.jar的路径输入即可 该包在tomcat里有 搜索即课找到 javaxservletjspJspException cannot be resolved to a type javaxservletjspPageCo

HttpServlet cannot be resolved to a type

Description Resource Path Location TypeHttpServlet cannot be resolved to a type SimpleServlet.java /JavaHelloWorldApp/src/main/java/wasdev/sample/servlet line 15 Java ProblemHttpServletRequest cannot be resolved to a type SimpleServlet.java /JavaHell

JBPM在Eclipse中运行时页面错误ProcessEngine cannot be resolved to a type

JBPM在Eclipse中运行时页面错误ProcessEngine cannot be resolved to a type 从网上找了一些杂七杂八的回答,比如在Java EE Module Dependencies设置中添加依赖的jar 但是这个设置是以前旧版本的Eclipse所有的.新版的已经没有这个设置. 归根结底是因为我自己创建了一个UserLibrary.引入了jbpm依赖的所有jar 结果无法发布到tomcat中. 干脆把这个引用删掉,直接复制所有jar到项目的lib文件夹下. 一切