Thanks Guillaume - this was the problem.

I've got the JCAflow configuration deploying (I think) properly. Judging by the error messages, my configuration is certainly overwriting the defaults, but unfortunately, the condition is even worse than if I had just left it alone. I can't send more than a couple messages in a tight loop before I get the "no managed connections available" error, even with the blocking timeout tweaked up to 6 full seconds or so and max connections at 16. Once this happens, everything pretty much locks up. Its as if the connections stop being returned to the pool.

Later on in this cascade of exceptions, I'll see:

ERROR [AbstractTransactionContext:rollbackAndThrow] Unable to roll back transaction
java.lang.IllegalStateException: Status is STATUS_NO_TRANSACTION
at org.apache.geronimo.transaction.manager.TransactionImpl.rollback (TransactionImpl.java:438) at org.apache.geronimo.transaction.context.InheritableTransactionContext.ro llbackAndThrow(InheritableTransactionContext.java:308) at org.apache.geronimo.transaction.context.InheritableTransactionContext.co mplete(InheritableTransactionContext.java:199) at org.apache.geronimo.transaction.context.InheritableTransactionContext.ro llback(InheritableTransactionContext.java:152) at org.apache.geronimo.transaction.context.GeronimoTransactionManager.ro...

This surprised me, as I have autoEnlistInTransaction="true"

Then still later, I'll see

WARN [XAEndpoint:release] Failed to rollback transaction: javax.transaction.SystemException
javax.transaction.SystemException
at org.apache.geronimo.transaction.manager.TransactionImpl.rollbackResource s(TransactionImpl.java:546) at org.apache.geronimo.transaction.manager.TransactionImpl.rollback (TransactionImpl.java:446) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.rollback( TransactionManagerImpl.java:155) at org.apache.geronimo.transaction.context.InheritableTransactionContext.is Rolledback(InheritableTransactionContext.java:283)
        at org.apache.geronimo.transaction.context.Inherit...

Then I'll see this null pointer exception, which stumps me, though I admit I have not looked at the activemq source:

ERROR [ServerSessionPoolImpl:removeFromPool] Error redispatching unconsumed messages from stale session
java.lang.NullPointerException
at org.apache.activemq.ra.ServerSessionPoolImpl.createServerSessionImpl (ServerSessionPoolImpl.java:60) at org.apache.activemq.ra.ServerSessionPoolImpl.getServerSession (ServerSessionPoolImpl.java:113) at org.apache.activemq.ra.ServerSessionPoolImpl.dispatchToSession (ServerSessionPoolImpl.java:135) at org.apache.activemq.ra.ServerSessionPoolImpl.removeFromPool (ServerSessionPoolImpl.java:175) at org.apache.activemq.ra.ServerSessionImpl.run (ServerSessionImpl.java:177) at org.apache.geronimo.connector.work.WorkerContext.run (WorkerContext.java:291) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run (Unknown Source)
        at java.lang.Thread.run(Thread.java:613)
Thread-68 2006-06-27 16:13:59,558 WARN [Transaction:endResources] Error ending association for XAResource [EMAIL PROTECTED]; transaction will roll back. XA error code: -7
javax.transaction.xa.XAException: The connection is already closed
at org.apache.activemq.TransactionContext.toXAException (TransactionContext.java:589) at org.apache.activemq.TransactionContext.setXid (TransactionContext.java:554) at org.apache.activemq.TransactionContext.end (TransactionContext.java:327) at org.apache.activemq.ra.LocalAndXATransaction.end (LocalAndXATransaction.java:89) at org.apache.geronimo.transaction.manager.TransactionImpl.endResources (TransactionImpl.java:524)
        at org.apache.geronimo.transaction.manager.Tra


At this point I still don't know for sure if something I'm doing with my webapp-based deployment is causing all the trouble, so I plan on creating a simple test case to try and reproduce the issue in a standalone instance of servicemix.

Thanks for all your help so far,

B.J.



On Jun 27, 2006, at 3:29 PM, Guillaume Nodet wrote:

Yes. Unfortunately a bug has slipped in xbean version.
See http://issues.apache.org/jira/browse/XBEAN-21 and
https://issues.apache.org/activemq/browse/SM-458

You have to use
org/apache/servicemix/xbean/XmlWebApplicationContext.java<http:// svn.apache.org/repos/asf/incubator/servicemix/trunk/servicemix-core/ src/main/java/org/apache/servicemix/xbean/ XmlWebApplicationContext.java>instead
of org\apache\xbean\spring\context\XmlWebApplicationContext

Cheers,
Guillaume Nodet

On 6/27/06, William Blackburn <[EMAIL PROTECTED]> wrote:

Thanks Guillaume,

I understand this now, but my snapshot (6/16/2006) does not appear to
have the xbean definitions for sm:defaultBroker, etc. When I
sttempted to configure like the example you cited, s I got a
classdefnotfound error when I tried to run. So I tried to convert it
to standard spring bean defininitions, but no matter what I tried,
I'm pretty sure my flows were not properly defined, as I got:
"MessagingException: Unable to choose a flow for exchange"

I then decided to update our app to the latest snapshot (6/27/2006)
but now our app (which is deployed in Tomcat as a webapp) won;t
deploy at all. I get this from Spring (I notice we've moved to 2.0 at
some time since my last snapshot):

10:47:51,843 ERROR [ContextLoader:initWebApplicationContext] Context
initialization failed
java.lang.IllegalStateException: Could not find valid implementation
for: 2.0-m5
         at
org.apache.xbean.spring.context.XmlWebApplicationContext.createBeanDe fin
itionReader(XmlWebApplicationContext.java:84)
         at
org.apache.xbean.spring.context.XmlWebApplicationContext.loadBeanDefi nit
ions(XmlWebApplicationContext.java:63)
         at
org.springframework.context.support.AbstractRefreshableApplicationCon tex
t.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)


Is there something special I have to do to get this working under
Spring-2.0 ? I checked out the examples in the latest dist and
nothing seems to have changed and Spring claims backward
compatibility with 1.2.x. I'm at a complete standstill, so any help
you can offer will be much appreciated.

Thanks again,

B.J.




On Jun 27, 2006, at 12:03 AM, Guillaume Nodet wrote:

> Sorry, I forgot to say that you should configure the jca flow using
> the
> syntax used in
> http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-
> servicemix/src/main/release/conf/servicemix.xml?
> revision=415380&view=markupso
> that you can change the parameters, else all values will be defaulted.
>
> Cheers,
> Guillaume Nodet
>
> On 6/27/06, William Blackburn <[EMAIL PROTECTED]> wrote:
>>
>> Guillaume, please forgive me for being so dense, but I can't seem to >> use your advice to solve my problem. The error still occurs and still >> indicates the blocking timeout is 100ms. I must not be incorporating
>> the config from tx.xml properly
>>
>> First - I am using the snapshot from 6/16 - is this new enough?
>>
>> I simply replaced my current declarations of TransactionManager and
>> TransactionContectmanager with the entire tx.xml config
>>
>> My JCAContainer config now looks like:
>>
>> <bean id="jencks" class="org.jencks.JCAContainer"
>>          singleton="true">
>> <property name="bootstrapContext" ref="bootstrapContext" /> >> <!-- lets use the default configuration of work manager and
>> transaction manager-->
>>          <!--
>>          <property name="bootstrapContext">
>>              <bean
>>
>> class="org.jencks.factory.BootstrapContextFactoryBean">
>>                  <property name="threadPoolSize" value="25" />
>>              </bean>
>>          </property>
>>          -->
>>          <!-- the JCA Resource Adapter -->
>>          <property name="resourceAdapter">
>>              <bean id="activeMQResourceAdapter"
>>
>> class="org.apache.activemq.ra.ActiveMQResourceAdapter"
>>                  singleton="true">
>>                  <property name="serverUrl"
>>                      value="tcp://localhost:61616" />
>>              </bean>
>>          </property>
>>      </bean>
>>
>>
>>
>>
>> On Jun 26, 2006, at 2:12 PM, Guillaume Nodet wrote:
>>
>> > In the latest servicemix distribution, the jencks jca container is
>> > already
>> > configured.
>> > You may find easier to override the parameters (or copy/paste)
>> in the
>> > tx.xmlfile.
>> > See the poolingSupport bean in
>> > http://svn.apache.org/viewvc/incubator/servicemix/trunk/apache-
>> > servicemix/src/main/release/conf/tx.xml? revision=415380&view=markup
>> >
>> > Cheers
>> > Guillaume Nodet
>> >
>> > On 6/26/06, William Blackburn <[EMAIL PROTECTED]> wrote:
>> >>
>> >> This morning I did a rudimentary load test of our application,
>> just
>> >> fired 50 messages in rapid sequence via JMS to the first
>> component in
>> >> a 'chain' of components using JCA flow. Approx 20 messages into
>> the
>> >> test, I got the following error, for each of the remaining
>> messages.
>> >>
>> >>
>> >> 09:35:32,034 ERROR [JCAFlow:doRouting] Failed to send exchange:
>> >> MessageExchange[internal JMS Network
>> >> javax.jms.JMSException: No ManagedConnections available within
>> >> configured blocking timeout ( 100 [ms] )
>> >>          at
>> >> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection
>> >> (ActiveMQConnectionFactory.java:96)
>> >>          at
>> >> org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection
>> >> (ActiveMQConnectionFactory.java:65)
>> >>          at
>> >> org.apache.servicemix.jbi.nmr.flow.jca.JCAFlow.sendJmsMessage
>> >> (JCAFlow.java:700)
>> >>          ...
>> >>
>> >>
>> >> I've been studying the Servicemix and ActiveMQ docs, looking for
>> >> settings (under the JCAFlow or the ActiveMQ ConnectionFactory)
>> that
>> >> would help me increase the number of connections and/or the 100ms
>> >> timeout value, but I don't know exactly what I'm looking for,
>> so I'm
>> >> stumped.
>> >>
>> >> the applicable bits from my servicemix.xml file are:
>> >>
>> >> <sm:container id="jbi" rootDir="#rootDir" useMBeanServer="true"
>> >>          createMBeanServer="false"
>> installationDirPath="#installDir"
>> >>          deploymentDirPath="#deployDir" flowName="jca?
>> jmsURL=tcp://
>> >> localhost:61616"
>> >>          autoEnlistInTransaction="true" persistent="true"
>> >>          monitorInstallationDirectory="true" dumpStats="true"
>> >>          statsInterval="10"
>> transactionManager="#transactionManager"
>> >>          depends-on="broker">
>> >>
>> >> ...other stuff...
>> >>
>> >> <!-- the JCA container -->
>> >>      <bean id="jencks" class="org.jencks.JCAContainer"
>> >>          singleton="true">
>> >>
>> >>          <!-- lets use the default configuration of work
>> manager and
>> >> transaction manager-->
>> >>          <property name="bootstrapContext">
>> >>              <bean
>> >>
>> >> class="org.jencks.factory.BootstrapContextFactoryBean">
>> >>                  <property name="threadPoolSize" value="25" />
>> >>              </bean>
>> >>          </property>
>> >>
>> >>          <!-- the JCA Resource Adapter -->
>> >>          <property name="resourceAdapter">
>> >>              <bean id="activeMQResourceAdapter"
>> >>
>> >> class="org.apache.activemq.ra.ActiveMQResourceAdapter"
>> >>                  singleton="true">
>> >>                  <property name="serverUrl"
>> >>                      value="tcp://localhost:61616" />
>> >>              </bean>
>> >>          </property>
>> >>      </bean>
>> >>
>> >>      <bean id="broker"
>> >> class="org.apache.activemq.xbean.BrokerFactoryBean">
>> >> <property name="config" value="classpath:activemq.xml"/>
>> >>      </bean>
>> >>
>> >>      <bean id="transactionContextManager"
>> >> class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
>> >>      <bean id="transactionManager"
>> >>
>> class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />
>> >>
>> >>      <bean id="jmsFactory" depends-on="broker"
>> >> class="org.apache.activemq.pool.PooledConnectionFactory">
>> >>          <property name="connectionFactory">
>> >>              <bean
>> >>
>> >> class="org.apache.activemq.ActiveMQConnectionFactory">
>> >> <constructor-arg value="tcp://localhost: 61616" />
>> >>              </bean>
>> >>          </property>
>> >>      </bean>
>> >>
>> >> My activemq.xml file looks like:
>> >>
>> >> <beans xmlns="http://activemq.org/config/1.0";>
>> >>      <broker id="broker" useJmx="false">
>> >>
>> >>          <persistenceAdapter>
>> >>              <journaledJDBC journalLogFiles="5"
>> >> dataDirectory="#dataDir" dataSource="#postgres-ds"/>
>> >>          </persistenceAdapter>
>> >>
>> >>          <transportConnectors>
>> >>              <transportConnector uri="tcp://localhost:61616"/>
>> >>          </transportConnectors>
>> >>
>> >>
>> >>      </broker>
>> >>
>> >> <!-- This xbean configuration file supports all the standard
>> >> spring xml configuration options -->
>> >>
>> >>      <!-- Postgres DataSource Sample Setup -->
>> >>      <bean id="postgres-ds"
>> >> class="org.postgresql.ds.PGPoolingDataSource">
>> >>          <property name="serverName" value="localhost"/>
>> >>          <property name="databaseName" value="activemq"/>
>> >>          <property name="portNumber" value="0"/>
>> >>          <property name="dataSourceName" value="postgres"/>
>> >>          <property name="initialConnections" value="1"/>
>> >>          <property name="maxConnections" value="10"/>
>> >>          <property name="user" value="activemq"/>
>> >>          <property name="password" value="activemq"/>
>> >>          <!--
>> >>          <property name="user" value="cmroot"/>
>> >>          <property name="password" value="22cmroot"/>
>> >>          -->
>> >>      </bean>
>> >>
>> >>
>> >>
>> >>      <!-- Directories relative to web app -->
>> >>      <bean id="servletContext"
>> >>
>> class="org.springframework.web.context.support.ServletContextFactoryB
>> >> ean
>> >> " />
>> >>      <bean id="dataDir"
>> class="org.springframework.web.util.WebUtils"
>> >> factory-method="getRealPath">
>> >>          <constructor-arg ref="servletContext" />
>> >>          <constructor-arg value="/data" />
>> >>      </bean>
>> >>
>> >> </beans>
>> >>
>> >>
>> >>
>> >>
>>
>>



Reply via email to