文章目录
-
- 学习编程过程中-->遇到的错误(吕招焕)
-
- 1、java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
- 2、SpringMVC静态资源过滤The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler
- 3、IDEA JavaWeb报错SSL HTTP Connector node not found set up one in the server.xml(2021-10-8)
- 4、currentTime2 is not a function 如下图 (2021-10-8)
- 5、springboot无效的目标发行版11 如图
- 6、Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader 使用SpringBoot测试的时候Junit报错
- 7、请求的资源[/]不可用 做ssm实训课的时候这个错误真的是让我很难受,浪费几天时间结果是webapp这个文件夹配置错误
- 8、org.springframework.jdbc.BadSqlGrammarException:
- 9、请求的资源[/jsp/provider.do]不可用(源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。)
- 10、org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
- 11、springboot项目控制台日志不是彩色的原因
- 12、线程“main”java.lang.NoSuchMethodError中出现异常:org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader;
- 13、Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
- 14、Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
- 15、java.sql.SQLNonTransientConnectionException: CLIENT_PLUGIN_AUTH is required
- 16、
- 17、为bean类[cn.qztc.bookstore.controller.client.userController]指定的注释bean名称“userController”与相同名称和类[cn.qztc
- 18、java.sql.SQLException: Connections could not be acquired from the underlying database!
- 19、org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.tree.mapper.NoticeMapper.listAll'. It's likely that neither a Result Type nor a Result Map was specified.
- 20、Tomcat启动报错:一个或多个筛选器启动失败。由于之前的错误,Context[]启动失败
- 21、(Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader; )
- 22、org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean with name 'com.freedom.tkmapperdemo.dao.UserDAOTest': Unsatisfied dependency expressed through field 'userDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.freedom.tkmapperdemo.dao.UserDAO' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
- 23、Error invoking SqlProvider method (tk.mybatis.mapper.provider.base.BaseInsertProvider.dynamicSQL).
- 24、前后端分离项目 vue+axios 跨域传参一直是undefined
- 25、使用js从购物车列表传参调转到登录页面的时候,发现自己定义的变量提示undefined且登录之后无法回到购物车页面
- 26、在做mapper层的foreach查询的时候,遇到Parameter 'cids' not found. Available parameters are [arg0, collection, list]
- 27、针对cookie无法处理特殊字符的解决方案
- 28、SpringBootTest测试类没有启动按钮,测试类无法启动
- 29、Application run failed org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key in 'reader', line 10, column 1:
- 30、Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory. NoSuchBeanDefinitionExceptionNo qualifying bean of type 'java.lang.String' available: expected at least 1 bean which qualifies as
- 31、使用springboot做jdbc测试出现了错误
- 32、使用vue创建项目错误 vue init webpack myproject
学习编程过程中–>遇到的错误(吕招焕)
1、java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
(翻译:找到了1个问号,却插入了2个值,导致参数越界(根据得到的信息打印将很容易判断数据是否与数据库字段匹配等小问题))
详情如下图所示
在查询了许多资料之后,大概都是说sql语句参数设置发生了错误
- 第1 种情况:就是当设置参数时,没有相应的问号与之匹配(或者根本就没有?号)
- 第2 种情况:动态sql语句中where标签使用的时候,由于在select标签中按快捷键添加了注释,导致出现错误,-- 只要把注释去掉或者改成正确的注释格式就可以成功运行
- 最后通过查看BaseDao类 发现我的错误是sql语句中的问号大小写错了。 找了半天,绝了…
找了将近一个小时,终于解决了…
2、SpringMVC静态资源过滤The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler
(翻译:匹配的通配符是严格的,但找不到元素“mvc:defaultservlet处理程序”的声明)
仔细查找了一下,发现是bean的配置出错了 后缀的cache给写错了 应该是mvc
可能改完之后 你还会报错…因为需要改的不止这一条,还有下面这两条
Caused by: org.xml.sax.SAXParseException; lineNumber: 14; columnNumber: 29; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 ‘mvc:annotation-driven’ 的声明。
3、IDEA JavaWeb报错SSL HTTP Connector node not found set up one in the server.xml(2021-10-8)
(翻译:IDEA JavaWeb报错未找到SSL HTTP连接器节点。请在server.xml中设置一个)
1、不使用Https端口,在IDEA的Tomcat配置中去掉HTTPs端口即设置为空
2、翻译:IDEA JavaWeb报错未找到SSL HTTP连接器节点。请在server.xml中设置一个
2.1 打开Tomcat下的conf目录里的server.xml文件
2.2 把文件里面定义的SSL连接器注释去掉
4、currentTime2 is not a function 如下图 (2021-10-8)
代码这边找了十几分钟都没发现,最后发现自己傻了 计算属性写成了方法
5、springboot无效的目标发行版11 如图
解决方案:
这个是项目配置的JDK版本有误,解决方案如下:
1、File——>Settings——>Build,Execution,Deployment——>Compiler——>Java Compiler
2、Project Structure——>Project
最后成功启动啦!
如果还是报错,检查下maven的pom文件,将下列信息注释
6、Exception in thread “main” java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader 使用SpringBoot测试的时候Junit报错
原因:依赖的junit的版本的问题,junit5在低版本的IDEA上会报这个错误(我当时使用2017版)
解决方案:pom文件中移除junit 如下图所示,并且重新在测试类中导入Junit4的包