Problem with multiple threads on app engine

96 views
Skip to first unread message

vanosten

unread,
May 17, 2009, 2:51:35 AM5/17/09
to OpenID4Java
Hi

No matter whether I use the latest build 0.9.4.339 or the latest code
from svn (revision 582) I get an exception on Google's App Engine for
Java. I think it is related to the fact that multiple threads are not
allowed.
=> Has anybody had the same problem?
=> Does anybody know where to change the configuration to get the
simple connection manager instead of
MultiThreadedHttpConnectionManager?

java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:323)
at java.security.AccessController.checkPermission
(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:76)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkAccess(DevAppServerFactory.java:98)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ReferenceQueueThread.<init>(MultiThreadedHttpConnectionManager.java:
1039)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.storeReferenceToConnection
(MultiThreadedHttpConnectionManager.java:164)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.access
$900(MultiThreadedHttpConnectionManager.java:64)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
$ConnectionPool.createConnection
(MultiThreadedHttpConnectionManager.java:750)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection
(MultiThreadedHttpConnectionManager.java:469)
at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout
(MultiThreadedHttpConnectionManager.java:394)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod
(HttpMethodDirector.java:152)
at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod
(HttpClient.java:324)
at org.openid4java.discovery.yadis.YadisResolver.headXrdsUrl
(YadisResolver.java:546)
at org.openid4java.discovery.yadis.YadisResolver.discover
(YadisResolver.java:249)
at org.openid4java.discovery.yadis.YadisResolver.discover
(YadisResolver.java:216)
at org.openid4java.discovery.Discovery.discover(Discovery.java:
201)
at org.openid4java.discovery.Discovery.discover(Discovery.java:
149)
at org.openid4java.consumer.ConsumerManager.discover
(ConsumerManager.java:468)
at net.vanosten.amemoria.webapp.sustegn.OpenIDHelper.login
(OpenIDHelper.java:142)

===================
public final static String login(String openIDURL, String
responseURL) throws AmemoriaOpenIDException {
ConsumerManager manager = getConsumerManager();
//check the url and transform it
String canonicalOpenIDURL = OpenIDHelper.makeCanonicalOpenIDURL
(openIDURL);
String authURL = null;

//interact with OpenIDProvider
// perform discovery on the user-supplied identifier
List<DiscoveryInformation> discoveries = null;
try {
discoveries = manager.discover(canonicalOpenIDURL);
...

Johnny Bufu

unread,
May 27, 2009, 2:55:39 AM5/27/09
to openi...@googlegroups.com

On 16/05/09 11:51 PM, vanosten wrote:
> => Does anybody know where to change the configuration to get the
> simple connection manager instead of
> MultiThreadedHttpConnectionManager?

HttpClientFactory.setMultiThreadedHttpClient(boolean multiThreaded)
(since rev590).


Johnny

Ben

unread,
Jul 6, 2009, 10:49:13 PM7/6/09
to OpenID4Java
Setting the boolean flag to create a SimpleHttpConnectionManager
implementation in HttpClientFactory does not completely make it work
in GAE. Unfortunately, the class TimeoutController (part of the
HTTPClient library) will create a new Thread in line 79 causing the
same issue. Is there any way to work around that?

Thanks for your help,

Ben

Damián

unread,
Jul 23, 2009, 10:44:37 PM7/23/09
to OpenID4Java
Have anyone solved this issue???
thanks

康新勇

unread,
Oct 6, 2009, 11:31:54 PM10/6/09
to openi...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages