![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SSM框架搭建
追梦少年的大牛计划
这个作者很懒,什么都没留下…
展开
-
解决com.microsoft.sqlserver.jdbc.SQLServerException: 将截断字符串或二进制数据
报错信息:org.springframework.dao.DataIntegrityViolationException:Error updating database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 将截断字符串或二进制数据。原因:其中某个属性的长度过长。查看Json属性发现:filePath太长,...原创 2020-03-16 13:48:52 · 2915 阅读 · 0 评论 -
解决No mapping found for HTTP request with URI[×××] in DispatcherServlet with name 'SpringMVC'
报错:[org.springframework.web.servlet.PageNotFound] - No mapping found forHTTP request with URI [/CS-Service/user/searchUserAllByRole] inDispatcherServlet with name ‘SpringMVC’原因:Controller文件的接口,...原创 2020-03-16 09:46:40 · 1581 阅读 · 1 评论 -
No qualifying bean of type 'xxx' found for dependency 问题解决
报错:Caused by:org.springframework.beans.factory.NoSuchBeanDefinitionException: Noqualifying bean of type [com.×××项目名.service.ContractService] found fordependency原因:缺少依赖标记,比如@Autowired,@Overrid...原创 2020-03-13 11:24:57 · 1339 阅读 · 0 评论 -
解决项目启动报错:找不到类,Cannot find class
报错内容:在开发SSM企业项目时,报错找不到某个类,报错内容:Error creating bean with name ‘sqlSessionFactory’ defined in classpath resource [spring/spring-mybatis.xml]: Invocation of init methodfailed; nested exception iso...原创 2020-03-10 10:01:21 · 35146 阅读 · 5 评论 -
com.microsoft.sqlserver.jdbc.SQLServerException: '@P11' 附近有语法错误。
报错:com.microsoft.sqlserver.jdbc.SQLServerException: ‘@P11’ 附近有语法错误。原因:第11位占位符报错,多半是sql语句的问题(如下图所示,多写了一个括号等等)。如果实在找不到错误,将sql语句打印出来看看,放到数据库中执行看看。...原创 2020-01-02 10:19:00 · 725 阅读 · 0 评论 -
SSM项目 记录用户的操作日志和Bean属性值的变化
SSM项目如何记录用户的操作日志?创建记录变化的对照实体Bean,Comparison.java。public class Comparison { //字段名称 private String Field; //字段旧值 private Object before; //字段新值 private Object after; ...原创 2019-12-24 17:44:42 · 548 阅读 · 0 评论 -
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
报错:严重: Servlet.service() for servlet [SpringMVC] in context with path [/CS-Service] threw exception [Request processing failed; nested exception is org.apache.ibatis.binding.BindingException: Invalid...原创 2019-12-20 17:43:44 · 175 阅读 · 0 评论 -
MyBatis批量删除
如何传入一个list,根据list编号进行批量删除<!-- 删除设备信息 --> <select id="deleteDeviceFun" parameterType="java.lang.Integer"> delete from [DeviceFun] where D_Id in <foreach collection="array" ind...原创 2019-12-17 18:09:08 · 187 阅读 · 0 评论 -
MyBatis传入多个参数,实现批量更新
Controller接口:// 批量操作——更新设备状态 @RequestMapping("/updateDeviceFunStatus") public Boolean updateDeviceFunStatus(List<String> rNumList, String Status) { Map<String, Object> map = new HashM...原创 2019-12-12 15:01:05 · 3399 阅读 · 0 评论 -
【eclipse中Maven项目jar包丢失/导入依赖失败】Maven Dependencies missing jar / Maven dependencies 添加失败 (已解决)
问题描述:在实际的项目开发中创建Maven项目之后发现Maven里面的pom.xml报错。此时,选择项目名称点击右键->Build Path->Configure Build Path…这是我们会发现jar包的图标右下角会出现类似的小红叉。Jar包路径的尾部带有Missing。解决办法:办法一:选中项目右键->maven->update project(快捷键al...原创 2019-12-03 20:57:18 · 3400 阅读 · 1 评论 -
Caused by: org.xml.sax.SAXParseException; 必须为元素类型 "update" 声明属性 "resultType"。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested...原创 2019-11-27 11:17:30 · 5588 阅读 · 0 评论 -
java.lang.NoSuchMethodError:出错原因解析
出这个错误的原因就是方法没找到。根据报错,找出这个方法名,如下图:系统未找到dao包下,PageDao类的getTotalRecordWarehouseAll()方法。根据实际情况解决,可能是接口没对应好。...原创 2019-11-19 15:20:58 · 569 阅读 · 0 评论 -
404,server did not find a current representation for the target resource or is not willing to disclo
网页输入项目地址后 报错:HTTP Status 404 – Not FoundType Status ReportMessage /ssmTest/listCategoryDescription The origin server did not find a current representation for the target resource or is not willing...原创 2019-11-08 15:38:45 · 507 阅读 · 0 评论 -
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
报错:严重: Error configuring application listener of class [org.springframework.web.context.ContextLoaderListener]java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener...原创 2019-11-08 14:39:56 · 102 阅读 · 0 评论 -
Parse error in application web.xml file atweb.xmlorg.xml.sax.SAXParseExceptionXML 文档结构必须从头至尾包含在同一个实体
报错:org.apache.tomcat.util.descriptor.web.WebXmlParser parseWebXml严重: Parse error in application web.xml file at [file:/C:/Users/####/apache-tomcat-8.5.42/webapps/ssmTest/WEB-INF/web.xml]org.xml.sax...原创 2019-11-08 13:54:19 · 577 阅读 · 0 评论 -
poi-3.6.jar的下载和导入(手动导入和自动导入)
poi-3.6.jar的下载http://maven.outofmemory.cn/org.apache.poi/poi/3.6/手动导入poi-3.6.jar包1.右击项目,选择‘Build Path’ → ‘Configure Build Path’2.进入如下界面,点击‘Add External JARs’,手动添加Jar包...原创 2019-11-07 15:19:28 · 2320 阅读 · 0 评论 -
SSM框架连接MySql和SqlServer数据库的配置(database.properties文件和pom.XML需要添加的jar包)
1. database.properties文件MySql的database.properties文件配置:driver=com.mysql.jdbc.Driverurl=jdbc:mysql://localhost:3306/appinfodb?useUnicode=true&characterEncoding=UTF-8username=rootpassword=root...原创 2019-11-06 15:11:43 · 1068 阅读 · 0 评论 -
welcme-file-list标签作用
<welcome-file-list>的作用是制定首页。在web.xml中配置一个欢迎页,用于当用户在url中输入工程名称或者输入web容器url(如http://localhost:8080/)时直接跳转的页面。比如:你写的项目 地址是 127.0.0.1里边有一个也页面 index.jsp如果要访问这个页面的话你要输入 127.0.0.1/index.jsp如果在 里指定...原创 2019-11-06 15:05:03 · 846 阅读 · 0 评论 -
报错The type org.xmlpull.v1.XmlPullParser cannot be resolved. It is indirectly referenced from require
报错内容:The type org.xmlpull.v1.XmlPullParser cannot be resolved. It is indirectly referenced from required .class files原因:XmlPullParser这个类依赖于 xstream,解决办法:缺少xmlpull.jar 这个jar包,资源和jar包下载http://pan.ba...原创 2019-10-31 11:28:55 · 397 阅读 · 0 评论 -
The import org.junit.Test conflicts with a type defined in the same file报错
情景:项目引入Junit后,进行单元测试,莫名其妙报了个这样的错误The import org.junit.Test conflicts with a type defined in the same file 原因1:常规原因,导入的jar包相冲突原因2:写junit测试的Java类名为Test.java 或者 包名也是Test,仍然会报这个错误。...原创 2019-10-14 15:38:07 · 368 阅读 · 0 评论 -
Junit -TestSuite的用法和作用
在这样的情景:有两个测试类,TestCase1 和 TestCase2 (或者更多:TestCase3,TestCase4.。。)TestSuite使用背景:如果有很多工具类需要被测试,那么就会有 TestCase2, TestCase3, TestCase4,要挨个去执行这些单独的测试类,也是比较麻烦的,所以就有了 TestSuite的概念TestSuite作用:执行多个测试类...原创 2019-10-14 13:22:58 · 3862 阅读 · 1 评论 -
Junit测试类—Assert的用法
背景:main方法测试有缺陷,使用Junit测试@Testpublic void testSum1() { int result = SumUtil.sum1(1, 2); Assert.assertEquals(result, 3);}Assert.assertEquals(result, 3); 表示对 result 数值的期待是 3,如果是其他数值,就无法通过测试。关于 As...原创 2019-10-14 10:35:15 · 960 阅读 · 0 评论 -
ClassNotFoundException:com.common.SessionFilter/ClassNotFoundException:com.common.HeaderFilter
报错情况:java.lang.ClassNotFoundException: com.draeger.common.SessionFilterjava.lang.ClassNotFoundException: com.draeger.common.HeaderFilter解决办法:控制台说“没有找到com.xxx.common.SessionFilter”这个Class如果没有配错,你就...原创 2019-10-11 10:43:00 · 221 阅读 · 0 评论 -
BeanCreationException/NoSuchBeanDefinitionException/NestedIOException/BuilderException/TypeException
报错:BeanCreationException/NoSuchBeanDefinitionException/NestedIOException/BuilderException/TypeException/ClassNotFoundException原因/解决办法:打开mapper.xml文件,①检查 ,②parameterType=“这个位置是否填写正确”,③resultMap=“这个位...原创 2019-10-11 10:25:50 · 125 阅读 · 0 评论 -
BeanCreationException: Error creating bean with name 'categoryController'/ClassNotFoundException
异常内容:严重: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]org.springframework.beans.factory.BeanCreationException: Er...原创 2019-10-11 09:56:20 · 1759 阅读 · 0 评论