com.cat.tcm.jmx.ManagementException: An unexpected error occurred performing the operation.

Spring JIRA | Arjen Poutsma | 6 years ago
  1. 0

    When sending a large file with the RestTemplate (with a POST or PUT), the RestTemplate will throw an OutOfMemoryError: {noformat} com.cat.tcm.jmx.ManagementException: An unexpected error occurred performing the operation. at com.cat.tcm.jmx.JMXTaskTemplate.run(JMXTaskTemplate.java:144) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2786) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94) at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:113) at org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:85) at org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:1) at org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:288) at org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:252) at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:242) at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:194) at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:1) at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:588) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:436) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401) at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:279) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy17.postForObject(Unknown Source) {noformat}

    Spring JIRA | 6 years ago | Arjen Poutsma
    com.cat.tcm.jmx.ManagementException: An unexpected error occurred performing the operation.
  2. 0

    When sending a large file with the RestTemplate (with a POST or PUT), the RestTemplate will throw an OutOfMemoryError: {noformat} com.cat.tcm.jmx.ManagementException: An unexpected error occurred performing the operation. at com.cat.tcm.jmx.JMXTaskTemplate.run(JMXTaskTemplate.java:144) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2786) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94) at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:113) at org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:85) at org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:1) at org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:288) at org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:252) at org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:242) at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:194) at org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:1) at org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:588) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:436) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401) at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:279) 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:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy17.postForObject(Unknown Source) {noformat}

    Spring JIRA | 6 years ago | Arjen Poutsma
    com.cat.tcm.jmx.ManagementException: An unexpected error occurred performing the operation.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Huge amount of data to insert from an SQL file

    GitHub | 3 years ago | flyway
    java.lang.OutOfMemoryError: Java heap space
  5. 0

    OutOfMemory exception even after increasing the memory (Maven)

    Stack Overflow | 3 years ago | Jay
    java.lang.OutOfMemoryError: Java heap space

    8 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. java.lang.OutOfMemoryError

      Java heap space

      at java.util.Arrays.copyOf()
    2. Java RT
      ByteArrayOutputStream.write
      1. java.util.Arrays.copyOf(Arrays.java:2786)
      2. java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
      2 frames
    3. Spring Core
      FileCopyUtils.copy
      1. org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:113)
      1 frame
    4. Spring
      RestTemplate.postForObject
      1. org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:85)
      2. org.springframework.http.converter.ResourceHttpMessageConverter.write(ResourceHttpMessageConverter.java:1)
      3. org.springframework.http.converter.FormHttpMessageConverter.writePart(FormHttpMessageConverter.java:288)
      4. org.springframework.http.converter.FormHttpMessageConverter.writeParts(FormHttpMessageConverter.java:252)
      5. org.springframework.http.converter.FormHttpMessageConverter.writeMultipart(FormHttpMessageConverter.java:242)
      6. org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:194)
      7. org.springframework.http.converter.FormHttpMessageConverter.write(FormHttpMessageConverter.java:1)
      8. org.springframework.web.client.RestTemplate$HttpEntityRequestCallback.doWithRequest(RestTemplate.java:588)
      9. org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:436)
      10. org.springframework.web.client.RestTemplate.execute(RestTemplate.java:401)
      11. org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:279)
      11 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    6. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
      4. org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      5. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      6. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      6 frames
    7. Unknown
      $Proxy17.postForObject
      1. $Proxy17.postForObject(Unknown Source)
      1 frame