// Use JOnAS 4.x MDB Helper
MDBResourceAdapterHelper.setResourceAdapterFinder(new JOnAS4ResourceAdapterFinder());
// Use of JOnAS 4.x security model
SecurityCurrent.setSecurityCurrent(new JOnASSecurityCurrent());
// start of the embedded object will be delayed until JOnAS is started.
// This is because Datasource could be deployed after this adapter and
// then datasource won't be found.
new EmbeddedStarter().start();