java.lang.IllegalStateException: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf

JIRA | Paul Jack | 9 years ago
  1. 0

    Example stack trace below. This is minor; the logs will get spammed but that's the only unfortunate side-effect. The fix is to prevent moduleListeners from getting events when a specified module already exists. (Also, JMXSheetManager should be proactive about not reporting this exception.) WARNING: ModuleListener raised exception. java.lang.IllegalStateException: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf at org.archive.settings.jmx.JMXModuleListener.moduleChanged(JMXModuleListener.java:142) at org.archive.settings.SheetManager.fireModuleChanged(SheetManager.java:323) at org.archive.settings.SettingsList.set(SettingsList.java:241) at org.archive.settings.path.PathChanger.finish(PathChanger.java:355) at org.archive.settings.path.PathChanger.changeLoudly(PathChanger.java:146) at org.archive.settings.path.PathChanger.change(PathChanger.java:102) at org.archive.settings.jmx.JMXSheetManagerImpl.setMany(JMXSheetManagerImpl.java:186) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.archive.openmbeans.annotations.Bean.invoke(Bean.java:231) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at org.archive.openmbeans.annotations.BeanProxy.invoke(BeanProxy.java:87) at $Proxy10.setMany(Unknown Source) at org.archive.crawler.webui.Sheets.saveSingleSheet(Sheets.java:336) at org.apache.jsp.sheets.do_005fsave_005fsingle_005fsheet_jsp._jspService(do_005fsave_005fsingle_005fsheet_jsp.java:45) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453) at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141) at org.mortbay.jetty.Server.handle(Server.java:303) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) Caused by: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf at com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.java:452) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1410) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:936) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:337) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497) at org.archive.settings.jmx.JMXModuleListener.moduleChanged(JMXModuleListener.java:140)

    JIRA | 9 years ago | Paul Jack
    java.lang.IllegalStateException: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf
  2. 0

    Example stack trace below. This is minor; the logs will get spammed but that's the only unfortunate side-effect. The fix is to prevent moduleListeners from getting events when a specified module already exists. (Also, JMXSheetManager should be proactive about not reporting this exception.) WARNING: ModuleListener raised exception. java.lang.IllegalStateException: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf at org.archive.settings.jmx.JMXModuleListener.moduleChanged(JMXModuleListener.java:142) at org.archive.settings.SheetManager.fireModuleChanged(SheetManager.java:323) at org.archive.settings.SettingsList.set(SettingsList.java:241) at org.archive.settings.path.PathChanger.finish(PathChanger.java:355) at org.archive.settings.path.PathChanger.changeLoudly(PathChanger.java:146) at org.archive.settings.path.PathChanger.change(PathChanger.java:102) at org.archive.settings.jmx.JMXSheetManagerImpl.setMany(JMXSheetManagerImpl.java:186) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.archive.openmbeans.annotations.Bean.invoke(Bean.java:231) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784) at org.archive.openmbeans.annotations.BeanProxy.invoke(BeanProxy.java:87) at $Proxy10.setMany(Unknown Source) at org.archive.crawler.webui.Sheets.saveSingleSheet(Sheets.java:336) at org.apache.jsp.sheets.do_005fsave_005fsingle_005fsheet_jsp._jspService(do_005fsave_005fsingle_005fsheet_jsp.java:45) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453) at org.mortbay.jetty.handler.HandlerList.handle(HandlerList.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141) at org.mortbay.jetty.Server.handle(Server.java:303) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:735) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:636) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475) Caused by: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf at com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.java:452) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1410) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:936) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:337) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497) at org.archive.settings.jmx.JMXModuleListener.moduleChanged(JMXModuleListener.java:140)

    JIRA | 9 years ago | Paul Jack
    java.lang.IllegalStateException: javax.management.InstanceAlreadyExistsException: org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    QuickFIX/J Jira

    quickfixj.org | 3 months ago
    javax.management.InstanceAlreadyExistsException: org.quickfixj:type=Connector,role=Initiator
  5. 0

    Hello, the current implementation of ConnectorJMXExporter.java does only work if you dont use a second connector. The name "type=Connector,role=Initiator" is to generic because the second connector has allways the same name, the error would look like the following: 22.05.2007 17:49:24 org.quickfixj.jmx.mbean.connector.ConnectorJmxExporter export SCHWERWIEGEND: Failed to export connector MBean javax.management.InstanceAlreadyExistsException: org.quickfixj:type=Connector,role=Initiator at com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.java:452) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1410) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:936) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:337) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497) at org.quickfixj.jmx.mbean.connector.ConnectorJmxExporter.export(ConnectorJmxExporter.java:56) at org.quickfixj.jmx.JmxExporter.export(JmxExporter.java:60) My approach was to add the name of the configFile in the JMXExporter.export() function, this is probably to simple in case that the configfiles are not in the same directory. Must be a better way. **** public void export(MBeanServer mbeanServer, SessionConnector connector, String configFileName) { try { ConnectorAdmin connectorAdmin; if (connector instanceof AbstractSocketAcceptor) { connectorAdmin = new SocketAcceptorAdmin((AbstractSocketAcceptor) connector, sessionExporter); } else if (connector instanceof AbstractSocketInitiator) { connectorAdmin = new SocketInitiatorAdmin((AbstractSocketInitiator) connector, sessionExporter); } else { throw new QFJException("Unknown connector type: " + connector.getClass().getName()); } //changed: ObjectName connectorName = getConnectorName(connector); ObjectName connectorName = getConnectorName(connector, configFileName); mbeanServer.registerMBean(connectorAdmin, connectorName); ArrayList sessionIDs = connector.getSessions(); for (int i = 0; i < sessionIDs.size(); i++) { SessionID sessionID = (SessionID) sessionIDs.get(i); sessionExporter.export(mbeanServer, Session.lookupSession(sessionID), connectorName, connector.getSettings()); } } catch (Exception e) { log.error("Failed to export connector MBean", e); } } //private ObjectName getConnectorName(SessionConnector connector) private ObjectName getConnectorName(SessionConnector connector, String configFileName) throws MalformedObjectNameException { ObjectNameFactory nameFactory = new ObjectNameFactory(); nameFactory.addProperty("type", "Connector"); nameFactory.addProperty("role", connector instanceof Acceptor ? "Acceptor" : "Initiator"); //changed nameFactory.addProperty("configFileName", configFileName); return nameFactory.createName(); } *** The jmx export im my code looks like jmxExporter = new JmxExporter(ManagementFactory.getPlatformMBeanServer()); jmxExporter.export(acceptor, this.getConfigFile()); instead of jmxExporter = new JmxExporter(ManagementFactory.getPlatformMBeanServer()); jmxExporter.export(acceptor); I checked with jconsole, works. Regards Thomas Hügel

    QuickFIX/J JIRA | 10 years ago | Thomas Hügel
    javax.management.InstanceAlreadyExistsException: org.quickfixj:type=Connector,role=Initiator

  1. batwalrus76 2 times, last 1 week ago
  2. Handemelindo 1 times, last 2 weeks ago
  3. kjhdofjosvs 2 times, last 3 weeks ago
  4. tvrmsmith 2 times, last 1 month ago
  5. davidvanlaatum 54 times, last 2 months ago
3 more registered users
21 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.management.InstanceAlreadyExistsException

    org.archive.crawler:instance=14660542,jmxport=-1,name=basic-20070803171650,type=org.archive.crawler.framework.StatisticsTracking,host=badwolf

    at com.sun.jmx.mbeanserver.RepositorySupport.addMBean()
  2. Java RT
    JmxMBeanServer.registerMBean
    1. com.sun.jmx.mbeanserver.RepositorySupport.addMBean(RepositorySupport.java:452)
    2. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1410)
    3. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:936)
    4. com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:337)
    5. com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:497)
    5 frames
  3. org.archive.settings
    JMXModuleListener.moduleChanged
    1. org.archive.settings.jmx.JMXModuleListener.moduleChanged(JMXModuleListener.java:140)
    1 frame