In J2EE 1.4 or later the standard way to integrate with a JMS provider is via JCA 1.5 and a Resource Adapter.
ActiveMQ includes a Java Connector Architecture (JCA) 1.5 Resource Adapter. JCA 1.5 defines the contract between an J2EE application server and external resources such as databases and messaging middleware. It allows the application server to efficiently pool connections, control transactions and manage security. The Resource Adapter allows ActiveMQ to be used from any J2EE 1.4 application server. We have tested that the Resource Adapter works in the following J2EE 1.4 containers
Downloading the RAR
The RAR is available via maven central
The use of an Embedded Broker
The ActiveMQ Resource Adapter can connect to a remote broker using any of the available transports, or it can start up an embedded broker. As described in the Resource Adapter Properties, you can enable an embedded broker using the BrokerXmlConfig property.