JBoss Community

How to access MC pojo beans from a RAP app

created by Csaba Szucs in JBoss Microcontainer - View the full discussion

Hello Guys,

 

We have a J2EE web app with a JSP/Servlet based UI.

We would like to reimplement the UI-layer in Eclipse/RAP technology.

 

So from now on the RAP UI layeer will invoke BU classes such as:

o EJB classes (session beans, entity beans, message driven beans)

o JBoss MicroController POJO beans

 

 

Unfortunately I have trouble to access an MC bean from RAP.

 

 

To call an MC bean operation from a servlet init() method was easy like:

 

public void init(ServletConfig config) throws ServletException {

  super.init(config);

  try {

    KernelControllerVDFConnector connector = new KernelControllerVDFConnector(config.getServletContext());

    if (connector.isValid() == false) throw new ServletException("Illegal VDF component, no MC Kernel present.");

    KernelController controller = connector.getUtility();

    ControllerContext ctx = controller.getInstalledContext("AJBossMCBean");

    AJBossMCBeanInterface dummy = (AJBossMCBeanInterface) ctx.getTarget();           

    dummy.someOperation();

    // ...

  } catch(Exception e ) {

    // ...

  }

}        

 

Within RAP, I can also provide a ServletContext object, but the KernelControllerCDFConnector.valid() always return a false value.

 

How can I solve this issue?

 

Many thanks in advance!

Csaba

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer at Community