密码输入错了。
不用管控制台的报错异常,如果不影响项目的话
原因:由于存放的图片的路径可能是在src外面的。这样子,打包成jar包之后,类中访问的路径是需要到src下找资源。这时候就出现找不到图片的情况。
File-Project structure(Ctrl+Alt+Shift+S)-Modules
Import Module
之后就正常了
浏览器缓存了css数据, 用隐私窗口打开,发现正常
#include<bits/stdc++.h>
using namespace std;
char str[100][100];
char reg[100];
int n,m,top=0;
int get(char ch){
for(int i=0;i<m;i++){
if(ch==reg[i])
return i;
}
return -1;
}
int use(int x,char ch){
for(int i=x;i<n;i++){
if(ch==str[i][3]||ch==str[i][5])
return i;
}
return -1;
}
int find(int x){
if(top<m)
return top++;
int ans=-1;
int w=-1;
for(int i=0;i<m;i++){
int v=use(x,reg[i]);
if(v>ans||v==-1){
ans=v;
w=i;
}
}
return w;
}
void print1(char ch){
if(ch=='+')
cout<<"ADD ";
else if(ch=='-')
cout<<"SUB ";
else if(ch=='*')
cout<<"MUL ";
else if(ch=='\\')
cout<<"DIV ";
}
void print2(char ch){
int x=get(ch);
if(x==-1)
cout<<ch<<endl;
else
cout<<"R"<<x<<endl;
}
int main(){
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++)
cin>>str[i];
for(int i=0;i<n;i++){
int x=get(str[i][3]);
if(x==-1){
x=find(i);
if(reg[x]!='\0'&&use(i,reg[x])>0){
printf("ST R%d, %c\n",x,reg[x]);
reg[x]=NULL;
}
printf("LD R%d, %c\n",x,str[i][3]);
}
print1(str[i][4]);
printf("R%d, ",x);
print2(str[i][5]);
reg[x]=str[i][0];
}
return 0;
}
int n,m; 定义了两遍,导致调试的时候出现错误
org.apache.poi:poi-ooxml:jar:unknown was not found in https://maven.aliyun.com/repository/public during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced
找不到这个依赖
小众的依赖, 因为springboot中未定义这个版本, 你也没有指定版本.
指定版本后正常
FileOutputStream outputStream=new FileOutputStream(new File("E:/test/info.xlsx"));
不存在test这个文件夹,不会自动创建文件夹
---没有配置tomcat插件
----已经被占用了,打开本地端口发现确实有进程占用
文件操作的时候减少使用Scanner,交互的时候可以考虑Scanner
public static void main(String[] args) throws FileNotFoundException {
File file = new File("test.txt");
Scanner sc = new Scanner(file);
String str;
StringBuffer buf = new StringBuffer();
while (sc.hasNext()) {
str = sc.nextLine();
for (int i = 0; i < str.length(); i++) {
buf.append(str.charAt(i));
}
}
}
重启项目之后Session仍然存在
X
server:
servlet:
session:
persistent: false
X 去掉快速部署的依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [C:\Users\kali\Desktop\java\day08-HTTP&Tomcat&Servlet\untitled3\target\classes\com\lgh\test\MainApplication.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 62
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:57) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE]
引起java.lang.ExceptionInInitializerError 错误的原因是:在类的初始化时,出错。也就是说,在加载类时,执行static的属性、方法块时,出错了。
或者是引入的某个东西的版本不对,因为springboot引入的部分以来会自己配置,比如你的jdk版本过高