springboot/vue 报错解决

1.报错表

报错:请确保已在git中配置

您的“user.name”和“user.email”

请确保已在git中配置您的“user.name”和“user.email”

解决:

cd D:\downdown\xiazaila\gitdown\Git\bin

git config --global user.email "2869xxxxx@qq.com"  引号内输入你的git邮箱

>git config --global user.name "clever"  //引号内输入你的git账号

报错:下载插件失败

报错出现啥啥啥serve的

解决:官网下载插件到idea安装的pliugs目录下

报错:@Restcontroller爆红无补全

在springboot文件下controller中创建的类中手动输入  [@Restcontroller]  时,爆红且没有提示语句(没有帮助完善代码)

解决:  maven配置正常的情况下,点击报错,选中第一项并点击右下角add

          在pom.xml文件的依赖中添加下述代码

<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-web</artifactId>
</dependency>

成功! 

参考:【http://t.csdnimg.cn/IlnCg】 

报错:无法运行调试

运行调试按钮为灰色,无法点击

解决:设置jdk

报错:无效的目标发行版!

SpringBoot报错    java: 无效的目标发行版: 16 / 21

解决:

1.file -poject strcture - jdk版本【1.8】 、Language level【8 Lambdas】

2.settings-build、excution、deployment -java complier -version【8】、目标字节【8】

3.pom.xml文件 - "spring-boot-starter-parent"-version【2.7.14】

4.pom.xml文件 - java.version【8】

参考【http://t.csdnimg.cn/4vo0L

报错:错误的类文件

java: 无法访问org.springframework.boot.SpringApplication
  错误的类文件: /D:/downdown/xiazaila/ideadown/mavendown/apache-maven-3.6.1/maven_repository/org/springframework/boot/spring-boot/3.2.1/spring-boot-3.2.1.jar!/org/springframework/boot/SpringApplication.class
    类文件具有错误的版本 61.0, 应为 52.0
    请删除该文件或确保该文件位于正确的类路径子目录中。

解决:按提示把错误的类文件删掉(我剪切放在桌面了)

报错:导入dependence报错1

导入数据库和mybatis依赖dependencies时报错

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

解决:导入数据库配置 

参考【http://t.csdnimg.cn/iD7hQ】 

报错:导入dependence报错2

安装mybatis-plus依赖时出现的错误

Failed to read artifact descriptor for com.baomidou:mybatis-plus-boot-starter:jar:3.1.0

Failed to read artifact descriptor for org.apache.logging.log4j:log4j-to-slf4j:jar:2.21.1

Failed to read artifact descriptor for com.baomidou:mybatis-plus-boot-starter:jar:3.1.0

Failed to read artifact descriptor for org.apache.logging.log4j:log4j-to-slf4j:jar:2.21.1

原因:maven库设置错误

解决:file-settings-build、explore、deployment - Maven - 勾选右边两个框 - 重写自己下载的maven路径

我的路径:

D:\downdown\xiazaila\ideadown\mavendown\apache-maven-3.6.1

若解决不了,参考:【http://t.csdnimg.cn/lPZcT

 报错:plugin依赖爆红

org.springframework.boot 爆红

解决:加上版本号

<version>${project.parent.version}</version>

解决! 

报错:vue out module

SyntaxError: Cannot use import statement outside a module

SyntaxError: Cannot use import statement outside a module

解决:看看有没有正确引入element-ui

npm i element-ui -S  //终端运行

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);               //以上三行写入main.js

若解决不了,参考【http://t.csdnimg.cn/ymb1c

报错:vue unspported

vue运行serve时报错 digital envelope routines::unsupported

解决:将下述代码写入package.json

"scripts": {

    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",

    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build"

 },

参考【http://t.csdnimg.cn/1AB99

报错:Exception during pool 

启动springboot项目报错HikariPool-1 - Exception during pool 

2024-01-12 19:31:52.567  INFO 23832 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
Fri Jan 12 19:31:52 CST 2024 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2024-01-12 19:31:57.957 ERROR 23832 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.

解决:

1.看看.yml(.properties)文件中数据库的url和账号密码有没有错误

2.看报错信息得知SSL出了问题

将url更改为:?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false

server:
  port: 3231
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/cruddemo?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false
    username: root
    password: ?????密码
    driver-class-name: com.mysql.cj.jdbc.Driver
//yml文件

参考【http://t.csdnimg.cn/6brgI

报错:dao层abstract报错

在dao层写函数时报错 Abstract methods do not specify a body

(抽象方法中不能有实体)

解决:在实体函数前加一个default

public interface FormDao {
    void saveForm(Form form){...}
}                                          //前


public interface FormDao {
    default void saveForm(Form form){...}
}                       
                                            //后

参考【http://t.csdnimg.cn/RTuA8】 

报错:(reading ‘post‘)

Cannot read properties of undefined (reading ‘post‘) 无法读取未定义的属性(读取“post”)

解决:

下载axios

npm install axios --save

并引入

// 引入axios
import axios from 'axios';
// 挂载到vue原型链上
Vue.prototype.$axios = axios;   //main.js中

报错:id doesn't have value

Cause: java.sql.SQLException: Field 'id' doesn't have a default value
public class Form {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)

    private Integer id;    //已标识id自增策略 但是数据库忘记设置

    private String pname;

    private String type;
    private String date;
    private String leader;
    private String lid;

    private String intr;

解决:

数据库设置自增

报错:前端method ...is not defined

Property or method index is not defined on the instance but referenced during render
属性或方法索引未在实例上定义        //控制台console报错

 解决:检查调用方法有没有拼写错误

我是button中click事件调用的方法和methods定义的方法不一致 导致报错

参考【http://t.csdnimg.cn/HSoZT

报错:jpa recent version 61.0

org/springframework/data/jpa/util/HibernateProxyDetector has been compiled by a more recent version(61.0) ,什么什么什么52.0

大致意思就是说jpa版本过高了不兼容 我是有一个3.2.1和一个2.7.14的jpa

      <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>2.7.14</version>
        </dependency>


依赖在pom.xml文件中设置

解决:

我把3.2.1版本的jpa依赖删了,留下了2.7.14版本

(其实就是根据报错信息把版本降下来)

报错:端口号被占用

Description:

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

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.

解决:打开cmd管理员权限

查询指定端口

netstat -ano|findstr 端口号

关闭进程

taskkill /t /f /im 进程号(PID)

pid就是查询端口号显示的最右列的数字

2.总结

idea->file->settings->maven 配置问题经常出现

pom.yml->dependence爆红问题经常出现

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值