Tag Archives: report errors

File.createNewFile report errors java.io.IOException , resolved

if (!targetFile.exists()){
    targetFile.createNewFile();
  }

When creating a file, we may be in a series of folders. When the folder does not exist, we cannot create a file

 File targetFile = new File(videoFramesPath+File.separator + dir + File.separator + UUID.randomUUID().toString() + ".jpg");

Solution:
judge whether the folder exists before creating the file,

if (!targetFile.getParentFile().exists()){
  targetFile.getParentFile().mkdirs();
}
if (!targetFile.exists()){
    targetFile.createNewFile();
}

Error: field * doesn’t have a default value

https://www.cnblogs.com/sdfd101/p/5111851.html

There are two conventional methods

Solution 1: (enough)

In the database, set the default value for the error reporting field, integer: 0, string: null,

Find the corresponding table – design table – default selection box (set default value)

Solution 2:

MySQL installation directory – & gt; search open my.ini , find
sql mode = strict_ TRANS_ TABLES,NO_ AUTO_ CREATE_ USER,NO_ ENGINE_ SUBSTITUTION”

Amend to read

sql-mode=“NO_ AUTO_ CREATE_ USER,NO_ ENGINE_ SUBSTITUTION”

Then restart mysql

My own mistake is that the entity class doesn’t follow the hump rule. The appurl written by the entity class can be changed to appurl. I don’t pay attention to this very often

Idea submits code to git / code cloud warehouse for the first time

I’m too lazy. I’ve never tried to submit code to my own warehouse. Today, I’m stimulated to submit a demo
for specific settings, please refer to:

https://blog.csdn.net/ilv_ xj/article/details/82662465

When I pushed the code, I reported “push rejected”
Baidu gave me a reliable solution, which is outputting git pull origin master — allow unrelated histories on the idea console (ALT + F12)

If you haven’t saved your git account and password before, windows will jump out of a similar login box, enter your git account and password, and then you will see the figure below to show that you can go to push. It’s successful

com.qcloud.cos.exception.CosServiceException Access Denied

com.qcloud.cos.exception.CosServiceException Access Denied. (Status Code 403; Error Code AccessDenied; Request ID NWRlNjM3NDVfY2FhMzNiMGFfNjgzMV8yMDc3MzVl); Trace ID OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1NmI1M2E2MTRlY2MzZDhmNmI5MWI1OTQyYWVlY2QwZTk2MDVmZDQ3MmI2Y2I4ZmI5ZmM4ODFjYjEzMGU3N2I0OTJjYTAwYWExNjJhODI1NTRkOGZlM2Y=

**Reason: * there is no cos bucket. Please check the appid secretid secretkey configuration file and bucket details in the account

Solve Linux docker pull error get https://registry-1.docker.io/v2/ : Net / http: TLS handshake timeout

Solution:

Step 1: through dig @ 114.114.114.114 registry-1 docker.io Find available IP address

The IP address is not fixed and may change, so you need to try several more times (several IP)

Step 2: modify/etc/hosts docker.io The relevant domain name is resolved to other available IP addresses

Step 3: after saving the configuration file, try again many times to download the image successfully

Step 4: verify success

Reprinted: https://www.cnblogs.com/python-wen/p/11224555.html

java.lang.IllegalStateException : unable to read meta data for class

Recently, in the refactoring project,
another colleague modified the feign interface’s class, which led to an error at startup

It’s true that idea global search doesn’t have this. Later, I thought that there was one under resources of feign module spring.factories File, which defines the class address of automatic assembly when starting, enable autoconfiguration { }The feign interface needs to be updated

Nginx redirects the interfac /API to another interface/API

Recently, there is a problem with the project. When the client accesses the background, the path is missing. The background will definitely report an error of 404. However, at present, the client has no way to correct this error in a short time, so it can only modify it in the background java.xxxx.com/abc/auth/queryUserById . JSON
actual request – java.xxxx.com/auth/queryUserById .json

With spring cloud experience, you can see from this path that nginx and gateway are used

I have checked some methods on the Internet, mainly redirecting the request in nginx, but my request is post request. After redirection, it becomes get, and some parameters are lost

Finally, I tried many times. Finally, this situation can only be solved by reverse proxy

Location/auth/{
omit : http://xxx.xxxx.xxx : XXX (IP): port/auth /;
omit

}

This solves, but still wants to make complaints about the path of Tucao, and the mistake is too low.

Idea can’t submit code to GitHub when using git — too much code / file leads to submission failure

My code is more than 1G. When I submit to GitHub, it is always stuck at 28%, and then push fail. Some attachments over 50/100M will report an error to large On the Internet, some people say that hosts should be set if it is blocked, others say that buffe is not enough, and git should be used to enlarge the character area, but none of mine can

The ultimate solution:

1. Forcibly release the binding relationship between GITS of the project, and operate in idea settings
2. Delete the. Git folder (hidden file) of the project, and I also delete the large files (save some messy non code files)
3. Re submit the code to git management in VCs, which can be committed locally in batches, and then submitted to the remote warehouse
4. Upload completed

This method is the same as the computer crash forced shutdown restart, may lose data, delete. Git file will delete the original submission record, this should be careful