Little more info. Got past this part. Then hit an auth issue, turned off auth for now and I at least see the connections making it (woo hoo!!).
It looks like it passes back a proxy wrapper to the session, and not the session itself. It looks like OpenEJB and ActiveMQ are both trying to handle the closing of the session automatically. https://github.com/apache/tomee/blob/develop/container/openejb-core/src/main/java/org/apache/openejb/resource/AutoConnectionTracker.java So ummm need to think about this a bit more. John On Sat Jan 03 2015 at 1:29:31 PM John D. Ament <[email protected]> wrote: > Clebert, > > On Sat Jan 03 2015 at 1:11:57 PM Clebert Suconic < > [email protected]> wrote: > >> That's great stuff you're doing... >> >> >> Is there a branch we could try this? >> >> > Sure, you can find it here: > https://github.com/johnament/tomee/tree/activemq-6 > > You can see the test is called AMQXASupportTest, where I'm just trying to > go through the steps that would bootstrap the RA. It's in the openejb-core > module, the only things I've poked at thus far are around which classes are > being invoked since there's lots of new packages and classes floating > around (obviously). > > FWIW I had thought to use a similar approach I took last time I did an > embedded HornetQ type solution, however that was an early 2.1/2.2 thing, > and it looks like the 2.4 code base was a bit different for the non-JMS > pieces. > > >> >> Perhaps there are dependencies that would need to be installed, and >> old dependencies we still need to clear from the codebase? Did you >> look at that? >> > > I've thought about classloader issues, but I don't think that's the case > yet. The fact that I'm seeing AMQ start up means that the code to boot the > RA is working, it's simply not able to find the InVM connection that it's > expecting. > > All maven dependencies were updated and locally I'm building off this > branch: https://github.com/johnament/activemq-6/tree/geronimo-spec-jar > but I don't think that makes much difference. > > Now it could also be that I was way off on my guesses for what the new > classes are, but comparing the classes I picked from 6 to what TomEE used > in 5.10 they appear to serve the same function. The only thing special > about TomEE's RA (which extended AMQ 5.10's) was that they used the JDBC > store for messages. For now that's not an issue for me so I avoided the > sub-class for now. > > John > > >> >> On Sat, Jan 3, 2015 at 11:23 AM, John D. Ament <[email protected]> >> wrote: >> > I'm resending this as I had my emails messed up. Sorry for any >> moderation >> > issues. >> > >> > On Sat Jan 03 2015 at 11:06:43 AM John D. Ament <[email protected]> >> > wrote: >> > >> >> Ok, so got a little bit further. I see the broker starting with the >> in vm >> >> connector. >> >> >> >> 659 [main] DEBUG org.apache.activemq.ra - Recovery Registry located = >> >> org.apache.activemq.service.extensions.xa.recovery.ActiveMQR >> egistryImpl@a530d0a >> >> >> >> 660 [main] DEBUG org.apache.activemq.ra - No connector params provided >> >> using default >> >> >> >> 660 [main] DEBUG org.apache.activemq.ra - Creating Connection Factory >> on >> >> the resource adapter for >> >> transport=[TransportConfiguration(name=8a3b9a30-9361-11e4-8f47- >> bb448fce34db, >> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> ectorFactory) >> >> ?server-id=0] with ha=false >> >> >> >> 660 [main] DEBUG org.apache.activemq.ra - No connector params provided >> >> using default >> >> >> >> 660 [main] DEBUG org.apache.activemq.ra - Creating Recovery Connection >> >> Factory on the resource adapter for >> >> transport=[TransportConfiguration(name=8a3b9a32-9361-11e4-8f47- >> bb448fce34db, >> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> ectorFactory) >> >> ?server-id=0] >> >> >> >> 660 [main] DEBUG org.apache.activemq.ra - registering recovery for >> >> factory : ActiveMQConnectionFactory [serverLocator=ServerLocatorImpl >> >> [initialConnectors=[TransportConfiguration(name=8a3b9a32- >> 9361-11e4-8f47-bb448fce34db, >> >> factory=org-apache-activemq-core-remoting-impl-invm-InVMConn >> ectorFactory) >> >> ?server-id=0], discoveryGroupConfiguration=null], clientID=null, >> >> consumerWindowSize = 1048576, dupsOKBatchSize=1048576, >> >> transactionBatchSize=1048576, readOnly=false] >> >> >> >> 660 [main] INFO org.apache.activemq.ra - ActiveMQ resource adaptor >> started >> >> >> >> >> >> However, it looks like on connecting it fails. I see this log message >> 10 >> >> times >> >> >> >> >> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - Trying >> >> reconnection attempt 0/1 >> >> >> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - Trying >> to >> >> connect with connector = >> >> org.apache.activemq.core.remoting.impl.invm.InVMConnectorFac >> tory@6968dc8d, >> >> parameters = {server-id=0} connector = null >> >> >> >> 743 [amq-worker- - 1] DEBUG org.apache.activemq.core.client - >> Connector >> >> towards org.apache.activemq.core.remoting.impl.invm.InVMConnector@ >> 51aed0b7 >> >> failed >> >> >> >> >> >> with different factories and connectors. Finally the stack trace on >> >> failure ends up looking like this: >> >> >> >> javax.jms.JMSException: Failed to create session factory >> >> >> >> at >> >> org.apache.activemq.core.client.impl.ServerLocatorImpl.creat >> eSessionFactory(ServerLocatorImpl.java:928) >> >> >> >> at >> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> ateConnectionInternal(ActiveMQConnectionFactory.java:673) >> >> >> >> at >> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> ateXAConnection(ActiveMQConnectionFactory.java:209) >> >> >> >> at >> >> org.apache.activemq.jms.client.ActiveMQConnectionFactory.cre >> ateXAConnection(ActiveMQConnectionFactory.java:204) >> >> >> >> at >> >> org.apache.activemq.ra.ActiveMQRAManagedConnection.setup(Act >> iveMQRAManagedConnection.java:906) >> >> >> >> at >> >> org.apache.activemq.ra.ActiveMQRAManagedConnection.<init>(Ac >> tiveMQRAManagedConnection.java:170) >> >> >> >> at >> >> org.apache.activemq.ra.ActiveMQRAManagedConnectionFactory. >> createManagedConnection(ActiveMQRAManagedConnectionFactory.java:164) >> >> >> >> >> >> John >> >> >> >> On Sat Jan 03 2015 at 10:42:20 AM John D. Ament <[email protected] >> > >> >> wrote: >> >> >> >>> Hi, >> >>> >> >>> So I'm tinkering around a bit to port TomEE to use ActiveMQ 6 instead >> of >> >>> ActiveMQ 5.10, mostly so that we can do JMS 2.0 support. >> >>> >> >>> The original code is based around the original >> ActiveMQResourceAdapter. >> >>> I started porting the code over to use the new one, however I've run >> into a >> >>> hitch. >> >>> >> >>> If I leverage your resource adapter, I get an error: >> >>> >> >>> java.lang.IllegalArgumentException: must provide either >> TransportType or >> >>> DiscoveryGroupAddress and DiscoveryGroupPort for ActiveMQ >> ResourceAdapter >> >>> Connection Factory >> >>> >> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter. >> >>> createActiveMQConnectionFactory(ActiveMQResourceAdapter.java:1987) >> >>> >> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter.setup( >> >>> ActiveMQResourceAdapter.java:1788) >> >>> >> >>> at org.apache.activemq.ra.ActiveMQResourceAdapter.start( >> >>> ActiveMQResourceAdapter.java:261) >> >>> >> >>> >> >>> However, there are no tests to show how to properly configure this, >> and I >> >>> can't find anything about using the resource adapter in the HornetQ >> docs. >> >>> For what I'm trying to do right now, the InVM connector is enough. >> How >> >>> would I configure the resource adapter to use the InVM connector? >> >>> >> >>> >> >>> I'll aim to deal with the TCP based connectors later. >> >>> >> >>> Thanks, >> >>> >> >>> >> >>> John >> >>> >> >> >> >> >> >> -- >> Clebert Suconic >> http://community.jboss.org/people/[email protected] >> http://clebertsuconic.blogspot.com >> >
