OSGi Applications: Known restrictions

There are a small number of known restrictions that apply when working with OSGi Applications.

List of known OSGi Applications issues and restrictions

Blueprint bean implementation classes cannot be final

The following Blueprint XML example code declares a Blueprint-managed bean, which is backed by an instance of the com.acme.MyBeanImpl implementation class. This class is defined in com.acme.MyBeanImpl.java:
<bean id="beanId" class="com.acme.MyBeanImpl">
  <property name="logger" ref="loggingService"/>
</bean>
In this example, the com.acme.MyBeanImpl implementation class is subject to the following restrictions:
  • It cannot be declared final.
  • It cannot be declared as an enumeration because this process also makes the class final.
  • It cannot contain any final methods.
In your code, none of the Blueprint bean implementation classes can be final. If you specify a Blueprint bean implementation class that is final, you get an exception message similar to the following message:
[16/03/10 15:38:16:906 GMT] 00000013 BlueprintCont E
org.apache.aries.blueprint.container.BlueprintContainerImpl doRun
Unable to start blueprint container for bundle
com.ibm.componenttest.logging
org.osgi.service.blueprint.container.ComponentDefinitionException:
Unable to proxy bean for interceptors:
org.apache.aries.blueprint.proxy.FinalModifierException
at org.apache.aries.blueprint.proxy.AsmInterceptorWrapper.
   createProxyObject(AsmInterceptorWrapper.java:148)
at org.apache.aries.blueprint.container.BeanRecipe.
   addInterceptors(BeanRecipe.java:651)
at
...

Enterprise JavaBeans (EJBs) cannot be invoked directly from an OSGi application

An OSGi bundle or a web application bundle (WAB) cannot look up and invoke an EJB directly. However, an OSGi application can interact with EJB modules through either Service Component Architecture (SCA) or the Java Message Service (JMS):
  • An OSGi application can be included in an SCA environment, and the SCA modules can be configured to bind to EJB modules.
  • An OSGi application can interact with EJBs by sending JMS messages to destinations, and configuring the EJBs or message driven beans (MDBs) to retrieve the messages from those destinations and respond to them.

Reference topic

Terms of use | Feedback


Timestamp icon Last updated: Tuesday, 20 September 2011
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-express-dist&topic=ra_restrict

Copyright IBM Corporation 2009, 2011. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)