Bugs item #835112, was opened at 2003-11-03 08:09
Message generated for change (Comment added) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=835112&group_id=22866

Category: None
Group: v3.2
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Christer Grimsaeth (chrigri)
Assigned to: Scott M Stark (starksm)
Summary: Call to JMX leads to failure in EJB call.

Initial Comment:
Hi, 

When I do a standard JMX call from an servlet the next 
call to an EJB fails.
This happens on jboss-3.2.2 on on sun jdk 1.3.1_08-b03.

As an exapmle I have added the following code to the 
jaas_howto code (the one that is updated for 3.2.x ):

In the file "EJBServlet":


   protected void processRequest(HttpServletRequest 
request, HttpServletResponse response)
      throws ServletException, IOException
   {
                try {
                        System.out.println("Trying 
a to lookup the Adaptor...");
                        InitialContext ic = new 
InitialContext();
                        
                        RMIAdaptor adaptor = 
(RMIAdaptor) ic.lookup("jmx/rmi/RMIAdaptor");
                        System.out.println("Using 
class: [" + adaptor +"] as the RMIAdaptor 
implementation.");
                        
                        ObjectName name = new 
ObjectName("jboss.web:service=WebServer");
                        System.out.println
("ObjectName: " + name);
                                        
        Object attr = adaptor.getAttribute
(name, "Name");
                        System.out.println
("QWERTY: " + attr);
                } catch (Exception e) {
                        System.out.println
("Exception: " + e.getMessage());
                }
        
        
        
        
      String method = request.getParameter("method");

      if (method == null || method.equals("echo"))
         callEcho(request, response);
      else if (method.equals("noop"))
         callNoop(request, response);
      else if (method.equals("restricted"))
         callRestricted(request, response);
   }

This code executes ok, but the following call to an EBJ 
fails with an: 
javax.security.auth.login.FailedLoginException.
Please see the attached file for a full stacktrace.

The code works correctly if I remove the the call: 
adaptor.getAttribute()

Can anyone please help with this?
Is this a bug, or am I doing something fundamentally 
wrong?

Thanks!

--
Christer


----------------------------------------------------------------------

>Comment By: Scott M Stark (starksm)
Date: 2003-11-09 10:30

Message:
Logged In: YES 
user_id=175228

The RMIAdaptor is only designed for use by clients external
to the server VM. It clears the thread security association
so that the call security context does not leak back to the
calling thread pool and this results in the secured EJB call
failing.

You need to use the MBeanServer directly.
MBeanServer server = (MBeanServer)
   MBeanServerFactory.findMBeanServer(null).iterator().next();


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=835112&group_id=22866


-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to