You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by James Strachan <ja...@gmail.com> on 2006/09/04 09:14:32 UTC

Re: AMQ 4.0.x & MDB Listener not connecting

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 <st...@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/

Re: AMQ 4.0.x & MDB Listener not connecting

Posted by SurajN <na...@yahoo.com>.
Hi James,

I am also facing the same issue with WAS5 and ActiveMQ4.1.1

This appears to be a local transaction issue in websphere.

This happens when websphere tries to create a new server session by calling
new ServerSession() [com.ibm.ejs.jms.listener.ServerSession]. The
constructor starts a local transaction and then goes into an infinite loop.
I have attached the file ServerSession.java

I have also attached the server trace logs.

Please advise.

Regards,
Suraj



Muzza wrote:
> 
> Hi Guys,
> 
> Could someone take a look at this please ?
> 
> Thanks,
> Steve
> 
> 
> Muzza wrote:
>> 
>> Hi James,
>> 
>> I've managed to look into this problem again and have attached a Word
>> Document with screenshots of the JMX view of this problem. One set of
>> screenshots showing what happens in JMX when I have a message on AMQ and
>> then fire up an MDB in Websphere 5.1. The other set of screenshots then
>> show what happens when I clear down the MDB request queue and start up
>> Websphere.
>> 
>> The difference I've found between the two is that I never get a
>> Subscription when I have a message already on the queue, this is apparent
>> in the screenshots.
>> 
>> Can you take a look and advise please ? 
>> 
>> Thanks,
>> 
>> Steve.
>> 
>> James.Strachan wrote:
>>> 
>>> On 9/4/06, Muzza <st...@amt-sybex.com> wrote:
>>>>
>>>> Hi James,
>>>>
>>>> I've ran Jconsole and can see that my queue exists and that a
>>>> connection is
>>>> established to the broker.
>>> 
>>> How about looking at the subscriptions to see what its subscribing to
>>> - to check that the subscriptions really are subscribing to the same
>>> name queue?
>>> 
>>> 
>>>> But still when the queue has any sort of
>>>> queuesize the MDB doesn't fire it's onMessage.
>>>>
>>>> Is there any particular screenshot from Jconsole I can send in or is
>>>> there
>>>> any log file from AMQ I can produce ?
>>>>
>>>> When the underlying architecture was changed between 3.2.2 and 4.x
>>>> would
>>>> this have affected the ActiveMQWASInitialContextFactory, which we use
>>>> when
>>>> connecting to AMQ via Websphere ?
>>> 
>>> I don't think so as its purely to workaround some WAS JNDI issues
>>> 
>>> -- 
>>> 
>>> James
>>> -------
>>>  http://radio.weblogs.com/0112098/ http://radio.weblogs.com/0112098/ 
>>> 
>>> 
>> 
>> http://www.nabble.com/file/p6505260/AMQ%2520MDB%2520Not%2520Connecting.zip
>> AMQ MDB Not Connecting.zip 
>> 
> 
> 
http://www.nabble.com/file/p12653379/trace.log trace.log 
http://www.nabble.com/file/p12653379/ServerSession.java ServerSession.java 
-- 
View this message in context: http://www.nabble.com/AMQ-4.0.x---MDB-Listener-not-connecting-tf2179115s2354.html#a12653379
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.0.x & MDB Listener not connecting

Posted by Muzza <st...@amt-sybex.com>.
Hi Guys,

Could someone take a look at this please ?

Thanks,
Steve


Muzza wrote:
> 
> Hi James,
> 
> I've managed to look into this problem again and have attached a Word
> Document with screenshots of the JMX view of this problem. One set of
> screenshots showing what happens in JMX when I have a message on AMQ and
> then fire up an MDB in Websphere 5.1. The other set of screenshots then
> show what happens when I clear down the MDB request queue and start up
> Websphere.
> 
> The difference I've found between the two is that I never get a
> Subscription when I have a message already on the queue, this is apparent
> in the screenshots.
> 
> Can you take a look and advise please ? 
> 
> Thanks,
> 
> Steve.
> 
> James.Strachan wrote:
>> 
>> On 9/4/06, Muzza <st...@amt-sybex.com> wrote:
>>>
>>> Hi James,
>>>
>>> I've ran Jconsole and can see that my queue exists and that a connection
>>> is
>>> established to the broker.
>> 
>> How about looking at the subscriptions to see what its subscribing to
>> - to check that the subscriptions really are subscribing to the same
>> name queue?
>> 
>> 
>>> But still when the queue has any sort of
>>> queuesize the MDB doesn't fire it's onMessage.
>>>
>>> Is there any particular screenshot from Jconsole I can send in or is
>>> there
>>> any log file from AMQ I can produce ?
>>>
>>> When the underlying architecture was changed between 3.2.2 and 4.x would
>>> this have affected the ActiveMQWASInitialContextFactory, which we use
>>> when
>>> connecting to AMQ via Websphere ?
>> 
>> I don't think so as its purely to workaround some WAS JNDI issues
>> 
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
>  http://www.nabble.com/file/115/AMQ%20MDB%20Not%20Connecting.zip AMQ MDB
> Not Connecting.zip 
> 

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


Re: AMQ 4.0.x & MDB Listener not connecting

Posted by Muzza <st...@amt-sybex.com>.
Hi James,

I've managed to look into this problem again and have attached a Word
Document with screenshots of the JMX view of this problem. One set of
screenshots showing what happens in JMX when I have a message on AMQ and
then fire up an MDB in Websphere 5.1. The other set of screenshots then show
what happens when I clear down the MDB request queue and start up Websphere.

The difference I've found between the two is that I never get a Subscription
when I have a message already on the queue, this is apparent in the
screenshots.

Can you take a look and advise please ? 

Thanks,

Steve.

James.Strachan wrote:
> 
> On 9/4/06, Muzza <st...@amt-sybex.com> wrote:
>>
>> Hi James,
>>
>> I've ran Jconsole and can see that my queue exists and that a connection
>> is
>> established to the broker.
> 
> How about looking at the subscriptions to see what its subscribing to
> - to check that the subscriptions really are subscribing to the same
> name queue?
> 
> 
>> But still when the queue has any sort of
>> queuesize the MDB doesn't fire it's onMessage.
>>
>> Is there any particular screenshot from Jconsole I can send in or is
>> there
>> any log file from AMQ I can produce ?
>>
>> When the underlying architecture was changed between 3.2.2 and 4.x would
>> this have affected the ActiveMQWASInitialContextFactory, which we use
>> when
>> connecting to AMQ via Websphere ?
> 
> I don't think so as its purely to workaround some WAS JNDI issues
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 
http://www.nabble.com/file/115/AMQ%20MDB%20Not%20Connecting.zip AMQ MDB Not
Connecting.zip 
-- 
View this message in context: http://www.nabble.com/AMQ-4.0.x---MDB-Listener-not-connecting-tf2179115.html#a6443569
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: AMQ 4.0.x & MDB Listener not connecting

Posted by James Strachan <ja...@gmail.com>.
On 9/4/06, Muzza <st...@amt-sybex.com> wrote:
>
> Hi James,
>
> I've ran Jconsole and can see that my queue exists and that a connection is
> established to the broker.

How about looking at the subscriptions to see what its subscribing to
- to check that the subscriptions really are subscribing to the same
name queue?


> But still when the queue has any sort of
> queuesize the MDB doesn't fire it's onMessage.
>
> Is there any particular screenshot from Jconsole I can send in or is there
> any log file from AMQ I can produce ?
>
> When the underlying architecture was changed between 3.2.2 and 4.x would
> this have affected the ActiveMQWASInitialContextFactory, which we use when
> connecting to AMQ via Websphere ?

I don't think so as its purely to workaround some WAS JNDI issues

-- 

James
-------
http://radio.weblogs.com/0112098/

Re: AMQ 4.0.x & MDB Listener not connecting

Posted by Muzza <st...@amt-sybex.com>.
Hi James,

I've ran Jconsole and can see that my queue exists and that a connection is
established to the broker. But still when the queue has any sort of
queuesize the MDB doesn't fire it's onMessage.

Is there any particular screenshot from Jconsole I can send in or is there
any log file from AMQ I can produce ?

When the underlying architecture was changed between 3.2.2 and 4.x would
this have affected the ActiveMQWASInitialContextFactory, which we use when
connecting to AMQ via Websphere ?

Thanks,
Steve.



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 <st...@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 <st...@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#a6133486
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 4.0.x & MDB Listener not connecting

Posted by Muzza <st...@amt-sybex.com>.
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 <st...@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 <st...@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.


Re: AMQ 4.0.x & MDB Listener not connecting

Posted by James Strachan <ja...@gmail.com>.
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 <st...@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 <st...@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/

Re: AMQ 4.0.x & MDB Listener not connecting

Posted by Muzza <st...@amt-sybex.com>.
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 <st...@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.