Restore | Raw | History | First | Previous | Next | Last | Close

OSGi Integration

The Atomikos OSGi bundle

Atomikos TM can be used in 2 differents ways:

  1. If you start the Atomikos OSGi bundle, an implementation of javax.transaction.TransactionManager and javax.transaction.UserTransaction will be registered in the OSGi registry. You''ll be able to lookup for them as requested.
  2. If you don't start the Atomikos OSGi bundle, you'll be free to instantiate the Transaction Manager by yourself pretty much like you would do outside OSGi world (see Spring sample and/or JTA sample).

Running the example example(s)

Pre-requisites :

  • Knowledge of OSGi
  • Knowlegde of Pax Exam, the test framework for OSGi.

For the sake of simplicity, the demo relies on an embedded container from Pax Exam. The Pax Exam 2.x site

Import the OSGI sample in an IDE that supports maven (all maven IDE have maven support). For Eclipse users, you should be able to see something like Eclipse_navigator.png.

Setting up your environment

Pax Exam requires your Import the OSGI sample files to be installed in your local an IDE that supports maven repo. You need (all maven IDE have maven support). For Eclipse users, you should be able to invoke "mvn clean install" see something like this: on the "osgi" folder to do that.

Note for TransactionEssentials users : please remove service-tracker-osgi-example-db-axt and service-tracker-osgi-tests-axt modules as they rely on modules that are not available in the central maven repo (see "modules" tag in the service-tracker submodule). <noautolink>Eclipse navigator.png</noautolink>

Running the sample :

Note for TransactionEssentials users : please remove service-tracker-osgi-example-db-axt and service-tracker-osgi-tests-axt modules as they rely on modules that are not available in the central maven repo (see "modules" tag in the service-tracker submodule).

TransactionsEssentials Demo

Pax Exam requires your files to be installed in your local maven repo. You need to invoke "mvn clean install" on the "osgi" folder to do that.

Running the TransactionsEssentials demo

  1. Go to service-tracker-osgi-tests module.
  2. Select com.atomikos.osgi.sample.OSGiUnitTest
  3. Run as Java application.
  4. A OSGi container is started a basic OSGi sample. Open http://localhost:8080/ and play with It.

Running the ExtremeTransactions Demo demo

  1. Go to service-tracker-osgi-tests-axt module.
  2. Select com.atomikos.osgi.sample.OSGiContainer
  3. Run as Java application.
  4. Append to the JVM parameters:
-Dcom.atomikos.icatch.license_folder=<a folder containing a license> 
  1. Re-run the Application.
  2. A OSGi container is started a basic OSGi sample. Open http://localhost:8080/ and play with It.

Troubleshooting

The config file target/classes/META-INF/maven/dependencies.properties is used by Pax Exam to resolve the right versions of maven modules. If you encounter an error message : "Could not resolve version. Did you configure the plugin in your maven project? Or maybe you did not run the maven build and you are using an IDE?" simply run "mvn compile" on service-tracker-osgi-tests (or service-tracker-osgi-tests-axt).

Attach
png version 1 uploaded by PascalLeclercq on 14 Dec 2013 - 10:39
 
spacer
Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM