当前位置: 首页 > news >正文

查企业网站有哪些为什么上传网站模板网站上没有文字和图片

查企业网站有哪些,为什么上传网站模板网站上没有文字和图片,策划推广是做什么的,wordpress ./文章目录 一#xff0c;product模块整合mybatis-plus1#xff0c;引入依赖2#xff0c;product启动类指定mapper所在包3#xff0c;在配置文件配置数据库连接信息4#xff0c;在配置文件中配置mapper.xml映射文件信息 二#xff0c;单元测试1#xff0c;编写测试代码product模块整合mybatis-plus1引入依赖2product启动类指定mapper所在包3在配置文件配置数据库连接信息4在配置文件中配置mapper.xml映射文件信息 二单元测试1编写测试代码执行单元测试 三错误记录1单元测试失败初步排查2缺失驱动类依赖 本节的主要内容是product模块整合mybatis-plus并进行单元测试测试微服务基本CRUD功能。 一product模块整合mybatis-plus 1引入依赖 使用mybatis-plus需要引入依赖。这一步在上一节已经在common模块引入这里只做记录无需再次引入。 dependencygroupIdcom.baomidou/groupIdartifactIdmybatis-plus-boot-starter/artifactIdversion3.2.0/version/dependency2product启动类指定mapper所在包 mybatis会根据Mapper代码文件中定义的接口生成代理类需要告知Mapper接口文件所在的包。 MapperScan的作用是在应用的配置类中指定一个或多个包Spring将会自动查找这些包下所有的接口并将它们注册为Spring Bean。 意味着在这些包中的所有标注了Mapper的接口都会被自动识别和实例化而无需在Spring的XML配置文件中显式声明每一个Mapper。 MapperScan(basePackages com.atguigu.gulimall.product.dao)3在配置文件配置数据库连接信息 spring:datasource:username: rootpassword: rooturl: jdbc:mysql://192.168.56.10:3306/gulimall_pms4在配置文件中配置mapper.xml映射文件信息 mybatis-plus:mapper-locations: classpath*:/mapper/**/*.xmlglobal-config:db-config:id-type: auto关于配置mapper-locations: classpath*:/mapper/**/*.xml的说明 这个配置声明的是mybatis映射文件的路径classpath中的号表示除了扫描当前项目的类路径还会扫描所以来的包的类路径 下面的配置将主键设定为自增主键在调用接口保存数据时主键如果不指定会自增。 global-config:db-config:id-type: auto二单元测试 1编写测试代码执行单元测试 在test文件夹下的测试类中加入如下测试代码 Autowiredprivate BrandService brandService;Testpublic void testSaveBrand() {BrandEntity brandEntity new BrandEntity();brandEntity.setName(华为);brandService.save(brandEntity);}测运行testSaveBrand方法测试通过说明配置正确。 数据库中也能看到一条对应的数据说明单元测试成功符合预期。 三错误记录 1单元测试失败初步排查 单元测试没跑成功报错信息如下 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name attrAttrgroupRelationController: Unsatisfied dependency expressed through field attrAttrgroupRelationService; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name attrAttrgroupRelationService: Unsatisfied dependency expressed through field baseMapper; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name attrAttrgroupRelationDao defined in file [D:\ideaprojects\gulimall2024\gulimall-product\target\classes\com\atguigu\gulimall\product\dao\AttrAttrgroupRelationDao.class]: Unsatisfied dependency expressed through bean property sqlSessionFactory; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name sqlSessionFactory defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method sqlSessionFactory parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name dataSource defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method dataSource threw exception; nested exception is java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader 看上面堆栈信息的最后面的信息 Factory method dataSource threw exception说明极有可能是数据库连接信息配置的有问题。 仔细检查配置文件发现数据库url配置少了端口信息。 修改配置文件重新执行单元测试仍然失败。 2缺失驱动类依赖 仔细看堆栈信息发现有这样一行Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Threa没有驱动类应该是少了MySQL Driver相关的依赖。 考虑到这个依赖是其他模块也需要的依赖所以应该在common模块的pom.xml中声明依赖。 dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdscoperuntime/scopeversion5.1.38/version/dependency
http://www.w-s-a.com/news/804821/

相关文章:

  • wordpress建站seo鞍山制作网站哪家好
  • 网站空间流量查询上海门户网站制作
  • 网站开发技术是什么专业会的加强普法网站和普法网络集群建设
  • 上海建筑网站seo 推广
  • 乌兰察布做网站公司爱站网关键词挖掘工具站长工具
  • 白银网站建设白银申请网站空间怎么做
  • 免费炫酷网站模板网站建设需要用到什么软件有哪些
  • 电商网站开发 文献综述大型网站建设企业
  • 如何在建设部网站补录项目单仁牛商
  • 社保网站上做减员一直不审核软件程序开发
  • 网站友情链接购买天元建设集团有限公司资质
  • 南山商城网站建设哪家技术好株洲seo网站优化软件
  • 服务类网站建设18款禁用网站app直播
  • 电子商务网站建设需要物流网站开发公司
  • 网站的系统建设方式有哪些内容宁波网站建设公司
  • 网站开发 技术方案品牌建设总要求
  • 中卫网站建站设计seo专员的工作内容
  • h5商城网站是什么意思.net 网站开发框架
  • 西安网站改版的公司软件外包是什么意思
  • 网站建设了解眉山网站优化
  • 做网站用php还是node如何申请网站域名流程
  • 销售公司怎么做网站删除wordpress
  • 毕节网站怎么做seohtml代码特效银河系
  • 淄博品质网站建设网站引导页案例
  • 网站建设虚拟空间小豹子韬韬是哪个网站做的
  • 网络司网站如何建立公司网站建议和规则
  • 织梦网站模板后台密码找回企业vi设计公司性价比高
  • php 爬取网站所有链接传奇手游发布网站
  • 免费软文网站wordpress中文名注册
  • 企业网站建设研究目的意义怎样设计一个公司网站