java.lang.IllegalArgumentException: Cannot subclass final class java.lang.String

Stack Overflow | checketts | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    Cannot subclass final class java.lang.String

    at org.springframework.cglib.proxy.Enhancer.generateClass()
  2. Spring Core
    AbstractClassGenerator$ClassLoaderData$3.apply
    1. org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:565)
    2. org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
    3. org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:329)
    4. org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:492)
    5. org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:93)
    6. org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:91)
    6 frames
  3. org.springframework.cglib
    LoadingCache$2.call
    1. org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
    1 frame
  4. Java RT
    FutureTask.run
    1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    1 frame
  5. org.springframework.cglib
    LoadingCache.get
    1. org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
    2. org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
    2 frames
  6. Spring Core
    Enhancer.createClass
    1. org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:116)
    2. org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:291)
    3. org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:480)
    4. org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:337)
    4 frames
  7. Spring MVC
    MvcUriComponentsBuilder$ControllerMethodInvocationInterceptor.intercept
    1. org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder.initProxy(MvcUriComponentsBuilder.java:611)
    2. org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder.access$000(MvcUriComponentsBuilder.java:89)
    3. org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder$ControllerMethodInvocationInterceptor.intercept(MvcUriComponentsBuilder.java:725)
    3 frames