users@glassfish.java.net

Need help with AccessController.doPrivileged

From: <glassfish_at_javadesktop.org>
Date: Fri, 08 Jun 2007 11:16:47 PDT

I'm trying to call an EJB from my web module in my enterprise application.

The call is coming from a "service" thread which I start via listener.

Below is the specific code I'm using to try and execute the call, this results in:
AccessLocalException: Client not authorized for this invocation.

[code]

        AccessController.doPrivileged(new PrivilegedAction() {
            public Object run() {
                try {
                    
                    ejb = (IReportingEJB) new InitialContext().lookup("java:comp/env/ejb/ReportingEJB");
                } catch (NamingException ex) {
                    ex.printStackTrace();
                }
        
                log.finer("Creating report: " + categoryName + " -> " + reportName);

                // Create the report
                try {

                    // Get the printable report
                    JasperPrint print = ejb.processReport(categoryName, reportName);

                } catch (MessagingException e) {
                    throw new Error(e);
                } catch (JRException e) {
                    throw(new Error(e));
                }
                return null;
            }
        });
[/code]
[Message sent by forum member 'jeffreyrodriguez' (jeffreyrodriguez)]

http://forums.java.net/jive/thread.jspa?messageID=221268