java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendExpandedReplacement(java.base@9-ea/Matcher.java:1068) at java.util.regex.Matcher.appendReplacement(java.base@9-ea/Matcher.java:998) at java.util.regex.Matcher.replaceAll(java.base@9-ea/Matcher.java:1181) at java.lang.String.replaceAll(java.base@9-ea/String.java:2162)

JDK Bug System | Webbug Group | 4 months ago
  1. 0

    FULL PRODUCT VERSION : java version "1.8.0_73" Java(TM) SE Runtime Environment (build 1.8.0_73-b02) Java HotSpot(TM) Client VM (build 25.73-b02, mixed mode, sharing) ADDITIONAL OS VERSION INFORMATION : Windows 10 EXTRA RELEVANT SYSTEM CONFIGURATION : In Matcher.java line 854 is written: // The first number is always a group refNum = (int)nextChar - '0'; if ((refNum < 0)||(refNum > 9)) throw new IllegalArgumentException( "Illegal group reference"); That the first character after $ is always a number is not correct. A DESCRIPTION OF THE PROBLEM : That the first character after $ is always a number is not correct. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : public static void main(String[] args) { final String k = "1234"; System.out.println(k.replaceAll("23", "$&")); } ACTUAL - Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:857) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2210) at overlay.StartupTest.main(StartupTest.java:52) ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java:857) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2210) at overlay.StartupTest.main(StartupTest.java:52) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public static void main(String[] args) { final String k = "1234"; System.out.println(k.replaceAll("23", "$&")); } ---------- END SOURCE ----------

    JDK Bug System | 4 months ago | Webbug Group
    java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendExpandedReplacement(java.base@9-ea/Matcher.java:1068) at java.util.regex.Matcher.appendReplacement(java.base@9-ea/Matcher.java:998) at java.util.regex.Matcher.replaceAll(java.base@9-ea/Matcher.java:1181) at java.lang.String.replaceAll(java.base@9-ea/String.java:2162)
  2. 0

    MC Jobs - Bukkit

    bukkit.org | 3 months ago
    java.lang.IllegalArgumentException: Illegal group reference: group index is missing 9:36:57 PM at java.util.regex.Matcher.appendReplacement(Matcher.java:819) 9:36:57 PM at java.util.regex.Matcher.replaceAll(Matcher.java:955)
  3. 0

    Installation problem-MySQL 4.0, Tomcat 5.0.18

    infoglue | 1 decade ago | nobody
    java.lang.IllegalArgumentException: Illegal group reference at java.util.regex.Matcher.appendReplacement(Matcher.java(Compiled Code)) at java.util.regex.Matcher.replaceAll(Matcher.java(Compiled Code)) at java.lang.String.replaceAll(String.java(Inlined Compiled Code)) at org.infoglue.cmsinstaller.ConfigurationFileCommander.createCMSPropertyFile(ConfigurationFileCommander.java(Compiled Code))
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Regex with special received signs and replaceAll() throwns errors

    Stack Overflow | 3 years ago | Marin Sagovac
    java.lang.IllegalArgumentException: Illegal group reference</p> <pre><code>at java.util.regex.Matcher.appendReplacement(Matcher.java:808)
  6. 0

    This has been observed in jigsaw nightly runs. Two tests fail: javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java Please refer to test output below: ----------messages:(5/486)---------- command: main -Djava.naming.provider.url=iiop://localhost:5050 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory RmiIiopReturnValueTest -port 5049 reason: User specified action: run main/othervm -Djava.naming.provider.url=iiop://localhost:5050 -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory RmiIiopReturnValueTest -port 5049 Mode: othervm [/othervm specified] Additional options from @modules: --add-modules java.corba elapsed time (seconds): 24.494 ----------configuration:(3/38)---------- Boot Layer add modules: java.corba ----------System.out:(22/1586)---------- Starting orbd with NS port 5050 and activation port 5049 RmiIiopReturnValueTest: Executing: [/Users/aurora/CommonData/jdk/bin/orbd, -J-d64, -ORBInitialHost, localhost, -ORBInitialPort, 5050, -port, 5049] Starting RmiIiopServer RmiIiopReturnValueTest: Executing: [/Users/aurora/CommonData/jdk/bin/java, --add-modules, java.corba, -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory, -Djava.naming.provider.url=iiop://localhost:5050, -cp, /Users/aurora/sandbox/gresults/testoutput/jdk_other/JTwork/classes/javax/rmi/PortableRemoteObject/8146975:/Users/aurora/sandbox/testbase/jdk/test/javax/rmi/PortableRemoteObject/8146975:/Users/aurora/sandbox/gresults/testoutput/jdk_other/JTwork/classes/lib/testlibrary:/Users/aurora/sandbox/testbase/jdk/test/lib/testlibrary:/Users/aurora/CommonData/jtreg/lib/javatest.jar:/Users/aurora/CommonData/jtreg/lib/jtreg.jar, HelloServer, -port, 5049] RmiIiopReturnValueTest.executeRmiIiopClient: HelloClient.executeRmiClientCall HelloClient.main: enter ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... HelloClient.main: HelloService lookup ... RmiIiopReturnValueTest.stopRmiIiopServer: destroy rmiServerProcess serverProcess exitCode:9 RmiIiopReturnValueTest.stopOrbd: destroy orbdProcess orbd exitCode:9 ----------System.err:(85/5723)---------- java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425) at HelloServer.main(HelloServer.java:42) NameNotFoundException Caught .... try again NameNotFoundException Caught .... try again NameNotFoundException Caught .... try again NameNotFoundException Caught .... try again NameNotFoundException Caught .... try again HelloClient terminating java.lang.RuntimeException: Expected Response not received at RmiIiopReturnValueTest.stopTestComponents(RmiIiopReturnValueTest.java:85) at RmiIiopReturnValueTest.main(RmiIiopReturnValueTest.java:67) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:537) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110) at java.base/java.lang.Thread.run(Thread.java:844)

    JDK Bug System | 4 weeks ago | Felix Yang
    java.lang.IllegalArgumentException: Only instances of org.omg.CORBA.Object can be bound at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.callBindOrRebind(CNCtx.java:602) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:693) at java.corba@9-ea/com.sun.jndi.cosnaming.CNCtx.rebind(CNCtx.java:710) at java.naming/javax.naming.InitialContext.rebind(InitialContext.java:425)

    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

      Illegal group reference at java.util.regex.Matcher.appendExpandedReplacement(java.base@9-ea/Matcher.java:1068) at java.util.regex.Matcher.appendReplacement(java.base@9-ea/Matcher.java:998) at java.util.regex.Matcher.replaceAll(java.base@9-ea/Matcher.java:1181) at java.lang.String.replaceAll(java.base@9-ea/String.java:2162)

      at JI9042279.main()
    2. Unknown
      JI9042279.main
      1. JI9042279.main(JI9042279.java:6)
      1 frame