Topic
8 replies Latest Post - ‏2012-05-22T14:35:09Z by Tom.Seelbach
Miljenko
Miljenko
7 Posts
ACCEPTED ANSWER

Pinned topic [urgent] problem with deployment of SCA application with OSGi composite

‏2012-05-17T21:24:21Z |
Hi all,

since we're using WebSphere Application Server for running our applications, for our new project we have chosen OSGi, to gain modularity and versioning.
So far, we have some issues but we've managed to find a workaround for it.
Our application needs to connect with WebSphereMQ server in both directions (send/receive), and therefore we have to wrap up our application into a SCA component to enable OSGi service export and import.

And that's where the problem started to pop up. We have some legacy JAR's that cannot be converted easily into a OSGi-aware JAR's, so we are using these JAR's be placing it into a OSGi bundle and referencing it in MANIFEST.MF (Bundle-ClassPath).
When an OSGi application that contains these bundles is added as component into a SCA, SCA deploy does not work any more, SCA is in partial start state deployed on server and needs to be undeployed manually through admin console.

I'm attaching a sample, it contains an OSGi application "test.osgi.app" with OSGi bundle "test.osgi.biz" that uses my small test JAR "UpperCase.jar" (that JAR is in bundle classpath).
When I deploy "test.osgi.app", everything works OK. But when I put this application into a SCA application as composite (SCA is "test.osgi.sca"), that SCA component cannot be deployed.
If I remove UpperCase.jar from Bundle-ClassPath of "test.osgi.biz", SCA deploy works OK.

Moreover, when I deploy "test.osgi.sca", I cannot undeploy it through RAD but only through admin console (looks like a nasty bug in RAD).

SCA component is developed by the redbook "Getting Started with the Feature Pack for OSGi Applications and JPA 2.0" (component implementation is OSGi application and binding is SCA, added composite).

Please help, because our ongoing project is mainly based on OSGi and we don't want to replace OSGi with something else.
I'm attaching a small example that can be used to reproduce this issue.
Development environment is RAD 8.0.4 and WAS 8.0.0.3.

Thanks,
Miljenko
Updated on 2012-05-22T14:35:09Z at 2012-05-22T14:35:09Z by Tom.Seelbach
  • HasanMuhammad
    HasanMuhammad
    8 Posts
    ACCEPTED ANSWER

    Re: [urgent] problem with deployment of SCA application with OSGi composite

    ‏2012-05-18T14:26:23Z  in response to Miljenko
    Can you please export your OSGI app (.eba) and SCA app 9.jar) and attach it here? I would like to see how exactly your osgi app looks after it is exported as an eba from your RAD project.

    Hasan
    • Miljenko
      Miljenko
      7 Posts
      ACCEPTED ANSWER

      Re: [urgent] problem with deployment of SCA application with OSGi composite

      ‏2012-05-18T15:54:21Z  in response to HasanMuhammad
      Hi Hasan,

      please see attached ZIP.

      Thanks,
      Miljenko
      • Tom.Seelbach
        Tom.Seelbach
        11 Posts
        ACCEPTED ANSWER

        Re: [urgent] problem with deployment of SCA application with OSGi composite

        ‏2012-05-18T21:17:59Z  in response to Miljenko
        Miljenko,
        I tried to deploy the app, and i'm seeing an exception.

        If you look in logs/ffdc do you see anything like this:

        5/18/12 17:14:34:995 EDT FFDC Exception:java.lang.NullPointerException SourceId:com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.stop ProbeId:575 Reporter:com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl@23b908a
        java.lang.NullPointerException
        at com.ibm.ws.soa.sca.admin.runtime.impl.SCAClassLoader.getResources(SCAClassLoader.java:148)
        at org.apache.harmony.jndi.internal.EnvironmentReader.readMultipleResourceFiles(EnvironmentReader.java:226)
        at org.apache.harmony.jndi.internal.EnvironmentReader$2.run(EnvironmentReader.java:283)
        at org.apache.harmony.jndi.internal.EnvironmentReader$2.run(EnvironmentReader.java:281)
        at java.security.AccessController.doPrivileged(AccessController.java:254)
        at org.apache.harmony.jndi.internal.EnvironmentReader.readApplicationResourceFiles(EnvironmentReader.java:280)
        at javax.naming.InitialContext.internalInit(InitialContext.java:267)
        at javax.naming.InitialContext.<init>(InitialContext.java:211)
        at com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.removeJNDICacheKey(SCARuntimeImpl.java:859)
        at com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.stop(SCARuntimeImpl.java:566)
        at com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.stop(SCARuntimeImpl.java:634)
        at com.ibm.ws.soa.sca.admin.runtime.impl.SCARuntimeImpl.start(SCARuntimeImpl.java:617)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
        at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)
        at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5323)
        at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5539)
        at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)

        -Tom
        • Miljenko
          Miljenko
          7 Posts
          ACCEPTED ANSWER

          Re: [urgent] problem with deployment of SCA application with OSGi composite

          ‏2012-05-21T11:20:17Z  in response to Tom.Seelbach
          Hi Tom, Victor,

          that's exactly the error I'm getting when trying to deploy SCA application from RAD.
          It seems that this bug is related to WAS 8 (because of FFDC WAS logs). As for RAD tooling, I don't know does this error has something related, but after I receive this error RAD does not revert changes on WAS, and I have to remove my application manually via WAS admin console. Looks like RAD is performing a series of unrelated tasks when deploying SCA application, and does not have a proper rollback scenario if one task fails...

          I will contact IBM support, but I thought this issue is something already known and addressed (I didn't find any relevant PMR opened, but I might have missed something).

          Thanks,
          Miljenko
          • Tom.Seelbach
            Tom.Seelbach
            11 Posts
            ACCEPTED ANSWER

            Re: [urgent] problem with deployment of SCA application with OSGi composite

            ‏2012-05-22T13:16:37Z  in response to Miljenko
            Hi Miljenko,
            I cleaned up my environment and looked closer at the FFDC's. The first FFDC is:

            5/22/12 8:09:24:667 EDT FFDC Exception:java.lang.IllegalStateException SourceId:com.ibm.ws.eba.blueprint.transform.impl.Activator.processBlueprints ProbeId:184
            java.lang.IllegalStateException: We could not locate /../UpperCase.jar which is on the bundle classpath
            at com.ibm.ws.archive.core.resolvedbundle.OSGiResolvedBundleArchive.getResourcesFromBundle(OSGiResolvedBundleArchive.java:422)
            Do you see that as well?

            thanks,
            Tom
            • Tom.Seelbach
              Tom.Seelbach
              11 Posts
              ACCEPTED ANSWER

              Re: [urgent] problem with deployment of SCA application with OSGi composite

              ‏2012-05-22T14:35:09Z  in response to Tom.Seelbach
              Hi Miljenko,
              I see UpperCase.jar in the your zipped up projects, but not in the exported.zip. I added it manually to the eba. I also changed the MANIFEST.MF like this:

              Bundle-ClassPath: UpperCase.jar

              I don't think you need the ../

              But when i tried to import the asset in the admin console there is a problem:

              CWSAL0038W: The asset tom.eba contains a JAR file UpperCase.jar that is not a bundle and that will not be converted. If other parts of the application depend on this file, the application will fail at run time.

              Do you want to make Upper.jar into a bundle by updating the manifest?

              -Tom
  • SystemAdmin
    SystemAdmin
    126 Posts
    ACCEPTED ANSWER

    Re: [urgent] problem with deployment of SCA application with OSGi composite

    ‏2012-05-18T21:26:26Z  in response to Miljenko
    Hi Miljenko

    Regarding your RAD problem, can you contact IBM support? That's the proper process to help you out with this defect.
    ________________________________________________
    "If you prefer to speak in Spanish, please contact me directly"
  • bsulliv@us.ibm.com
    bsulliv@us.ibm.com
    1 Post
    ACCEPTED ANSWER

    Re: [urgent] problem with deployment of SCA application with OSGi composite

    ‏2012-05-21T15:01:32Z  in response to Miljenko
    While your issue is being investigated, it might be of interest to you (or others who find this thread) to review a couple of samples we offer.

    Our MyBank sample includes an implementation.osgiapp variation (including SDO databinding).

    http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.samples.doc%2Finfo%2Fae%2Fae%2Fwelcome_samples.html

    Also available is a more comprehensive redbook example at

    http://www.redbooks.ibm.com/redbooks/pdfs/sg247911.pdf