Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200

Viewed 2035

I tried to use jython in java. (environment: python 2, java 1.8,jython 2.72) Here is what I tried

    Properties props = new Properties();
    props.put("python.console.encoding", "UTF-8"); // Used to prevent: console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
    props.put("python.security.respectJavaAccessibility", "false"); //don't respect java accessibility, so that we can access protected members on subclasses
    props.put("python.import.site","false");
    Properties preprops = System.getProperties();
    PythonInterpreter.initialize(preprops, props, new String[]{});
    try(PythonInterpreter pythonInterpreter = new PythonInterpreter()) {
        pythonInterpreter.exec("import urllib2");
        pythonInterpreter.exec("ua_headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36'}");
        pythonInterpreter.exec("request = urllib2.Request('https://news.google.com/rss/search?q=vehicle',headers=ua_headers)");
        pythonInterpreter.exec("response = urllib2.urlopen(request)"); //program stuck here, see errors below
        pythonInterpreter.exec("html = response.read()");
        pythonInterpreter.exec("print(html)");
    }

23:55:22.367 [MainThread] DEBUG org.python.netty.channel.DefaultChannelId - -Dio.netty.processId: 15064 (auto-detected) 23:55:22.368 [MainThread] DEBUG org.python.netty.util.NetUtil - -Djava.net.preferIPv4Stack: false 23:55:22.368 [MainThread] DEBUG org.python.netty.util.NetUtil - -Djava.net.preferIPv6Addresses: false 23:55:23.219 [MainThread] DEBUG org.python.netty.util.NetUtil - Loopback interface: lo (Software Loopback Interface 1, 127.0.0.1) 23:55:23.220 [MainThread] DEBUG org.python.netty.util.NetUtil - Failed to get SOMAXCONN from sysctl and file \proc\sys\net\core\somaxconn. Default: 200 23:55:24.119 [MainThread] DEBUG org.python.netty.channel.DefaultChannelId - -Dio.netty.machineId: 04:d3:b0:ff:fe:7c:35:21 (auto-detected) 23:55:24.167 [Jython-Netty-Client-0] DEBUG org.python.netty.util.Recycler - -Dio.netty.recycler.maxCapacityPerThread: 4096 23:55:24.167 [Jython-Netty-Client-0] DEBUG org.python.netty.util.Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: 2 23:55:24.167 [Jython-Netty-Client-0] DEBUG org.python.netty.util.Recycler - -Dio.netty.recycler.linkCapacity: 16 23:55:24.167 [Jython-Netty-Client-0] DEBUG org.python.netty.util.Recycler - -Dio.netty.recycler.ratio: 8 23:55:24.179 [Jython-Netty-Client-0] DEBUG org.python.netty.buffer.AbstractByteBuf - -Dorg.python.netty.buffer.checkAccessible: true 23:55:24.179 [Jython-Netty-Client-0] DEBUG org.python.netty.buffer.AbstractByteBuf - -Dorg.python.netty.buffer.checkBounds: true 23:55:24.180 [Jython-Netty-Client-0] DEBUG org.python.netty.util.ResourceLeakDetectorFactory - Loaded default ResourceLeakDetector: org.python.netty.util.ResourceLeakDetector@632c62a1 23:55:25.248 [MainThread] DEBUG org.python.netty.handler.ssl.JdkSslContext - Default protocols (JDK): [TLSv1.2, TLSv1.1, TLSv1] 23:55:25.248 [MainThread] DEBUG org.python.netty.handler.ssl.JdkSslContext - Default cipher suites (JDK): [TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA]

Could someone help me, really appreciate it!

0 Answers
Related