2010-04-25 20 views
11

sto usando Google App Engine per elaborare i messaggi Paypal IPN, quando il mio servlet inizia io uso le seguenti righe per avviare un altro processo per elaborare i massaggi:Google App Engine modifyThreadGroup problema

public class PayPal_Monitor_Servlet extends HttpServlet 
{ 
    PayPal_Message_To_License_File_Worker PayPal_message_to_license_file_worker; 

    public void init(ServletConfig config) throws ServletException    // Initializes the servlet. 
    { 
    super.init(config); 
    PayPal_message_to_license_file_worker=new PayPal_Message_To_License_File_Worker(); 
    } 

    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException 
    { 
    } 

... 
} 

public class PayPal_Message_To_License_File_Worker implements Runnable 
{ 
    static Thread PayPal_Message_To_License_File_Thread; 
... 

    PayPal_Message_To_License_File_Worker() 
    { 
    start(); 
    } 

    void start() 
    { 
    if (PayPal_Message_To_License_File_Thread==null) 
    { 
     PayPal_Message_To_License_File_Thread=new Thread(this); 
     PayPal_Message_To_License_File_Thread.setPriority(Thread.MIN_PRIORITY); 
     PayPal_Message_To_License_File_Thread.start(); 
    } 
... 
    } 

Ma "PayPal_Message_To_License_File_Thread = new Discussione (this);" sta causando il seguente errore:

javax.servlet.ServletContext log: unavailable 
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup) 
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:355) 
    at java.security.AccessController.checkPermission(AccessController.java:567) 

Perché, come risolvere il problema?

Frank

risposta

14

Non è possibile utilizzare Thread in GAE. Ecco un elenco di things you cannot do in GAE:

Se si desidera eseguire un'operazione in modo asincrono, esaminare TaskQueues.

+3

Aggiornamento di fine 2012: è possibile utilizzare i thread su App Engine, ma con alcune limitazioni: https://developers.google.com/appengine/docs/java/runtime#The_Sandbox –