Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ServiceMix can be embedded in any application server, Java SE or EE platform. When working inside an application server you probably want to reuse the application servers JNDI provider and tooling.

When you are working in embedded mode, you probably want a JNDI provider to use to configure the services available to other JBI components which do not use dependency injection and Spring to configure themselves.

For a standalone JNDI provider, we do recommend using our own Spring based JNDI provider which is the default in the stand alone ServiceMix server. To use add the following jndi.properties file to your classpath

Code Block
none
none
java.naming.factory.initial = org.servicemix.jbi.jndi.SpringInitialContextFactory

Note that you can also add a line

Code Block
none
none
java.naming.provider.url = classpath:foo/bar.xml

Where the value is any valid Spring resource string such as a file://foo/bar.xml or a URL such as http://acme.com/whatnot.xml. The default value is assumed to be classpath://jndi.xml.

Then you can create a regular Spring XML configuration file to create a JNDI context (called jndi), which by default is a file called jndi.xml on the classpath

Wiki Markup
{snippet:id=jndi|lang=xml|url=http://svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-assembly/src/main/release/conf/jndi.xml}

.