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.createBeanDefin
itionReader(XmlWebApplicationContext.java:84)
at
org.apache.xbean.spring.context.XmlWebApplicationContext.loadBeanDefinit
ions(XmlWebApplicationContext.java:63)
at
org.springframework.context.support.AbstractRefreshableApplicationContex
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>
>> >>
>> >>
>> >>
>> >>
>>
>>