自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 资源 (2)
  • 收藏
  • 关注

原创 NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException 的两种解决方案

问题NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException原因缺少jackson依赖lib文件夹缺少依赖解决解决1jackson-databind已经内置依赖了,一般来说不用再用第二个和第三个。<dependency><groupId>com.fasterxml.jackson.core</groupId> <artifactId>ja

2020-07-31 18:03:15 7867 1

原创 【Spring】基于全注解的Spring的声明式事务控制

Daopackage com.itheima.dao.impl;import com.itheima.dao.IAccountDao;import com.itheima.domain.Account;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.jdbc.core.BeanPropertyRowMapper;import org.springframework.

2020-07-29 17:39:31 108

原创 java.sql.SQLException: Can‘t call commit when autocommit=true

问题java.sql.SQLException: Can't call commit when autocommit=true at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930) at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1535) at com.mchange.v2.c3p0.impl.NewProxyConnection.commit(New

2020-07-28 23:38:12 766

原创 IllegalStateException: Failed to resolve expression: @AfterThrowing(throwing=, pointcut=, value=

问题警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in file [D:\IdeaProjects\spring-study\day03-proxy-aop\t

2020-07-28 22:25:15 951

原创 【Spring】 JdbcDaoSupport的使用

<packaging>jar</packaging> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.1.16.RELE

2020-07-28 22:02:30 316

原创 NoClassDefFoundError: org/aspectj/lang/JoinPoint ,ClassNotFoundException: org.aspectj.lang.JoinPoint

错误标题的错误,在最后2个异常警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService' defined in class path resource [bean.xml]: BeanPo

2020-07-28 18:06:22 582

原创 ClassCastException: org.springframework.aop.aspectj.AspectJExpressionPointcut

问题Exception in thread "main" java.lang.ClassCastException: org.springframework.aop.aspectj.AspectJExpressionPointcut cannot be cast to com.wei.service.IAccountService at AOPTest.main(AOPTest.java:9)原因将切点表达式的id与AccountService的实现类的bean的id取了一样的名字。

2020-07-28 15:32:28 938

原创 【设计模式】Java动态代理

动态代理可以实现事务控制。让代码不再臃肿和繁琐。动态代理特点:字节码随用随创建,随用随加载。作用:不修改源码的基础上对方法增强。分类:基于接口的动态代理和基于子类的动态代理。基于接口的动态代理涉及的类:Proxy提供者:JDK官方如果创建代理对象? 使用Proxy类中的newProxyInstance方法。创建代理对象的要求:被代理类最少实现一个接口,如果没有,则不能使用。newProxyInstance方法的参数:ClassLoader :它是.

2020-07-28 12:40:50 162

原创 【Spring】IOC案例从XML到注解

本例不展示业务代码。仅展示跟spring的使用相关的代码。基于XML的IOC案例service 实现类public class AccountServiceImpl implements AccountService { private AccountDao accountDao; public void setAccountDao(AccountDao accountDao) { this.accountDao = accountDao; }}.

2020-07-27 16:43:55 122

原创 bean 引用 property 的name属性报红

问题原因使用构造函数注入需要写构造函数。通过set注入需要写set方法。本例使用property标签,需要使用set注入。在com.wei.service.impl.AccountServiceImpl 类中没有写set方法解决public class AccountDaoImpl implements AccountDao { private QueryRunner runner ; public void setRunner(QueryRunner runner) {

2020-07-27 13:31:44 3714

原创 【Spring】Spring 知识点整理及补充

Spring概述Spring的两大核心:(控制反转)IoC 和(面向切面编程) AOP整合开源的第三方框架和类库,是使用最多的Java EE 企业应用开源框架不使用EJBSpring 优势方便解耦,简化开发AOP编程的支持声明式事务的支持方便程序的测试方便集成各种优秀的框架降低Java EE API 的使用难度,Spring 对其进行封装Java 源码是经典学习案例Spring 体系结构pow依赖<dependencies> <depen

2020-07-26 23:45:50 225

原创 Exception encountered during context initialization ; No default constructor found; nested exception

问题七月 26, 2020 2:05:03 下午 org.springframework.context.support.AbstractApplicationContext refresh警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating b

2020-07-26 14:08:29 822

原创 【mybatis】 从0开始搭建mybatis、注解开发

本篇文章的目的主要是为了熟悉xml配置与注解配置的对应关系。从0开始搭建环境pow.xml 导入maven坐标、依赖搭建mybatis的必需品 :mybatis3、mysql-connector-javalog4j、junit、lombok <dependencies> <dependency> <groupId>org.mybatis</groupId> <ar.

2020-07-25 22:05:08 143

原创 BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalArgumentException:

问题org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.### The error may exist in com/wei/mapper/UserMapper.xml### The error occurred while processing mapper_resultMap[userAccountMap]### Cause: org.apache.ibatis.builder.Bui

2020-07-25 21:21:46 1300

原创 【mybatis】懒加载的应用 一对一、一对多 实例

懒加载(延迟加载)的使用懒加载是一种延迟技术,当我们没有使用被标记延迟加载的元素时,mybatis便不会执行select的语句的实现。通俗的讲,有使用到,就会被加载即被association或者collection标签关联的数据。本例中用户对应多个账户,账户对应一个用户。表信息如下主配置文件mybatis-config.xml 需要添加 懒加载的配置。 <settings> <setting name="lazyLoadingEnable

2020-07-25 17:29:41 747

转载 【mybatis】 setting的用法和解释

setting 用法<!-- settings是 MyBatis 中极为重要的调整设置,它们会改变 MyBatis 的运行时行为。 --> <settings> <!-- 该配置影响的所有映射器中配置的缓存的全局开关。默认值true --> <setting name="cacheEnabled" value="true"/> <!--延迟加载的全局开关。当开启时,所有关联对象都会延迟.

2020-07-25 14:37:13 944

原创 路径没有问题,但是中不到mybatis主配置文件mybatis-config.xml , IOException: Could not find resource mybatis-config.xml

问题路径没有问题,但是中不到mybatis主配置文件mybatis-config.xml , IOException: Could not find resource mybatis-config.xml删除了曾经加入的模块。没注意爆红了。还有打包方式。原因我也不清楚为什么???有大佬知道的话可以在评论区告知一下。谢谢!解决删除已经删除的模块删除packaging标签,或者将pow修改为jar或者war受教至此blog 评论区...

2020-07-25 14:21:08 352 1

原创 使用了typeAlias 的package 属性造成的别名冲突。

问题User里的roles 属性 没办法解析。即不存在原因与另外一个同名的User类冲突了。因为在idea的工程中为了方便又创建了一个mudel,或者同个项目的不同包的同名类名,因为别名的规则所以会冲突。解决使用xml在主配置文件中配置,但是会与原本的package冲突<typeAliases> <typeAlias type="com.wei.mapper.UserMapper" alias="user2" /></typeAliases

2020-07-25 12:05:17 628

原创 【mybatis】一对一、一对多和多对多实例 笔记

数据库表结构、数据account表user表一对一 association、javaType第一种方式<select id="findAllAccountUser" resultType="com.wei.pojo.AccountUser"> select a.*,u.username,u.address from account a ,user u where a.uid = u.id</select>//继承Account,并且

2020-07-25 00:13:18 132

原创 .PersistenceException: ### Error querying database.Cause: java.lang.NullPointerException

错误[org.apache.ibatis.io.ResolverUtil]-Checking to see if class com.wei.mapper.UserMapper matches criteria [is assignable to Object][org.apache.ibatis.transaction.jdbc.JdbcTransaction]-Opening JDBC Connectionorg.apache.ibatis.exceptions.PersistenceExcep

2020-07-24 16:42:20 4867

原创 【Spring】Spring配置文件bean标签的autowire属性

参考自:https://www.cnblogs.com/ViviChan/p/4981539.htmlautowire属性的作用当在一个bean的属性里注入另外一个bean,要使用< property>标签+ref引用的形式。但是在大型项目,一个被引用的bean的id改变了,那么需要修改所有引用了它的id如果使用了bean 的 autowire 属性,那么引用bean的ref就都不需要修改了。<!-- 使用引用的方式 --><bean id="cat" clas

2020-07-23 13:26:31 3526

原创 【Spring】Spring容器装配Bean的三种方式

参考文献:https://www.cnblogs.com/jimisun/p/9742293.html隐式的Bean发现机制和自动装配在Java类中配置组件扫描主配置类@Configuration@ComponentScan("com.wei")public class ApplicationConfig {}@Data@Componentpublic class User { @Autowired private Cat cat;}@Componentpub

2020-07-23 09:32:12 210

原创 NoSuchBeanDefinitionException: No qualifying bean of type ‘com.wei.pojo.User‘ available

问题org.springframework.context.support.AbstractApplicationContext refresh警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name

2020-07-23 00:07:27 659

原创 通配符的匹配很全面, 但无法找到元素 ‘tx:advice‘ 的声明

问题通配符的匹配很全面, 但无法找到元素 ‘tx:advice’ 的声明原因spring配置文件的缺少配置。找不到 tx:advice’的声明 ,就是缺少 tx的 xsi:schemaLocation 约束。找不到aop:xxx的声明,就是缺少aop的xsi:schemaLocation 约束。解决添加tx、aop 约束配置。如果原项目还有注解,自行添加。<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://

2020-07-22 21:35:18 1036

原创 【Spring】整合 mybatis-spring

整合 mybatis-springpow.xml<dependencies> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.5</version> </dependen

2020-07-22 18:26:51 163

原创 .CacheException: Error serializing object. Cause: java.io.NotSerializableException: Blog

问题查询结果出来了,但是报了一个CacheException。org.apache.ibatis.cache.CacheException: Error serializing object. Cause: java.io.NotSerializableException: com.wei.pojo.Blog at org.apache.ibatis.cache.decorators.SerializedCache.serialize(SerializedCache.java:94) at or

2020-07-22 11:54:17 362

原创 【mybatis 】mybatis 知识点整理及补充

where & if<select id="findBlog" resultType="com.wei.pojo.Blog"> select * from blog <where> <if test="author!= null"> author = #{author} </if> </where> &l

2020-07-15 23:09:31 402

原创 serverTimezone 时区问题

错误查询异常。网络随处可见的数据库时区问题。原因因为时区设置的问题。设置时区即可解决。UTC代表的是全球标准时间 ,但是我们使用的时间是北京时区也就是东八区,领先UTC八个小时。UTC + (+0800) = 本地(北京)时间解决方法一jdbc:mysql://localhost:3306/db?serverTimezone=Asia/Shanghai方法二idea 中设置数据库的属性serverTimezone 为UTC...

2020-07-15 00:02:39 3318 2

原创 resultMap 和association collection的一些问题 ReflectionException: Could not set property ‘users‘

错误org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'users' of 'class com.itheima.domain.Role' with value 'User{id=41, username='老王', address=

2020-07-14 22:05:01 501

原创 【mybatis 】mybatis 配置文件 代码复用

主配置文件 mybatis-config.xml<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration> <settings>

2020-07-14 09:37:11 565

原创 pow文件异常,报红线 ,Failure to find XXX was cached in the local repository

问题Failure to find org.mybatis:mybatis-parent:pom:32-SNAPSHOT in https://maven.aliyun.com/repository/public was cached in the local repository, resolution will not be reattempted until the update interval of aliyunmaven has elapsed or updates are forced

2020-07-13 00:02:54 1332

原创 CSDN 基本使用test

1.markdown学习1.1标题_#加空格1.1.1三级标题1.2字体粗体_两边2个*号斜体_两边1个*号删除线 _两边2个减号1.3引用_ >加空格引用了!!1.4分割线_3个减号或3个*1.5图片_![图片名] (图片地址)[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-z0rpYT6W-1594180748860)(C:\Users\nick\Desktop\1.jpg)]![image-20200708114007518](C:

2020-07-08 11:59:41 868

using thymeleaf.pdf

thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用thymeleaf的使用

2020-09-22

vuejs插件.zip

适用于IDEA2019.3.1 — 2019.3.5的版本。 发布于Dec 25, 2019 适用于IDEA2019.3.1 — 2019.3.5的版本。 发布于Dec 25, 2019 适用于IDEA2019.3.1 — 2019.3.5的版本。 发布于Dec 25, 2019

2020-08-15

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除