Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMX MBean name collides when deploying multiple JRuby web apps to a single application server #2582

Closed
rinfield opened this issue Feb 9, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@rinfield
Copy link

rinfield commented Feb 9, 2015

JRuby 1.7.11 (or higher)

application server logs:

2015-02-09T14:51:03.278+09:00: BeanManagerImpl: mbean already registered: org.jruby:type=Runtime,name=0,service=JITCompiler
2015-02-09T14:51:03.403+09:00: BeanManagerImpl: mbean already registered: org.jruby:type=Runtime,name=0,service=Config
2015-02-09T14:51:03.403+09:00: BeanManagerImpl: mbean already registered: org.jruby:type=Runtime,name=0,service=ParserStats
2015-02-09T14:51:03.403+09:00: BeanManagerImpl: mbean already registered: org.jruby:type=Runtime,name=0,service=ClassCache
2015-02-09T14:51:03.403+09:00: BeanManagerImpl: mbean already registered: org.jruby:type=Runtime,name=0,service=Runtime

Looks like this commit introduced the issue.
9c47b17#diff-eb913b4a9663a63aca680e3254c66e7dR27

@rinfield rinfield changed the title JMX MBean collides when deploying multiple JRuby web apps to a single application server JMX MBean name collides when deploying multiple JRuby web apps to a single application server Feb 9, 2015
@enebo enebo added this to the JRuby 1.7.20 milestone Feb 9, 2015
@enebo
Copy link
Member

enebo commented Feb 9, 2015

yeah we should only do this once. A warning is not serious but this looks simple to correct so marking for 1.7.20.

@headius
Copy link
Member

headius commented Mar 12, 2015

This is very strange; all runtimes should get a monotonically-increasing "runtime number" and never conflict with each other. Can you give us more information about the environment where this happened?

@headius
Copy link
Member

headius commented Mar 12, 2015

Oops, I know what's wrong. If you deploy JRuby into different classloaders, each one will get its own monotonically-increasing number :-(

We'd like to be able to number them globally unique, but that may not be possible. Pulling in @bbrowning for ideas.

@rinfield
Copy link
Author

I just deployed two (or more) JRuby webapps to a Tomcat. Yeah, those webapps will be loaded to different classloaders and looks like have its own counters.

@mkristian
Copy link
Member

my two cents: @headius can't you just add the Classloader#hash to the "number"

@mkristian mkristian self-assigned this Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants