java - Tomcat 6 Virtual Hosting Same Spring Application -


I have the same tomacat 6 instance on two different virtual hosts the same. However, I'm running into a problem with Spring Framework and I'm registering a bean. Here is an error that I am seeing ...

org.springframework.jmx.export.UnableToRegisterMBeanException: MBean with key 'mam [com.dti.servlets.Configuration@3a1834] to register Unable to: name = webConfig '; The nested exception is javax.management.InstanceAlreadyExistsException: EAM: name = webConfig

I'm pretty sure that I need to define my references for each virtual host but I have no luck. I have found that only the name of the Fix Bean Key is changed. Any other suggestions would be great.

The problem is that the name of the bean should be unique to the JVM. Since you are deploying the same war , you have two solutions:

  1. Change the registration behavior of Spring Jmx exporter (see)
  2. To dynamically change the name of beans on startup, define your own objectname strategy (like app1.mybeans and app2.mybeans Em>)

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -