java.lang.Exception: Unexpected exception, expected<org.springframework.beans.factory.parsing.BeanDefinitionParsingException> but was<java.lang.IllegalArgumentException>

Spring JIRA | John Blum | 1 year ago
  1. 0

    Some _Spring Data GemFire_ test classes (e.g. [TemplateRegionDefinitionOrderErrorNamespaceTest|https://github.com/jxblum/spring-data-gemfire/blob/master/src/test/java/org/springframework/data/gemfire/config/TemplateRegionDefinitionOrderErrorNamespaceTest.java]) try to [resolve the Spring test context configuration file|https://github.com/jxblum/spring-data-gemfire/blob/master/src/test/java/org/springframework/data/gemfire/config/TemplateRegionDefinitionOrderErrorNamespaceTest.java#L42-L44] using the preferred method of basing configuration file name on the test class name, similar to how the Spring test {{@ContextConfiguration}} annotation works. The resolution logic is flawed in that the "replacement" parameter is incorrectly interpreted on the Windows platform {{string.replaceAll(regex, replacement)}}. In addition, {{File.separator}} is inappropriate for ({{CLASSPATH}}) resource resolution anyway. The test context configuration file resolution will be changed to {{string.replace(".", "/")}}, so {{replace(..)}} instead of {{replaceAll(..)}} with the non-regex, explicit {{CharSequence}} "target" and the {{CharSequence}} "replacement". Note, currently the resolution logic using {{replaceAll(..)}} is causing the following issue on Windows... {code:xml} org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest testIncorrectTemplateRegionDefinitionOrder java.lang.Exception: Unexpected exception, expected<org.springframework.beans.factory.parsing.BeanDefinitionParsingException> but was<java.lang.IllegalArgumentException> at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2211) at org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.getConfigLocation(TemplateRegionDefinitionOrderErrorNamespaceTest.java:43) at org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.testIncorrectTemplateRegionDefinitionOrder(TemplateRegionDefinitionOrderErrorNamespaceTest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19) ... 34 more {code}

    Spring JIRA | 1 year ago | John Blum
    java.lang.Exception: Unexpected exception, expected<org.springframework.beans.factory.parsing.BeanDefinitionParsingException> but was<java.lang.IllegalArgumentException>
  2. 0

    Some _Spring Data GemFire_ test classes (e.g. [TemplateRegionDefinitionOrderErrorNamespaceTest|https://github.com/jxblum/spring-data-gemfire/blob/master/src/test/java/org/springframework/data/gemfire/config/TemplateRegionDefinitionOrderErrorNamespaceTest.java]) try to [resolve the Spring test context configuration file|https://github.com/jxblum/spring-data-gemfire/blob/master/src/test/java/org/springframework/data/gemfire/config/TemplateRegionDefinitionOrderErrorNamespaceTest.java#L42-L44] using the preferred method of basing configuration file name on the test class name, similar to how the Spring test {{@ContextConfiguration}} annotation works. The resolution logic is flawed in that the "replacement" parameter is incorrectly interpreted on the Windows platform {{string.replaceAll(regex, replacement)}}. In addition, {{File.separator}} is inappropriate for ({{CLASSPATH}}) resource resolution anyway. The test context configuration file resolution will be changed to {{string.replace(".", "/")}}, so {{replace(..)}} instead of {{replaceAll(..)}} with the non-regex, explicit {{CharSequence}} "target" and the {{CharSequence}} "replacement". Note, currently the resolution logic using {{replaceAll(..)}} is causing the following issue on Windows... {code:xml} org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest testIncorrectTemplateRegionDefinitionOrder java.lang.Exception: Unexpected exception, expected<org.springframework.beans.factory.parsing.BeanDefinitionParsingException> but was<java.lang.IllegalArgumentException> at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:28) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2211) at org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.getConfigLocation(TemplateRegionDefinitionOrderErrorNamespaceTest.java:43) at org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.testIncorrectTemplateRegionDefinitionOrder(TemplateRegionDefinitionOrderErrorNamespaceTest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19) ... 34 more {code}

    Spring JIRA | 1 year ago | John Blum
    java.lang.Exception: Unexpected exception, expected<org.springframework.beans.factory.parsing.BeanDefinitionParsingException> but was<java.lang.IllegalArgumentException>
  3. 0

    OptionsParserTest test fails on Windows

    GitHub | 2 years ago | eis
    java.lang.IllegalArgumentException: character to be escaped is missing
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [develop_2.0] String index out of exception in android-java template

    GitHub | 2 years ago | cantecim
    java.lang.IllegalArgumentException: character to be escaped is missing
  6. 0

    Error "character to be escaped is missing" when downloading

    GitHub | 2 years ago | peter-vb
    java.lang.IllegalArgumentException: character to be escaped is missing

  1. treanz 1 times, last 5 months ago
  2. Larten 2 times, last 9 months ago
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.IllegalArgumentException

    character to be escaped is missing

    at java.util.regex.Matcher.appendReplacement()
  2. Java RT
    String.replaceAll
    1. java.util.regex.Matcher.appendReplacement(Matcher.java:809)
    2. java.util.regex.Matcher.replaceAll(Matcher.java:955)
    3. java.lang.String.replaceAll(String.java:2211)
    3 frames
  3. Spring Data GemFire
    TemplateRegionDefinitionOrderErrorNamespaceTest.testIncorrectTemplateRegionDefinitionOrder
    1. org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.getConfigLocation(TemplateRegionDefinitionOrderErrorNamespaceTest.java:43)
    2. org.springframework.data.gemfire.config.TemplateRegionDefinitionOrderErrorNamespaceTest.testIncorrectTemplateRegionDefinitionOrder(TemplateRegionDefinitionOrderErrorNamespaceTest.java:49)
    2 frames
  4. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  5. JUnit
    ParentRunner.run
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    5. org.junit.internal.runners.statements.ExpectException.evaluate(ExpectException.java:19)
    6. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    9. org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    10. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    11. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    12. org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    13. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    14. org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    14 frames
  6. org.gradle.api
    SuiteTestClassProcessor.processTestClass
    1. org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
    2. org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
    3. org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
    4. org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48)
    4 frames
  7. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  8. Gradle Core
    ProxyDispatchAdapter$DispatchingInvocationHandler.invoke
    1. org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    2. org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    3. org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
    4. org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    4 frames
  9. com.sun.proxy
    $Proxy2.processTestClass
    1. com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
    1 frame
  10. org.gradle.api
    TestWorker.processTestClass
    1. org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105)
    1 frame
  11. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:497)
    4 frames
  12. Gradle Core
    ReflectionDispatch.dispatch
    1. org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    2. org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    2 frames
  13. org.gradle.messaging
    MessageHub$Handler.run
    1. org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
    1 frame
  14. Gradle Core
    DefaultExecutorFactory$StoppableExecutorImpl$1.run
    1. org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
    1 frame
  15. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    3. java.lang.Thread.run(Thread.java:745)
    3 frames