yahaosoft / apjp

Automatically exported from code.google.com/p/apjp
0 stars 0 forks source link

Exceptions after using for a time #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

I can't tell how it happens, but I can tell that it throws exceptions seriously 
when I use it for a time.
For example, when I using google map through  APJP, it works very well at the 
begining. However, after I use it for a time, some pics can't be fetched, which 
made some parts of the map can't be displayed. Then when I open the APJP 
console, I found that it throws exceptions seriously. Mostly I see is like this:

APJP.HTTP11.HTTPSRequestException: HTTPS_REQUEST/OPEN
        at APJP.HTTP11.HTTPSRequest.open(Unknown Source)
        at APJP.HTTPS.HTTPSServerWorker.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:69)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:182)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:388)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:483)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:213)
        at sun.net.www.http.HttpClient.New(HttpClient.java:300)
        at sun.net.www.http.HttpClient.New(HttpClient.java:316)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:992)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:971)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:846)
        ... 3 more

I can't tell which remote I am using, because I set it up on heroku, DotCloud 
and Jelastic. But I can tell that I've tried to only set it up on heroku. It 
has the same problem.

I wonder if it may be related to the frequency.

So is it possible to solve this problem?

Original issue reported on code.google.com by lsyc...@gmail.com on 15 Feb 2012 at 8:52

GoogleCodeExporter commented 9 years ago
The problem: java.net.ConnectException: Connection timed out: connect

What does that mean?
APJP_LOCAL tries to make a connection with APJP_REMOTE* but APJP_REMOTE* has 
too many connections. After X time APJP_LOCAL has a connection timeout.

Why?
Google Maps makes a lot of connections to download images. Google Maps 
downloads those images from multiple servers (load balancing).
The free HEROKU/DOTCLOUD/JELASTIC accounts have limited resources (they can 
only handle 1-2 connections at the time).

Solution:
The free APPENGINE account can handle more connections (but has other 
restrictions), so configure APJP_LOCAL with 10 APJP_REMOTE_APPENGINE 
(preferable) or a combination of APJP_REMOTE_APPENGINE with APJP_REMOTE*.

By Jeroen

Original comment by goknmuse on 15 Feb 2012 at 12:37

GoogleCodeExporter commented 9 years ago
问题:java.net.ConnectException: Connection timed out: connect

这是什么意思?

答:APJP_LOCAL 
尝试连接APJP_REMOTE*,但是APJP_REMOTE*(APJP_REMOTE_HEROKU,APJP_REMOTE
_DOTCLOUD...)有过多的连接。一段时间后,APJP_LOCAL有一个连接�
��时。

为什么?

答:Google Maps需要许多的连接下载图片。Google 
Maps从多台服务器上下载图片(负载平衡)。
免费的HEROKU/DOTCLOUD/JELASTIC帐号,只有有限的配额。(他们只��
�一次处理1-2个连接)

解决方法:

免费的APPENGINE的帐号可以处理更多的连接(但是有其他的限��
�。例如:最大只能上传1MB的文件),因此给APJP_LOCAL配置10个APJ
P_REMOTE_APPENGINE(可行)或APJP_REMOTE_APPENGINE和APJP_REMOTE*组合。

Original comment by goknmuse on 15 Feb 2012 at 12:56

GoogleCodeExporter commented 9 years ago
OK, I will have a try, thanks for your reply. One more thing, it seems to work 
better when I run APJP_UI than I just simply run APJP.bat. Is there any tricks?

Original comment by lsyc...@gmail.com on 15 Feb 2012 at 4:22

GoogleCodeExporter commented 9 years ago
No problem :)

APJP_UI has a different logger level than APJP:
APJP_LOGGER_LEVEL=2
APJP_LOCAL_PROXY_SERVER_LOGGER_LEVEL=0
APJP_LOCAL_HTTP_PROXY_SERVER_LOGGER_LEVEL=0
APJP_LOCAL_HTTP_SERVER_LOGGER_LEVEL=0
APJP_LOCAL_HTTPS_PROXY_SERVER_LOGGER_LEVEL=0
APJP_LOCAL_HTTPS_SERVER_LOGGER_LEVEL=0

Original comment by jeroen.v...@gmail.com on 15 Feb 2012 at 7:28