Tag Archives: java

Nginx 502 Error: Failed to load resource: the server responded with a status of 502 (Bad Gateway)

problem found



was meant for cookie with too many headers, required header data was too big

solve the problem

nginx adds configuration

    # 502 bad gateway 错误解决配置 start
    proxy_buffer_size 64k;
    proxy_buffers 32 32k;
    proxy_busy_buffers_size 128k;
    # 502 bad gateway 错误解决配置 end
    

note the location of the configuration

individual open source project (general back office management system) — > Can look at https://gitee.com/wslxm/spring-boot-plus2, like
in this paper, to this end, if you feel useful, move the small hand thumb up or focus on bai, do not regularly will continue to update more… Thank you for watching!

How to solve the problem of requirements check failed for JDK 8 when Cordova 9.0 is built

the economy of the motherland is recovering, and people of all ethnic groups are actively engaged in the task of restoring production. As a codemaker, I have also been nervous for a long time. Recently, I have been busy with several projects, including an app, which needs to be quickly set up for preview and test, so I directly listed Cordova. However, I am surprised to step on it.

, there’s nothing wrong with building the project, it just came to me during the build:

Requirements check failed for JDK 8 ('1.8.*')! Detected version:11.0.7

Check your ANDROID_SDK_ROOT/JAVA_HOME/PATH environment variables.

indicates clearly that jdk11 does not match the required jdk8 for cordova. The reason is also clear, as the native environment was upgraded from JDK8 to JDK11 a while ago.

the problem now is that I don’t want to change java_home back to 8, because all the compiled versions of all the items on the machine have changed to jdk11, which would take me half a day to fix. (and a lot of history projects in Eclipse)

I use [email protected], which was released a year ago, but the latest cordova10 in NPM, which is still at nightly (compiled daily), is not even rc and is obviously not recommended in a production environment. In other words, Cordova9 is the latest stable edition, so I can’t expect to change the status quo by upgrading Cordova9.

also tried to set java.home in IDE (vscode), but it was useless. This setting is only valid for the Java plug-in of VSC, but it is incapable of cordova.

after many thoughts, if cordova cannot be surrendered, I will have to fall back to jdk8.

since cordova is based on nodejs, it occurs to me that all the hints should be in the clear text code. So a hard-hearted search keyword Requirements check failed for the whole project.

is actually retrieved:

in platforms/android cordova/lib/check_reqs js files in the module. Exports. The run method, related to the one and only one place!

and it says:

// Returns a promise.
module.exports.run = function () {
    return Q.all([this.check_java(), this.check_android()]).then(function (values) {
        console.log('Checking Java JDK and Android SDK versions');
        console.log('ANDROID_SDK_ROOT=' + process.env['ANDROID_SDK_ROOT'] + ' (recommended setting)');
        console.log('ANDROID_HOME=' + process.env['ANDROID_HOME'] + ' (DEPRECATED)');

        if (!String(values[0]).startsWith('1.8.')) {
            throw new CordovaError(
                'Requirements check failed for JDK 8 (\'1.8.*\')! Detected version: ' + values[0] + '\n' +
                'Check your ANDROID_SDK_ROOT/JAVA_HOME/PATH environment variables.'
            );
        }

        if (!values[1]) {
            throw new CordovaError('Requirements check failed for Android SDK! Android SDK was not detected.');
        }
    });
};

sees the 1.8 criterion, and the check_java method also makes it clear that the Java environment is being judged. So the “1.8.” directly changed to “11.”, and the compilation passed smoothly.

postscript:

first of all, I do not recommend arbitrary changes to the dependent framework source code, which will not only affect subsequent updates to the framework, but also cause unknown exceptions. But there is no way, this is only a temporary solution.

I don’t know if cordova9 has a key piece that relies only on jdk8, and I don’t know what effect jdk11 will have on cordova9, but I do think it’s clear that if you want to minimize the impact by changing one piece of code, the impact is really small.

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

error message:

Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING

environmental phenomena

chrome

chrome browser, the previous access to the interface is what, access to the error of this url, the interface is still what looks like, but does not respond to mouse and keyboard events!
press F12 to open the debug window. An error message appears:

IE compatible kernel

IE compatible kernel browser, after opening the interface is blank, press F12, open the debugging window, display the following content:

error cause:

online search, there are articles mentioned is response.close, response.end and so on caused, but I visited the JSP page, how can it be related to this!

based on this page on another problem occurred “HTTP Status 500 – /online.jsp (line: 495, column: 2) File [/foot.jsp] not found” opened the JSP page code analysis, found the problem:
actually USES JSP :include

<jsp:include flush="true" page="/head.jsp" ></jsp:include>

The

head.jsp file does not exist, which results in this problem!

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
PS: mice no girlfriend particularly depressed, finally a bat agreed to marry him, the mouse is very happy. Others laugh him to have no vision, mouse: you understand what, she somehow is a stewardess.

“[warning] failed to retrieve plugin descriptor for caused by Maven security agent settings org.apache.maven . plugins:… “

when creating a simple Maven project with the Maven command, the following tip is given:

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

“[WARNING] Failed to retrieve the plugin descriptor for org.. Apache maven. Plugins: maven – clean – plugin: 2.5: the plugin org. Apache. Maven. Plugins: maven – clean – plugin: 2.5 or one of its dependencies could not be Resolved: Failed to read an artifact descriptor for org.. Apache maven. Plugins: maven – clean – plugin: jar: 2.5 “

from the Internet to see some reasons for analysis, summarized as follows:

1) maven.apache.org

cannot be accessed from the network used

2) the proxy server is not configured or is incorrectly configured.

if your company requires you to use a secure authenticated proxy to access the Internet for security reasons, then you need to configure the HTTP proxy for Maven. Add the agent configuration to the configuration file %MAVEN_HOME%/conf/setting.xml:

<proxies>  
    <proxy>  
      <id>optional</id>  
      <active>true</active>  
      <protocol>http</protocol>  
      <username>proxyuser</username>  
      <password>proxypass</password>  
      <host>proxy.host.net</host>  
      <port>80</port>  
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>  
    </proxy>      
</proxies>

username: proxy server username

password: proxy server password

host: proxy server address

port: proxy server port

nonProxyHosts: host address

that is not accessed using the proxy server

ERROR: JDWP Unable to get JNI 1.2 environment

failed to get JNI 1.2 environment, JVM ->

ERROR: JDWP is Unable to get JNI 1.2 environment, JVM -> The GetEnv () return code = – 2

the JDWP exit error AGENT_ERROR_NO_JNI_ENV (183) : [… /… /…/SRC/share/back/util. C: 820]

to find the reason for the error. Found a problem with redirecting the output.

is the following is the original network data

install jdk1.6, ha ha ~ I also met this problem. This is something I found on the Internet before. I hope it will be helpful to you.

ERROR: JDWP incapable to get JNI 1.2 environment, JVM -> The GetEnv () return code = – 2

the JDWP exit error AGENT_ERROR_NO_JNI_ENV (183) : [… /… /…/SRC/share/back/util. C: 820]

this is going on?Now Java SE 6 has reached the stage of RC, huh?

after I looked up the Java Doc carefully, I found that there is such a paragraph: http://download.java.net/jdk6/docs/api/java/io/Console.html

“been a virtual machine from a console is dependent upon the physicist platform and also upon the manner in which the virtual machine is invoked. If the virtual machine is started from an interactive command line without redirecting the standard input and
output streams then its console will exist and will typically be connected to the keyboard and display from which the virtual machine was launched. If the virtual machine is started automatically, for example by a background job scheduler, Then it will typically

1, use the command line to run, compile can use the integrated development environment. This completes standard output. 2. Redirect stdout in the program to another device or mode (such as writing to a text file), which can also be “inconvenient” to complete the function. 3. At the end of main function, add system.exit(0);

note:

return and system.exit() what is the difference between:

1. Return is the upper level of the program, system. Exit () is the top level of the program

2

The solution to the problem is different from other solutions

java-jdk13 Error opening registry key ‘software\Javasoft\Java Runtime Environment’ problem solution differs from other solutions

to find other online solutions, found the first few pages of baidu solutions are the same. It’s disgusting. They tried all their ways to no avail, and then found a solution here.
C: \ ProgramData \ Oracle \ Java \ javapath. All Java files under this path are deleted.
later I thought maybe it was because I had installed java8 before and deleted it.
in addition, I recommend that you try other people’s solutions if they fail and try mine again.

JIRA startup failed, JIRA has been locked.

1. Failure phenomenon

JIRA Startup Failed
You cannot access JIRA at present. Look at the table below to identify the reasons

Description
The jira. Home directory ‘/data/ WWW /jira_home/jiradata’ is already locked. Please see The jira documentation for more information on locked jira.home directories.
[oracle@bogon bin]$ ./startup.sh
Detecting JVM PermGen support…
PermGen switch is supported. Setting to 256m
If you encounter issues starting up JIRA Standalone Edition, Both please see the Troubleshooting guide at http://confluence.atlassian.com/display/JIRA/Installation+Troubleshooting+Guide
Using CATALINA_BASE:/home/atlassian jira – enterprise – 4.0.2 – standalone
Using the CATALINA_HOME:/home/atlassian jira – enterprise – 4.0.2 – standalone
Using CATALINA_TMPDIR:/home/atlassian jira – enterprise – 4.0.2 – standalone/temp
Using JRE_HOME:/usr/Java/jdk1.6.0 _25
Using the CLASSPATH:/home/atlassian jira – enterprise – 4.0.2 – standalone/bin/bootstrap jar
touch: always touch a `/home/atlassian jira – enterprise – 4.0.2 – standalone/logs/catalina out ‘: Permission denied

‘/data/ WWW /jira_home’ has a.jira-home.lock file, delete and restart it. The
. Jira-home. lock file is designed to prevent multiple jira sites from running on one machine and having the same jira.home set up.

Jira-home.lock
[root@bogon ~]# find/-name ‘. Jira-home.lock ‘
/data/ WWW /jira_home/ jira.lock

2, close the jira command
/data/WWW/jira/bin/shutdown. Sh

[note] /data/ WWW is my installation path, modified to my installation directory

3, start the jira command
/data/WWW/jira/bin/startup. Sh

fault resolution.

from “ITPUB blog”, link: http://blog.itpub.net/751371/viewspace-706101/, if you want to reprint, please indicate the source, otherwise will be investigated for legal responsibility.

reproduced in: http://blog.itpub.net/751371/viewspace-706101/

Process of checking the error of connection reset by peer reported by reactor netty

article directory

  • 1. An error phenomenon
  • 2. Screening process
      • 2.1 Connection reset by peer reason
      • 2.2 the syscall: read (..) Failed: Connection reset by peer error
  • 3. Final cause

1. Error reporting

A service in

group switched from spring-webmvc framework to spring-webflux. After running online for some time, the following error log occasionally appeared. L:/10.0.168.212:8805 represents the server IP and port where the local service is located. R:/10.0.168.38:47362 represents the server IP and port where the requested service is located. The common reason for this situation is that the server is busy, while checking the monitoring of the service invocation, it is found that the normal invocation amount is not enough to constitute the condition of service busy

2020-05-110 10:35:38.462 ERROR reactor-http-epoll-1 [] reactor.netty.tcp.TcpServer.error(300) - [id: 0x230261ae, L:/10.0.168.212:8805 - R:/10.0.168.38:47362] onUncaughtException(SimpleConnection{channel=[id: 0x230261ae, L:/10.0.168.212:8805 - R:/10.0.168.38:47362]})
io.netty.channel.unix.Errors$NativeIoException: syscall:read(..) failed: Connection reset by peer
	at io.netty.channel.unix.FileDescriptor.readAddress(..)(Unknown Source)

2. Screening

2.1 Connection reset by peer

The

error is rarely encountered. The first thing that comes to mind is, of course, searching for the wrong keyword on the Internet and finding the following. It is clear that Connection reset by peer is caused by the server transmitting data to the opposite Socket Connection closed, but the reason for closing the Connection to the opposite end is unknown

abnormal reason

java.net.BindException:Address already in use: JVM_Bind this exception occurs when the server side is operating new ServerSocket(port), because the port has been started and is listening. At this point with the netstat - an command, you can see the local has been in the use of state of the port, you just need to find a not occupied ports can solve the problem

java.net.ConnectException: Connection refused: Connect

the exception occurs on the client for the new Socket (IP, port) operation, the reason is unable to find the IP address of the machine (that is, from the current machine does not exist to the designated IP routing), or is the IP, but can not find the specified port monitor

java.net.SocketException: The Socket is closed

the exception can occur in both the client and the server, the reason is that their own initiative after closed the connection (call the Socket close method ) read and write operations on the network connection

java.net.SocketException: (Connection reset or Connect reset by peer)

the exception might occur in both client and server, for two reasons, first is if the end of the Socket is closed (or take the initiative to shut down or because of the closing of the anomalies caused by the exit, "mark> the default Connection Socket 60 seconds, 60 seconds without a heartbeat interactions, namely, speaking, reading and writing data, automatically close the Connection ), the other end is still to send data, The first packet sent throws this exception (Connect reset by peer). The other side exits without closing the Connection, and the other side throws an exception if it reads from the Connection again (Connection reset). simple say is to read and write operations after the connection is broken cause of

java.net.SocketException: Broken pipe this exception may occur on both the client and server. In the first case of the fourth exception (Connect reset by peer), if the data is written again, the exception

will be thrown

2.2 the syscall: read (...). Failed: Connection reset by peer error

continues searching for other keywords and then goes around and finds the issue of reactor-netty on github. github posted by other developers is almost exactly the same as what I encountered. After careful reading, I found that other developers encountered this problem mainly in the following two ways:

  • disabled long connections
  • modify the load balancing strategy to the minimum number of connections strategy

From the perspective of comment, this is mainly involved in the connection pooling mechanism of reactor-netty. We know that netty is a framework based on nio (see the Java IO model and examples), which USES a connection pool to ensure concurrent throughput when handling connection requests. By customizing the ClientHttpConnector with a long connection attribute of false, the connection pool thread is guaranteed not to be held for long periods of time, which seems to be an effective solution for this error

in scenarios used by other developers

3. Final cause

check the comment on github, I always feel that the scene of other developers is not exactly the same as ours, but I have no idea for the moment. The leader shouted in the internal group. In the evening, a colleague finally found the clue from the log.

>

>

>

>

>

>

>

  • connection pool allocates threads reactor-http-epoll-1 to process A request A. During the processing of reactor-http-epoll-1, due to the slow SQL blocking all the time, the same interface was accessed with high frequency during this period, and other threads in the connection pool were also allocated to process the same type of request. Then it also blocks because of slow SQL. in the connection pool threads are blocked, a new request to come over, connection pool has no thread can carries on the processing, therefore has been hold request end, closed until after the timeout active Socket . After that, the server Connection pool thread finally finished processing the slow SQL request, and then processed the backlog of requests. When it finished, it sent the data to the request side, only to find that the Connection had been closed, so the error Connection reset by peer was reported. As a rule of thumb, if the service reports a Connection reset by peer error, first check to see if there is a particularly slow action in the service blocking the thread

analysis of slow SQL found that the reason why the statement took so Long to execute was that the MySQL database field of data type VARCAHR accepted the condition of Long data type, resulting in implicit type conversion, unable to use the index, and thus triggering the full table scan.

How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

2019 unicorn enterprise to recruit Python engineer standard > > >

record import Google android case error solution is as follows: the android. Builder. Internal. The aapt. V2. Aapt2Exception: android resource linking failed

is as follows:

Android resource linking failed
Output:  /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:221: error: resource android:attr/fontStyle not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:222: error: resource android:attr/font not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:223: error: resource android:attr/fontWeight not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:224: error: resource android:attr/fontVariationSettings not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:225: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: /Users/chmy/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-osx.jar/cc4633529fe8cee26cd686b6b28203cf/aapt2-3.2.0-4818971-osx/aapt2 link -I\
        /Users/chmy/Library/Android/sdk/platforms/android-24/android.jar\
        --manifest\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
        -o\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
        -R\
        @/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
        --custom-package\
        com.example.android.messagingservice\
        -0\
        apk\
        --output-text-symbols\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/symbols/debug/R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-osx Daemon #0

there is a lot of talk on the web about adding a configuration to gradle.properties, but the addition is not solved.

solution: the compiled version is not configured correctly. Original version number:

android {
    //
    compileSdkVersion 24

    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 24

    }
...

after modification:

android {
    // 
    compileSdkVersion 28

    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28

    }

compiles again, and the problem is resolved. This is the solution I came across, others are not met for the time being.

reproduced in: https://my.oschina.net/who7708/blog/2236811

When using ionic to build Android APK, Cordova error is reported: requirements check failed for JDK 1.8 or greater

after the local environment variables of JDK and jre are configured locally, Java, javac and so on can output normally in the command line, but when using ionic cordova build android to package ionic, it will prompt CordovaError: Requirements check failed for JDK 1.8 or greater.

I checked that the local Java version is 10+. Later, I found on the Internet that cordova only supports jdk8, so I need to lower the JDK version to adapt.

Reference links:

https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater

reproduced in: https://www.cnblogs.com/viola-sh/p/9355649.html