Tag Archives: idea

[Solved] IntelliJ idea error: error: Java does not support release 5

Method 1

1. Confirm to configure Maven

Find the path in Maven home path and find the Maven address \ conf \ setting xml

Select your own JDK version

<profile>
      <id>development</id>
      <activation>
        <jdk>1.8</jdk>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
      </properties>
    </profile>

Restart idea

Method 2

In project POM Specify the JDK version in the XML file

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>

[Solved] IDEA Compile Lombok to Generate getter/setter Error

Such as the title; It’s strange that Lombok normally generates getter/setter methods, but an error is reported when starting the project
configure idea

Solution:

File – Settings – build, execution, deployment compiler annotation processors (this package was imported from the previous project) – default – check enable annotation processing

Just start it again

[Solved] Spring cloud introduces zuul dependency error

When creating the zuul project, I found that spring cloud routing does not have zuul

and then directly click next. I think it is possible to introduce zuul dependency by directly writing dependency code in POM file
then I added the following dependencies to the POM file:

   <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.2.10.RELEASE</version>
        </dependency>

Then add @enablezuulproxy
to the startup class. Click Startup and find that an error is reported
Solution:
①: configure version and add & lt; spring-cloud.version>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>2021.0.0-RC1</spring-cloud.version>
    </properties>

②: add unified version configuration

  <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

③: add warehouse configuration

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

Method ①, ② and ③ seem to be indispensable, otherwise it will not start.

(in fact, the spring boot version conflicts with the spring cloud version)
we can click the zuul dependency package to see that it contains the starter of spring boot
therefore, we can directly cancel the parent tag so that it does not introduce parent dependency

however, I don’t think it’s good to cancel the parent dependency directly. After all, there are few introductions, and there is no need to consider the conflict of versions. Therefore, in order not to remove the parent tag, we can introduce the version dependency that does not conflict between spring boot and spring cloud.

Attach the complete POM configuration:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>cn.itcast.zuul</groupId>
    <artifactId>itcast-zuul</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>itcast-zuul</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <dependencies>


        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.0.2.RELEASE</version>
        </dependency>
    </dependencies>

</project>


org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testApplicat

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testApplication’: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.nos.test.TestApplication$$EnhancerBySpringCGLIB$$c1828724]: Constructor threw exception; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Invalid numeric type, found: STRING; nested exception is org.bson.BsonInvalidOperationException: Invalid numeric type, found: STRING

Question request: List all the course names that appear in the STUDENT collection (distinct)

 

 public List<String> test6_01(){
        Query query = new Query();
        List<Integer> list_course = mongoTemplate.findDistinct(query,"CID","student_course",Integer.class);
        System.out.println(list_course);
        List<String> list = new ArrayList<>();
        for(Integer i:list_course){
            Query query1 = new Query(Criteria.where("CID").is(i));
            Course course = mongoTemplate.findOne(query1,Course.class,"course");
            list.add(course.getNAME());
        }
        return list;
    }

Org.bson.bsoninvalidoperationexception: invalid numeric type, found: String prompts me to find the wrong data type. Only when the CID found is of string type can I find the data imported in the data. The CID is automatically set to string type.

Then let’s look at the specific usage of finddistinct() in mongodb: you can re query, but you can’t sort.

The method receives 4 or 5 parameters, respectively:

1 query criteria
2 fields to be de duplicated filed
3 collection database table to be queried
4 POJO instance corresponding to collection to be queried
5 return result class (return list of filed fields to be de duplicated)

After modification:

  public List<String> test6_01(){
        Query query = new Query();
        List<String> list_course = mongoTemplate.findDistinct(query,"CID","student_course",String.class);
        System.out.println(list_course);
        List<String> list = new ArrayList<>();
        for(String i:list_course){
            Query query1 = new Query(Criteria.where("CID").is(i));
            Course course = mongoTemplate.findOne(query1,Course.class,"course");
            list.add(course.getNAME());
        }
        return list;
    }

Query results:

cuda_error_launch_failed: unspecified launch failure [How to Solve]

Problem: error polling for event status: failed to query event: CUDA_error_launch_failed: unspecified launch failure

Troubleshooting: in the past, when my computer was in-depth learning, it automatically quit the program after training several epochs at a time. It can’t continue training. It can’t be a problem with the code, because the code can run directly on Ubuntu. Some people say that the video memory of the graphics card is insufficient, but sometimes it can train the whole network, query the GPU memory and find that the memory is not used during training.

Solution: through consulting the data, it is found that it may be the problem of the graphics card version. The driver version of my computer’s graphics card was 457 before, but there was no such problem after it was upgraded to 471.

[Solved] Tomcat runs JavaWeb servlet Error 404

Problem description

A new server template project is built with idea. After Tomcat is configured, the access report 404
is accessed

reason

Tomcat cannot load message 404 because war is not loaded

Solution:

An error occurs because the war artifact of this project is not loaded. You need to import this project as a artifact

and then select war_ Compared with war, the structure of the artifact will be consistent with the source directory for easy development

now the URL is the home page of the artifact by default

access

Spring project import @Resource Annotation Error [How to Solve]

An error is reported after the @resource annotation is introduced into the spring project

Solution:

@Resource annotations are provided by J2EE

However, jdk1.9 and above versions need to import a javax.annotation dependency package from pom.xml in maven:

<dependencies>
    <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
    </dependency>
</dependencies>

Solution to communication link failure with error in idea startup project

Problem description

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Solution

Option 1   Tomcat VM configuration parameters: – DJava. Net. Preferipv4stack = true

Option 2   ① Nginx configuring agent MySQL:

    ② Modify database connection: spring. Datasource. Url = JDBC: mysql://localhost:9999/demo?characterEncoding=utf8

Reference from:

https://blog.csdn.net/baidu_21349635/article/details/121032229
https://adong.blog.csdn.net/article/details/111501253

[Solved] BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans‘

Created a SpringBoot project, used SpringCloud, and then started the project and reported an error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘configurationPropertiesBeans’ defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]: Factory method ‘configurationPropertiesBeans’ threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata


It is found that the version of SpringBoot is inconsistent with the version of SpringCloud
Corresponding to the modified version


   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath/>
    </parent>
             <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version></version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

Prompt IPA processing failed when exporting IOS adhoc

Prompt IPA processing failed when IOS adhoc

View the log of standard to view errors

View standard’s log

The log contains a large string of simulator information, so directly search the x86 keyword, and then check which framework is included, and then CD go in. Remember to enter the framework and remove i386 and x86_ 64

lipo -info xxxx

Remove command:

lipo -remove i386 xxxx -o xxxx
lipo -remove x86_64 xxxx -o xxxx

View errors

Before, I was misled by the Internet. I had to search all the "x86" keywords, and then search out Ruby (universal. X86_64) , thinking about viewing or updating with lipo , which wasted a lot of time and failed… Finally, homebrew
is also updated

Finally, I tried to search error , and found that framework was included in bundle of tent , and finally it was OK to remove it
IPA processing failed will be prompted when IOS ad hoc , the framework in tencetopen is attached with x86 , after removal, you can check the keywords of failed or error in your log.

Mon 08

03:00

06:00

09:00

12:00

03:00

06:00

09:00

Tue 09

Remove all SDK schemas

Update relevant environment

IOS tasks

IOS diagram functionality to mermaid

Follow up interest can be focused on the following column or official account number [Python2048].

"Android - the world of hackers"
"difficult and miscellaneous bugs - no language"


Author: Altman Superman dujinyang

Source: CSDN

Original text: https://dujinyang.blog.csdn.net/

Copyright notice: This is the original article of blogger Du Jinyang. Please attach the blog link for reprint!

The project tag in the parent project POM file of Maven multi module project reports an error, and the error information is: \n

Error message

Reason: under the dependency management tab in the parent project POM file  <dependencies></dependencies> There are multiple. One is version control dependency, and the other is introduced dependency

Solution:

Add POM file

The dependencies are placed in the dependencies tab. The dependency of version control is placed under the dependency management tab In dependencies.

Note: it’s just to record some mistakes that are easy to ignore or imperceptible.

Idea error: (4, 28) Java: package com.alibaba.fastjson does not exist

The package has been imported through Maven in DEA, and the location of the package can also be located in idea, but error is always reported when compiling, and the package cannot be found.

Presumably, the reason is that the version of idea is incompatible with the build built by Maven

It is recommended to uninstall the idea and install it with another version of the idea. If you do not want to replace the idea, you can take the following measures.

The solution is as follows:

Hosting the build and run of idea under maven

When checked, recompilation can run normally