You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Dan Nawrocki (JIRA)" <ji...@apache.org> on 2010/07/07 19:16:51 UTC

[jira] Created: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
--------------------------------------------------------------------------

                 Key: AMQ-2813
                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.3.1
            Reporter: Dan Nawrocki
            Priority: Minor


- XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
- BrokerService#start() method has the @PostConstruct annotation as well
- There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
- Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag

According to Gary Tully:

That looks like a bug that was introduced in
http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
the start method does invalidate the
XBeanBrokerService#afterPropertiesSet()  smarts. 

As discussed in:

http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dan Nawrocki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Nawrocki reopened AMQ-2813:
-------------------------------


Still doesn't work as of AMQ 5.4.0.

Let me explain what I'm trying to do:
1) Shared file system master-slave using nfsv4
2) Broker instantiated by Spring

The 1st AS will come up OK, but the 2nd (3rd, 4th, etc) AS will block indefinitely at org.apache.activemq.store.kahadb.MessageDatabase.lock(MessageDatabase.java:329).  Spring is calling the @PostConstruct method on BrokerService, which doesn't (cannot) check the XBeanBrokerService's 'start' flag.

Removal of the @PostConstruct annotation on BrokerService#start fixed the issue for 5.3.2, I haven't verified on 5.4.0.

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.0
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61614#action_61614 ] 

Dejan Bosanac commented on AMQ-2813:
------------------------------------

So should we resolve this issue again?

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.0
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-2813.
--------------------------------

         Assignee: Dejan Bosanac
    Fix Version/s: 5.4.0
       Resolution: Working as Designed

It seems that this works fine on the trunk. I just committed two tests that shows it works properly for both plain Spring and XBean.

If you still see the problem, please reopen it and attach the test case.

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.0
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dan Nawrocki (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Nawrocki updated AMQ-2813:
------------------------------

    Attachment: broker_startup_fix.patch

Attached is a patch (generated with svn diff) that fixes it for my use case.  I don't think it will have any unintended consequences for users instantiating a BrokerService and not using the XBeanBrokerService.  If this makes it into 5.4.1 I'd be happy to close this issue.

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.0
>
>         Attachments: broker_startup_fix.patch
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dan Nawrocki (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61597#action_61597 ] 

Dan Nawrocki commented on AMQ-2813:
-----------------------------------

I can confirm that removing the @PostConstruct annotation work w/ 5.4.0 as well.

I should also mention that the reason I am having so much trouble with this is because I am running my webapp under JBoss.  When JBoss attempts to deploy my EAR file, the "main" thread ends up calling BrokerService#start.  Because the "main" thread is not blocked indefinitely, JBoss is left in an inconsistent state and will never serve ANY http requests, and will not respond to a kill command.  I have to kill -9 the java process to get it to terminate.

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.0
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (AMQ-2813) BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false

Posted by "Dejan Bosanac (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dejan Bosanac resolved AMQ-2813.
--------------------------------

    Fix Version/s: 5.4.1
                       (was: 5.4.0)
       Resolution: Fixed

Patch applied with svn revision 992984. Thanks Dan.

The problem this missed in our tests was, because XBean+Spring combination doesn't call @PostConstruct on parent objects as it is done in EJB environment you're using.

> BrokerService @PostConstruct invalidates XBeanBrokerService w/ start=false
> --------------------------------------------------------------------------
>
>                 Key: AMQ-2813
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2813
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.1
>            Reporter: Dan Nawrocki
>            Assignee: Dejan Bosanac
>            Priority: Minor
>             Fix For: 5.4.1
>
>         Attachments: broker_startup_fix.patch
>
>
> - XBeanBrokerService#afterPropertiesSet() method checks the start flag and is annotated as @PostConstruct so it's called at startup
> - BrokerService#start() method has the @PostConstruct annotation as well
> - There is no way for the BrokerService class to check the 'start' flag in the XBeanBrokerService subclass.
> - Spring will call BOTH @PostConstruct methods resulting in the broker being started regardless of the xbean start flag
> According to Gary Tully:
> That looks like a bug that was introduced in
> http://svn.apache.org/viewvc?rev=908182&view=rev the postConstruct on
> the start method does invalidate the
> XBeanBrokerService#afterPropertiesSet()  smarts. 
> As discussed in:
> http://old.nabble.com/XBean-%27start%3Dfalse%27-not-working--td29086727.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.