Tag Archives: Java backend

[Solved] Postman Error: Error:‌ NETERR:‌ getaddrinfo ENOTFOUND localhost

1. Error report description

I created a new Monitor using postman here, but an error was reported when running

Since the mailbox is used when creating a new one, the mailbox also receives an error message

The key points are: error: neterr: getaddrinfo enotfound localhost

The reason may be that the host file localhost is not bound to 127.0.0.1

2. Solution

Under Windows, you can see the host file through the C:\Windows\System32\drivers\etc directory, copy it to the desktop, edit it with Notepad, write 127.0.0.1 localhost, and then overwrite the previous host file.

Replace the original file with the modified hosts

At this time, close the postman and try again, but it still doesn’t work

Let’s go to the next step and click File–>Settings

Turn off SSL certificate verification

Select postman — settings — proxy — proxy server to enter the IP and port you need to debug (the third figure) is also a successful step!!!


be careful!!!

Restart postman after setting

How to Solve the Primary Key of mybatisPlus Inserted Data is too Large Issue

Solve the problem that the primary key of mybatisplus inserted data is suddenly large

1. Enter the corresponding database in the administrator window, and then enter the following instructions:

alter table sys_user AUTO_INCREMENT=30;

​sys_user is the name of the data table to be modified, and 30 is to modify the self increment starting value to 30

In this way, the primary key value of the data table will return to normal

2. In the entity class of the project, add a @Tableid annotation to the primary key of the class

package baocms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "sys_user")
public class User {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    private String username;
    private String password;
    private String nickname;
    private String email;
    private String phone;
    private String address;
}

maven.TestGenerateMojo.execute(TestGenerateMojo.java:65) [How to Solve]

When packing the module, the following error occurs:

Error:(80,77) java:, org.springframework.aot.maven.TestGenerateMojo.execute(TestGenerateMojo.java:65), org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137), org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210), org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156), org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148), org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117), org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81), org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56), org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128), org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305), org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192), org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105), org.apache.maven.cli.MavenCli.execute(MavenCli.java:957), org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289), org.apache.maven.cli.MavenCli.main(MavenCli.java:193), sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method), sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62), sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43), java.lang.reflect.Method.invoke(Method.java:498), org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282), org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225), org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406), org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347), org.codehaus.classworlds.Launcher.main(Launcher.java:47)]

Later corrected the pom.xml, for build, there will be a plug-in comments up on the good:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.1.6.RELEASE</version>
                <configuration>
                    <classifier>${repackage.classifier}</classifier>
                </configuration>
            </plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>

            <!--<plugin>
                <groupId>org.springframework.experimental</groupId>
                <artifactId>spring-aot-maven-plugin</artifactId>
                <version>${spring-native.version}</version>
                <executions>
                    <execution>
                        <id>test-generate</id>
                        <goals>
                            <goal>test-generate</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skip>true</skip>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

At present, it is judged that the plug-in I commented out reported an error.