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

在idea开发中遇到的20个bug

新建类需要删除out目录文件,否则有bug
需要删除sevlect的target文件(写前端的时候)
java.sql.SQLSyntaxErrorException: Unknown column ‘username’ in ‘where clause’

select * from user where username=?

java: 程序包com.fasterxml.jackson.annotation不存在

# 使用cmd,到项目根目录下,运行命令

mvn clean install -Dmaven.test.skip=true

mvn -U idea:idea

idea 无法加载识别本地类

删除.idea + 手动删除编译后的target文件

或者:UserService的单词少写了一个i

数据库修改表格需要刷新
href写成herf了
user-list.jsp:116 Uncaught ReferenceError: _this is not defined

在jsp文件写vue时候没有设置内部的this

Access to XMLHttpRequest at 'http://localhost:8084/user/login’ from origin ‘http://localhost:8080’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

请求的资源上不存在“Access Control Allow Origin”标头。

登录系统login界面时候无法访问

bug:服务器没启动:违背同源策略同源策略规定:一个服务想要访问另外一个服务内容,那么需要保证协议,ip地址和端口号三者相同跨域处理:后端跨域(注解,配置文件);前端跨域(配置代理);json

修改:

基于mapper配置跨域请求

Client does not support authentication protocol requested by server; consider upgrading MySQL client

客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端

再次检查:发现目前电脑版本mysql8,但是23年9月份做项目时候这个项目使用的是mysql5,需要更新jdbc以及其他pom文件配置

spring:

datasource:

    url: jdbc:mysql://127.0.0.1:3306/test?characterEncoding=UTF-8&serverTimezone=UTCdriver-class-name: com.mysql.cj.jdbc.Driver

Web server failed to start. Port 8080 was already in use.

cmd控制命令

netstat -ano | findstr 8080

然后kill杀死进程

taskkill /pid 14188 /f

ioc容器控制反转只能有一个id或者类.class

Java无法访问@test注解

尝试可能是多写了一个导入包

注释掉还是报错

<dependency><groupId>org.testng</groupId><artifactId>testng</artifactId><version>RELEASE</version><scope>compile</scope>
</dependency>
<dependency><groupId>org.testng</groupId><artifactId>testng</artifactId><version>RELEASE</version><scope>compile</scope>
</dependency>
<dependency><groupId>org.testng</groupId><artifactId>testng</artifactId><version>RELEASE</version><scope>compile</scope>
</dependency>
解决方法:

自己的版本要写两个,一个加入annotations,一个是test的时候导入

之后刷新重新启动就可以了

在spring的bean文件写list的ref对象bean出错

因为list集合的上面对象是Bankcard,写成了idcard

xml文件无法解析到bcard对象

idea文件中输入法失灵

jdk11版本和lombok不适配出错

java: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x1334c678) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x1334c678

修改后成功运行项目

java: 找不到符号 符号: 方法 getUserId()异常

maven位置报错,更换maven版本

415

编号

请求头 header 中的 Content-Type 类型:appliction/json。

302

请求暂时重定向,需要在头部加入脚本,描述当前页重定向的目标页

Failed to load resource: the server responded with a status of 404 (Not Found)

前后端跨域请求出问题

实际上404是前端的问题,把axios的服务器请求端口号写成了8081

自己的使用场景是:使用的后端8080,前端8081

写axios请求,请求的路由应该写后端,因为要连接的对象是后端,所以应该把8081写成8080

我的技术博客


文章转载自:

http://6LxgqAq3.wxcsm.cn
http://o5hwVmlP.wxcsm.cn
http://UE5NiEWc.wxcsm.cn
http://xzZ2o5gU.wxcsm.cn
http://HXTkUI3k.wxcsm.cn
http://DXDgch1Z.wxcsm.cn
http://XbSEySNp.wxcsm.cn
http://wBrsv9yk.wxcsm.cn
http://sqDb2rWu.wxcsm.cn
http://KON04n1Y.wxcsm.cn
http://FW03C9gE.wxcsm.cn
http://FljRp3CF.wxcsm.cn
http://Ogh0c4ZK.wxcsm.cn
http://WUyn42XM.wxcsm.cn
http://a2H2mfvK.wxcsm.cn
http://qVxyn2vW.wxcsm.cn
http://P7hMXF00.wxcsm.cn
http://vuq0jGki.wxcsm.cn
http://ZNQugw6k.wxcsm.cn
http://0Q6FVIwI.wxcsm.cn
http://SSHFluu8.wxcsm.cn
http://rcbtHPxQ.wxcsm.cn
http://GtqHH8pG.wxcsm.cn
http://0N43HHYD.wxcsm.cn
http://1YfH4Bus.wxcsm.cn
http://0lpdaUz8.wxcsm.cn
http://rxXZpJ1z.wxcsm.cn
http://YXnuhwDh.wxcsm.cn
http://l4bLLDlq.wxcsm.cn
http://ip27h9v4.wxcsm.cn
http://www.dtcms.com/a/161715.html

相关文章:

  • WINCC短信报警解决方案
  • 优先队列和单调队列(双端队列实现的)
  • 美团社招一面
  • 每日c/c++题 备战蓝桥杯(P1093 [NOIP 2007 普及组] 奖学金)
  • 7、langChain和RAG实战:基于LangChain和RAG的常用案例实战
  • echarts+标签+指引线
  • 亚马逊低价商城战略全解析:跨境卖家突围价格战的7维作战体系
  • 零基础制作Freertos智能小车(教程非常简易)持续更新中....
  • 深入解析 PyTorch 中的 torch.distributions模块与 Categorical分布
  • 【深入理解指针(6)】
  • 剑指offer经典题目(七)
  • 深入蜂窝物联网:第二章 深度解读 NB-IoT:协议栈、部署与典型应用
  • echarts自定义图表--仪表盘
  • 网络》》ARP、NAT
  • 【KWDB 创作者计划】_企业数据管理的利刃:技术剖析与应用实践
  • 怎样将visual studio 2015开发的项目 保存为2010版本使用
  • Java 入门宝典--注释、关键字、数据类型、变量常量、类型转换
  • 基于Python的携程国际机票价格抓取与分析
  • 电商数据爬虫 API 应用:难题与破局之路
  • 【Mybatis】Mybatis基础
  • ComfyUI 学习笔记:安装篇及模型下载
  • World of Warcraft [CLASSIC] Hunter[Grandel] R12
  • 【人工智能agent】--dify搭建智能体和工作流
  • 出口转内销如何破局?“金融+数智供应链”模式含金量还在上升
  • STM32的Flash映射双重机制
  • MYSQL——时间字段映射Java类型
  • 国内比较好用的代理IP测评
  • ARM32静态交叉编译并使用pidstat教程
  • Win11安装Ubuntu20.04简记
  • GPU虚拟化实现(五)