Topic
4 replies Latest Post - ‏2011-11-08T21:25:05Z by Kevan
FrederikDeBacker
FrederikDeBacker
12 Posts
ACCEPTED ANSWER

Pinned topic Call OSGi service from EJB

‏2011-11-08T10:10:57Z |
Hi all,

I am faced with the following problem: I have an OSGi service that exports a service and makes this service available in the OSGi registry. Now I would like to call this service from within an EJB method.

So in my EJB I do the following:

BankService bankService = (BankService) ctx.lookup("osgi:service/dexia.osgipoc.sedm3.service.BankService");

The lookup works ok, but the ca
Updated on 2011-11-08T21:25:05Z at 2011-11-08T21:25:05Z by Kevan
  • FrederikDeBacker
    FrederikDeBacker
    12 Posts
    ACCEPTED ANSWER

    Continued: Call OSGi service from EJB

    ‏2011-11-08T10:14:35Z  in response to FrederikDeBacker
    ... but the cast to BankService fails because the class is not found.

    This class is exposed in my OSGi bundle but apparently the EJB cannot see it because the EJB is not OSGi aware. Is there a way to do this and define some sort of 'hybrid' application in Websphere (Glassfish and JBoss seem to have some support for this).

    thx and kr,

    Frederik.
    • Kevan
      Kevan
      121 Posts
      ACCEPTED ANSWER

      Re: Continued: Call OSGi service from EJB

      ‏2011-11-08T12:08:41Z  in response to FrederikDeBacker
      What does your deployment plan (e.g. geronimo-application.xml) look like? Do you have a deployment plan, at all?

      See http://publib.boulder.ibm.com/wasce/V3.0.0/en/ear.html

      Sounds like you could use an <import-package> for dexia.osgipoc.sedm3.service.

      --kevan
      • FrederikDeBacker
        FrederikDeBacker
        12 Posts
        ACCEPTED ANSWER

        Re: Continued: Call OSGi service from EJB

        ‏2011-11-08T14:54:40Z  in response to Kevan
        Hello,

        Thanks for the assistance. I did not have a deployment plan. I added one based on your response and it seems to work now.

        kr,

        Frederik.
        • Kevan
          Kevan
          121 Posts
          ACCEPTED ANSWER

          Re: Continued: Call OSGi service from EJB

          ‏2011-11-08T21:25:05Z  in response to FrederikDeBacker
          Great. Thanks for the update.

          --kevan