Tag Archives: postman

[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

[Solved] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

INSERT INTO report(NAME,keyword,refile,content,DATE,STATUS) VALUES ('%s','%s','%s','%s','%s',0)%("name", "key", "refile", "content",str(datetime.now()))

report errors

ERROR CODE: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key,refile,content,date,status) VALUES ('%s','%s','%s','%s','%s',0)%("name", "ke' at line 1

The keyword of MySQL is used. After modification

    sql="INSERT INTO report(`name`,`keyword`,`refile`,`content`,`date`,`status`) VALUES ('%s','%s','%s','%s','%s',0)"%(name,key, refile, content,str(datetime.now()))

postman CSRF verification failed [How to Solve]

As shown in the picture, the CSRF authentication failed.

I grabbed the package from the browser, the browser runs normally, but postman will run inside the error, see the error is the lack of Referer header, after analysis and try, found that in fact the description of the interface call command header is missing a header called Referer, open F12 in the browser can be found in Request Headers, copy it to postman

[Solved] fastjson Error: write javaBean error, fastjson version 1.2.76, class io.undertow.servlet.xx

Error message:

com. alibaba. fastjson. JSONException:

write javaBean error, fastjson version 1.2.76, class io. undertow. servlet. spec.HttpServletResponseImpl, fieldName : 0,

write javaBean error, fastjson version 1.2.76, class io. undertow. server. HttpServerExchange, fieldName : exchange,

UT010034: Stream not in async mode

code:

    @ApiOperation(value = "TEST",notes = "")
    @PostMapping("/abccc")
    @ResponseBody
    public void test( HttpServletResponse response) {
        //service
    }

Solution:

Remove this swagger comment.

@ApiOperation(value = "TEST",notes = "")

Notes of swagger, @ apioperation (value = “interface description”, httpmethod = “interface request method”, response = “interface return parameter type”, notes = “interface release description”);

That’s right!!!!! There are no bugs!!!!!

Complete error reporting information:

2021-09-01 11:14:36.911 [XNIO-1 task-1] ERROR x.x.x.framework.exception.GlobalExceptionHandler - url=http://xxx.x.x.x:xxxxx/shell/abccc,errormsg=com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.76, class io.undertow.servlet.spec.HttpServletResponseImpl, fieldName : 0, write javaBean error, fastjson version 1.2.76, class io.undertow.server.HttpServerExchange, fieldName : exchange, UT010034: Stream not in async mode
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:544)
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:154)
	at com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:360)
	at com.alibaba.fastjson.serializer.JSONSerializer.writeWithFieldName(JSONSerializer.java:338)
	at com.alibaba.fastjson.serializer.ObjectArrayCodec.write(ObjectArrayCodec.java:118)
	at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:312)
	at com.alibaba.fastjson.JSON.toJSONString(JSON.java:793)
	at com.alibaba.fastjson.JSON.toJSONString(JSON.java:731)
	at com.alibaba.fastjson.JSON.toJSONString(JSON.java:688)
	at com.xxxxx.xxxxx.xxxxx.controller.xxxxxController.test(ShellInfoController.java:40)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
	at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.76, class io.undertow.server.HttpServerExchange, fieldName : exchange, UT010034: Stream not in async mode
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:544)
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:154)
	at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:475)
	... 81 more
Caused by: java.lang.IllegalStateException: UT010034: Stream not in async mode
	at io.undertow.servlet.spec.ServletOutputStreamImpl.isReady(ServletOutputStreamImpl.java:757)
	at com.alibaba.fastjson.serializer.ASMSerializer_11_ServletOutputStreamImpl.write(Unknown Source)
	at com.alibaba.fastjson.serializer.FieldSerializer.writeValue(FieldSerializer.java:318)
	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:475)
	... 84 more

org/sqlite/native/Mac/aarch64 Error [How to Solve]

Problem Description:
When building a project with m1 chip, if you use room, you will get the following error because the sqlite jar package is not compatible with arm.

Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
    at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:333)
    at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:64)
    at androidx.room.verifier.DatabaseVerifier.<clinit>(DatabaseVerifier.kt:68)
    ... 50 more

Solution:
To update the room version, you don’t need to add org.xerial:sqlite-jdbc:3.34.0 as the web says, just update the room directly as shown below.

    def room_version = "2.4.0-beta01"  
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
    implementation "androidx.room:room-rxjava2:$room_version"

Using postman Test Django Interface error: RuntimeError:You called this URL via POST,but the URL doesn‘t end in a slash

1. Access interface

Using the postman provider

2. Error reporting:

RuntimeError:You called this URL via POST,but the URL doesn’t end in a slash and you have APPEND_ SLASH set. Django can’t redirect to the slash URL while maintaining POST data.

3. Solution:

In fact, two methods have been suggested in the error report

Method 1: add a at the end of the URL/

http:10.192.171.128:8000/ops/rbac/group/distribute

Method 2: set append in settings_ SLASH=False

JMeter running error response code: non HTTP response code: java.lang.illegalargumentexception find and solve

JMeter operation error

Response code: non HTTP response code: java.lang.illegalargumentexception
response message: non HTTP response message: bound must be greater than origin


the error is due to the problem of parameter transmission. First, we need to check whether the parameter is correct


after checking, we find that the name is wrong, The case is not distinguished, so it can’t be found all the time. It’s successful to run after modification.

How to install postman tool in Ubuntu 16.04

Ubuntu16.04 postman installation: basic steps:

1) : official website to download software package: https://www.getpostman.com/apps

2) : unzip the installation:

sudo tar -xzf Postman-linux-x64-6.0.10.tar.gz

3): Enter the unzipped PostMan folder to open the terminal and start PostMan

./Postman/Postman

4): Create startup icon for quick startup
Create a soft link to create Postman from the extracted Postman file in /usr/bin/

sudo ln -s  /home/c/Downloads/Postman/Postman   /usr/bin/