activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Muzza <stephen.mur...@amt-sybex.com>
Subject Re: AMQ 4.0.x & MDB Listener not connecting
Date Mon, 04 Sep 2006 07:55:14 GMT

Thanks James, will do. I've read about the startup destinations in 4.1, it's
eagerly awaited to say the least !!


James.Strachan wrote:
> 
> I don't really follow whats happening - it sounds strange. The best
> bet is to fire up JConsole (or your favourite JMX console) and look at
> the queues in ActiveMQ along with the subscriptions to see if you have
> a mismatch between what destinations have messages in them and what
> the subscriptions are listening to etc.
> 
> http://incubator.apache.org/activemq/jmx.html
> 
> In 4.1 onwards you can force the destinations available on startup BTW
> http://incubator.apache.org/activemq/configure-startup-destinations.html
> 
> On 9/4/06, Muzza <stephen.murray@amt-sybex.com> wrote:
>>
>> The stack trace was from Websphere AS 5.1, just thought it might help.
>> I'm
>> not sure it is JNDI, unless there's a property I'm missing, as it does
>> connect through fine when there is a queue depth of 0.
>>
>> We set up AMQ 4.0.x as a Generic JMS Provider within Websphere as follows
>> :
>>
>> Classpath =
>> C:\SWWAEGAlib\incubator-activemq-4.0.2\incubator-activemq-4.0.2.jar
>> C:\SWWAEGAlib\incubator-activemq-4.0.2\lib\backport-util-concurrent-2.1.jar
>> C:\SWWAEGAlib\incubator-activemq-4.0.2\lib\commons-logging-1.1.jar
>> C:\SWWAEGAlib\incubator-activemq-4.0.2\lib\geronimo-j2ee-management_1.0_spec-1.0.jar
>>
>> External Initial Context Factory =
>> org.apache.activemq.jndi.ActiveMQWASInitialContextFactory
>>
>> External Provider Url = tcp://localhost:61616
>>
>> We then have our QueueConnectionFactory binding to an external JNDI =
>> ConnectionFactory
>>
>> and finally our Destination queue refers to an External JNDI =
>> dynamicQueues/queue/requestQeue.
>>
>> This is then configured against a Listener Port in Websphere and our
>> application connects fine when the Queue Depth is zero, but doesn't when
>> the
>> Queue is populated, ie the onMessage method is never triggered for this
>> Queue.
>>
>> This is where I started to think that dynamicQueues were creating another
>> Queue each time we restarted the App that then  didn't link to the
>> existing
>> queue that had a queue depth.
>>
>> Any thoughts on specifi AMQ config I might require ?
>>
>> If I want to test this using a jndi.properties file can I just place this
>> on
>> the classpath or will I have to generate a .bindings file and use the Sun
>> File server implementation ?
>>
>> Thanks,
>> Steve.
>>
>>
>>
>> James.Strachan wrote:
>> >
>> > The stack trace you give has no ActiveMQ method calls or logging
>> > methods which is strange. Could this be a JNDI configuration issue?
>> >
>> > On 8/28/06, Muzza <stephen.murray@amt-sybex.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> Using AMQ 4.0.1 and 4.0.2 and Websphere AS 5.1.11
>> >>
>> >> I have an MDB deployed which will pick up and process messages from an
>> >> AMQ
>> >> persistent queue. All is fine if the queue is cleared down before
>> >> starting
>> >> my application.
>> >>
>> >> However, if I start AMQ and put a message on the Queue via Hermes and
>> >> then
>> >> start up my application in WAS 5.1 I never get a connection to the
>> queue
>> >> via
>> >> ListenerPort in WAS 5.1.
>> >>
>> >> I'm suspecting that this may be a security / permissions problem when
>> >> accessing the queue, but can't see what would cause this to only kick
>> in
>> >> when there are messages on the queue.
>> >>
>> >> I do see errors like the following in a ServerException log within
>> WAS,
>> >> would anyone have an idea on this or come across this problem before ?
>> >>
>> >> Log from WAS 5.1 :
>> >>
>> >> Index  Occur Time of last Occurence   Exception SourceId ProbeId
>> >>        ences
>> >>
>> -----------------------------------------------------------------------
>> >> 1      1     28/08/06 19:21:58:703 IST java.io.FileNotFoundException
>> >> com.ibm.ejs.jms.listener.AsyncMessageLog.readRequestLogFile 128
>> >>
>> -----------------------------------------------------------------------
>> >> +2      1     28/08/06 19:21:59:203 IST
>> java.lang.ClassNotFoundException
>> >> com.ibm.ws.activity.ActivityServiceInterceptor.loadMigrationImpls 424
>> >> +3      1     28/08/06 19:21:59:766 IST
>> >> com.ibm.ws.naming.jcache.CacheEntryNotFoundException
>> >> com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal 367
>> >> +4      1     28/08/06 19:22:00:062 IST
>> >> javax.naming.NameAlreadyBoundException
>> >>
>> com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_bind_new_corba_context
>> >> 1042
>> >> +5      1     28/08/06 19:22:00:062 IST
>> >> org.omg.CosNaming.NamingContextPackage.AlreadyBound
>> >> com.ibm.ws.naming.jndicos.CNContextImpl.doCreateSubcontext 2155
>> >> +6      1     28/08/06 19:22:00:062 IST
>> >> javax.naming.NameAlreadyBoundException
>> >> com.ibm.ws.naming.jndicos.CNContextImpl.createSubcontext 756
>> >> +7      1     28/08/06 19:22:00:438 IST
>> >> org.omg.CosNaming.NamingContextPackage.NotFound
>> >>
>> com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.bind_new_corba_context
>> >> 944
>> >> +8      1     28/08/06 19:22:00:438 IST
>> >> org.omg.CosNaming.NamingContextPackage.NotFound
>> >> com.ibm.ws.naming.jndicos.CNContextImpl.doCreateSubcontext 2161
>> >> +9      1     28/08/06 19:22:00:438 IST
>> >> javax.naming.NameNotFoundException
>> >> com.ibm.ws.naming.jndicos.CNContextImpl.createSubcontext 756
>> >> +10     1     28/08/06 19:22:00:453 IST
>> >> javax.naming.NameNotFoundException
>> >> com.ibm.ws.naming.urlbase.UrlContextImpl.lookup 1226
>> >> +11     1     28/08/06 19:22:00:469 IST
>> >> javax.naming.NameNotFoundException
>> >> com.ibm.ws.naming.urlbase.UrlContextImpl.lookup 1252
>> >> +12     1     28/08/06 19:22:01:922 IST java.io.FileNotFoundException
>> >>
>> com.ibm.ejs.jms.DurableSubscriptionManagerImpl.readDurableSubscriptionFile
>> >> 236
>> >> +13     1     28/08/06 19:22:03:172 IST
>> >> javax.naming.NameNotFoundException
>> >> com.ibm.ejs.container.BeanMetaData.BeanMetaData 2507
>> >>
>> >> and my config is pretty basic in activemq.xml :
>> >>
>> >> <!-- START SNIPPET: example -->
>> >> <beans xmlns="http://activemq.org/config/1.0">
>> >>
>> >>   <!-- Allows us to use system properties as variables in this
>> >> configuration
>> >> file -->
>> >>   <bean
>> >>
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
>> >>
>> >>   <broker persistent="true" useJmx="true">
>> >>
>> >>     <!--  Use the following to set the broker memory limit (in bytes)
>> 1mb
>> >> below)
>> >>     <memoryManager>
>> >>         <usageManager id="memory-manager" limit="1048576"/>
>> >>     </memoryManager>
>> >>     -->
>> >>
>> >>     <!-- Use the following to configure how ActiveMQ is exposed in JMX
>> >>     <managementContext>
>> >>        <managementContext connectorPort="1099"
>> >> jmxDomainName="org.apache.activemq"/>
>> >>     </managementContext>
>> >>     -->
>> >>
>> >>     <!-- In ActiveMQ 4, you can setup destination policies -->
>> >>     <destinationPolicy>
>> >>       <policyMap><policyEntries>
>> >>
>> >>           <policyEntry topic="FOO.>">
>> >>             <dispatchPolicy>
>> >>               <strictOrderDispatchPolicy />
>> >>             </dispatchPolicy>
>> >>             <subscriptionRecoveryPolicy>
>> >>               <lastImageSubscriptionRecoveryPolicy />
>> >>             </subscriptionRecoveryPolicy>
>> >>           </policyEntry>
>> >>
>> >>       </policyEntries></policyMap>
>> >>     </destinationPolicy>
>> >>
>> >>
>> >>     <persistenceAdapter>
>> >>         <journaledJDBC journalLogFiles="5"
>> >> dataDirectory="${activemq.home}/activemq-data"/>
>> >>       <!-- To use a different datasource, use th following syntax :
>> -->
>> >>       <!--
>> >>       <journaledJDBC journalLogFiles="5"
>> dataDirectory="../activemq-data"
>> >> dataSource="#postgres-ds"/>
>> >>        -->
>> >>     </persistenceAdapter>
>> >>
>> >>     <transportConnectors>
>> >>        <transportConnector name="default" uri="tcp://localhost:61666"
>> >> discoveryUri="multicast://default"/>
>> >>        <transportConnector name="stomp"  
>> uri="stomp://localhost:61663"/>
>> >>     </transportConnectors>
>> >>
>> >>     <networkConnectors>
>> >>       <!-- by default just auto discover the other brokers -->
>> >>       <networkConnector name="default" uri="multicast://default"/>
>> >>       <!--
>> >>       <networkConnector name="host1 and host2"
>> >> uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/>
>> >>       -->
>> >>     </networkConnectors>
>> >>
>> >>   </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="user" value="activemq"/>
>> >>     <property name="password" value="activemq"/>
>> >>     <property name="dataSourceName" value="postgres"/>
>> >>     <property name="initialConnections" value="1"/>
>> >>     <property name="maxConnections" value="10"/>
>> >>   </bean>
>> >>   -->
>> >>
>> >>   <!-- MySql DataSource Sample Setup -->
>> >>   <!--
>> >>   <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
>> >> destroy-method="close">
>> >>     <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
>> >>     <property name="url"
>> >> value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true"/>
>> >>     <property name="username" value="activemq"/>
>> >>     <property name="password" value="activemq"/>
>> >>     <property name="poolPreparedStatements" value="true"/>
>> >>   </bean>
>> >>   -->
>> >>
>> >>   <!-- Embedded Derby DataSource Sample Setup -->
>> >>
>> >>   <!--bean id="derby-ds"
>> >> class="org.apache.derby.jdbc.EmbeddedDataSource">
>> >>     <property name="databaseName" value="derbydb"/>
>> >>     <property name="createDatabase" value="create"/>
>> >>   </bean-->
>> >>
>> >>
>> >> </beans>
>> >> <!-- END SNIPPET: example -->
>> >>
>> >> Any help greatly appreciated, as I say it works fine when the request
>> >> queue
>> >> is blank but if still has some existing messages then the MDB doesn't
>> >> fire.
>> >>
>> >> Thanks,
>> >> Steve.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/AMQ-4.0.x---MDB-Listener-not-connecting-tf2179115.html#a6025868
>> >> Sent from the ActiveMQ - User forum at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> >
>> > James
>> > -------
>> > http://radio.weblogs.com/0112098/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/AMQ-4.0.x---MDB-Listener-not-connecting-tf2179115.html#a6131121
>> Sent from the ActiveMQ - User forum at Nabble.com.
>>
>>
> 
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/AMQ-4.0.x---MDB-Listener-not-connecting-tf2179115.html#a6131302
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message