[ 
https://issues.apache.org/jira/browse/ARTEMIS-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009444#comment-15009444
 ] 

Justin Bertram edited comment on ARTEMIS-160 at 11/17/15 8:34 PM:
------------------------------------------------------------------

The runAfterActive was implemented here because of HORNETQ-911. At the time 
that 
org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl#runAfterActive 
actually runs it looks like the server is active. However, by the time that the 
WrappedRunnable executes the server is no longer active which is why the 
IllegalStateException is thrown.

I'm a bit confused about the use-case here because I was under the impression 
that the org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl 
itself would removed the  bindings via 
org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl#deActivate.  
Are you providing an custom implementation of 
org.apache.activemq.artemis.spi.core.naming.BindingRegistry?  If so, could you 
put hooks in there to do your specific JNDI clean-up when the JMSServerManager 
unbinds the JMS admin objects?


was (Author: jbertram):
The runAfterActive was implemented here because of HORNETQ-911. At the time 
that 
org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl#runAfterActive 
actually runs it looks like the server is active. However, by the time that the 
WrappedRunnable executes the server is no longer active which is why the 
IllegalStateException is thrown.

I'm a bit confused about the use-case here because I was under the impression 
that the org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl 
itself would removed the JNDI bindings via 
org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl#deActivate.  
Are you providing an custom implementation of 
org.apache.activemq.artemis.spi.core.naming.BindingRegistry?  If so, could you 
put hooks in there to do your specific JNDI clean-up when the JMSServerManager 
unbinds the JMS admin objects?

> After failback backup prints warnings to log
> --------------------------------------------
>
>                 Key: ARTEMIS-160
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-160
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 1.0.0
>            Reporter: Jeff Mesnil
>            Assignee: Justin Bertram
>             Fix For: 1.2.0
>
>
> We integrate Artemis in our app server.
> When the artemis server is stopped, we want to unregister any JNDI bindings 
> for the JMS resources.
> For failback, the only way to detect that the artemis server is stopped is to 
> use the ActivateCallback callback on Artemis *core* server. There is no way 
> to be notified when the JMS server (wrapping the core server) is stopped.
> This leads to a window where we remove JNDI bindings from the JMS server 
> before it is deactivated but the actual operations is performed after it was 
> deactivated and the server prints WARNING logs:
> {noformat}
> 15:34:59,123 WARN [org.wildfly.extension.messaging-activemq] (ServerService 
> Thread Pool – 4) WFLYMSGAMQ0004: Failed to destroy queue: ExpiryQueue: 
> java.lang.IllegalStateException: Cannot access JMS Server, core server is not 
> yet active
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.checkInitialised(JMSServerManagerImpl.java:1640)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.access$1100(JMSServerManagerImpl.java:101)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl$3.runException(JMSServerManagerImpl.java:752)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.runAfterActive(JMSServerManagerImpl.java:1847)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.removeQueueFromBindingRegistry(JMSServerManagerImpl.java:741)
> at 
> org.wildfly.extension.messaging.activemq.jms.JMSQueueService$2.run(JMSQueueService.java:101)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.jboss.threads.JBossThread.run(JBossThread.java:320)
> 15:34:59,123 WARN [org.wildfly.extension.messaging-activemq] (ServerService 
> Thread Pool – 68) WFLYMSGAMQ0004: Failed to destroy queue: AsyncQueue: 
> java.lang.IllegalStateException: Cannot access JMS Server, core server is not 
> yet active
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.checkInitialised(JMSServerManagerImpl.java:1640)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.access$1100(JMSServerManagerImpl.java:101)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl$3.runException(JMSServerManagerImpl.java:752)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.runAfterActive(JMSServerManagerImpl.java:1847)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.removeQueueFromBindingRegistry(JMSServerManagerImpl.java:741)
> at 
> org.wildfly.extension.messaging.activemq.jms.JMSQueueService$2.run(JMSQueueService.java:101)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.jboss.threads.JBossThread.run(JBossThread.java:320)
> 15:34:59,123 WARN [org.wildfly.extension.messaging-activemq] (ServerService 
> Thread Pool – 9) WFLYMSGAMQ0004: Failed to destroy queue: DLQ: 
> java.lang.IllegalStateException: Cannot access JMS Server, core server is not 
> yet active
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.checkInitialised(JMSServerManagerImpl.java:1640)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.access$1100(JMSServerManagerImpl.java:101)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl$3.runException(JMSServerManagerImpl.java:752)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.runAfterActive(JMSServerManagerImpl.java:1847)
> at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.removeQueueFromBindingRegistry(JMSServerManagerImpl.java:741)
> at 
> org.wildfly.extension.messaging.activemq.jms.JMSQueueService$2.run(JMSQueueService.java:101)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> at org.jboss.threads.JBossThread.run(JBossThread.java:320)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to