Hi Philipp,
Good to see you are progressing.
If I undertand well fail-over occurs, but your receive a ClassCastException upon receiving a message.

I would be great if you could share the details of your configuration (just replace hostname, username, password...) to make fail-over work.

Also, you could try to patch the code with javax.jms.ConnectionFactory, rebuild it and see if it works with the new jars.

Thx again and come back here if you need more details on anything,

Eric

On 17/01/2013 13:23, Philipp Krenn wrote:
Hi,

we have removed the definition for creating an ActiveMQ broker from the 
spring-server.xml and are using an external one. In order to do so, we have 
configured <amq:connectionFactory.../> accordingly. This configuration is the 
same as we are using for several other camel-based applications (where we also use 
Spring's CachingConnectionFactory) accessing the same broker.

So we do not expect that this is a configuration error. What we also observed 
is that by replacing the CachingConnectionFactory by AMQ's 
PooledConnectionFactory, the failover works fine. However, an exception is 
thrown upon receiving a message, since somewhere in the code an 
org.springframework.jms.connection.CachingConnectionFactory instead of a 
javax.jms.ConnectionFactory is injected.

Best regards,
Philipp


Am 15.01.2013 um 20:57 schrieb Eric Charles <e...@apache.org>:

Hi,

Interestting, this is the first time I hear about a real James with amq in a 
failover configuration.

I guess you changed in spring-server.xml the block
<amq:transportConnectors>
   <amq:transportConnector uri="tcp://localhost:0" />
</amq:transportConnectors>

Maybe a first test scenario would be to be sure James doesn't use the queue, 
failingover amq, and begin to send again mail to james. The error may be due 
because the fail over occurs while a transaction is occurring?

Thx, Eric


On 15/01/2013 15:26, Philipp Krenn wrote:
Hi,


We are using James Server with an ActiveMQ master/slave configuration 
configured via failover: 
failover:(tcp://mq0.xxx:8080,tcp://mq1.xxx:8080)?jms.prefetchPolicy.all=0
When the master stops, we would expect a failover to the slave - this is 
working fine with other applications. However, James Server does not switch 
queue instance and keeps producing the following exception instead:

[ERROR] - Exception caught in RemoteDelivery.run() [Remote delivery thread (3)] 
[j.mailetcontext]
org.apache.james.queue.api.MailQueue$MailQueueException: Unable to dequeue next 
message (javax.jms.IllegalStateException: The Session is closed)
        at 
org.apache.james.queue.jms.JMSMailQueue.deQueue(JMSMailQueue.java:170) 
~[james-server-queue-jms-3.0-beta5-20130109.104230-723.jar:3.0-beta5-SNAPSHOT]
        at 
org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:771) 
~[james-server-mailets-3.0-beta5-20130110.114225-802.jar:3.0-beta5-SNAPSHOT]
        at java.lang.Thread.run(Thread.java:679) [na:1.6.0_24]
Caused by: javax.jms.IllegalStateException: The Session is closed
        at 
org.apache.activemq.ActiveMQSession.checkClosed(ActiveMQSession.java:731) 
~[activemq-core-5.7.0.jar:5.7.0]
        at 
org.apache.activemq.ActiveMQSession.createQueue(ActiveMQSession.java:1169) 
~[activemq-core-5.7.0.jar:5.7.0]
        at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source) ~[na:na]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.6.0_24]
        at java.lang.reflect.Method.invoke(Method.java:616) ~[na:1.6.0_24]
        at 
org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:344)
 ~[spring-jms-3.1.0.RELEASE.jar:3.1.0.RELEASE]
        at $Proxy87.createQueue(Unknown Source) ~[na:na]
        at 
org.apache.james.queue.jms.JMSMailQueue.deQueue(JMSMailQueue.java:107) 
~[james-server-queue-jms-3.0-beta5-20130109.104230-723.jar:3.0-beta5-SNAPSHOT]
        ... 2 common frames omitted

The James Server keeps running and consumes 100% of the available CPU until it 
is manually restarted.

Thanks for looking into this issue.


Cheers,
Philipp

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to