Confluence doesn't start with JMX error
Asked by Licensing User:

Confluence is failing with following error:

```
2020-05-08 09:10:31,371 ERROR [localhost-startStop-1] [ContainerBase.[Standalone].[localhost].[/]] log Exception starting filter [jmx]javax.management.RuntimeOperationsException	at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:413)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)	at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)	at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:195)	at org.springframework.jmx.export.MBeanExporter.registerManagedResource(MBeanExporter.java:486)	at com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl.registerManagedResource(MBeanExporterWithUnregisterImpl.java:125)	at com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl.safeRegisterManagedResource(MBeanExporterWithUnregisterImpl.java:116)	at com.atlassian.confluence.jmx.JmxFilter.safeRegisterObject(JmxFilter.java:132)	at com.atlassian.confluence.jmx.JmxFilter.doMailServer(JmxFilter.java:79)	at com.atlassian.confluence.jmx.JmxFilter.registerBeans(JmxFilter.java:63)	at com.atlassian.confluence.jmx.JmxFilter.init(JmxFilter.java:45)	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251)	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4491)	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)	at java.util.concurrent.FutureTask.run(FutureTask.java:266)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)	at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for pattern name Confluence:name=MailServer-Proxy?
```

Using steps descrbes in <https://confluence.atlassian.com/confkb/unable-to-start-confluence-due-to-jmx-182158269.html> doesn't work - it fails with:

2020-05-11 11:51:39,031 ERROR \[localhost-startStop-1\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Context initialization failed  
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exporter' defined in class path resource \[jmxContext.xml\]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'enabled' of bean class \[com.atlassian.confluence.jmx.MBeanExporterWithUnregisterImpl\]: Bean property 'enabled' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

But when I use jmxContext.xml from source code of mine version confluence it gives initial error:

```
Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for pattern name Confluence:name=MailServer-Proxy?
```


Answers:
author: Diego
body: Hello [@Licensing User](/t5/user/viewprofilepage/user-id/1816859) !

As I understand, your Confluence Instance is not starting and a few errors are present in your log.

Looking at the error itself:

```
Caused by: java.lang.IllegalArgumentException: Repository: cannot add mbean for pattern name Confluence:name=MailServer-Proxy?
```

I am inclined to believe that there might ++*something wrong with your mail server configuration.*++

I recommend that you start by looking into your jmxContext.xml file and check that everything is correctly typed there. Be sure to use a Plain text editor.

Also, when following the workaround from here:
> * ++***[\[Confluence Server\] Unable to Start Confluence Due to JMX](https://confluence.atlassian.com/confkb/unable-to-start-confluence-due-to-jmx-182158269.html)***++

Be sure to:
> 1. *Back up your jmxContext.xml file*
> 2. *Shutdown Confluence completely*
> 3. *Be sure to place the file under \<confluence-install\>/confluence/WEB-INF/classes*
> 4. *Restart Tomcat*

I also have a few questions about your instance! Here we go:
> 1. *Was this instance working at some point in the past?*
> 2. *Was there any change applied to the instance?*
> 3. *Is there any other Atlassian application running on the same server?*

Looking forward to your reply.