Caused by: java.util.regex.PatternSyntaxException: Illegal repetition

user3011731

I m trying to get search query and passing parameters in search query(its cypher query with like operator) and passing the dynamic parameter but i m getting eror. Is it neo4j problem of Regex problem.

    Map<String, Object> map = new HashMap<String, Object>();
            map.put(parameter, groupIdAfterSubstituet(collabVo));//
            map.put("{display_name}",input);//input="S"
    Result<Map<String, Object>> result = neoOperation.query(
                    collabVo.getSearchQuery(), map);//MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) where f.firstName =~"{display_name}.*" RETURN f
            Result<Student> std = result.to(Student.class);
            for (Student st : std) {
                students.add(st);

Error

[STDERR] javax.el.ELException: /sections/content/postAlertContent.xhtml @28,38 completeMethod="#         {autocompleteBeanController.completeUserProfile}": java.util.regex.PatternSyntaxException: Illegal    repetition
[STDERR] {display_name}.*
[STDERR]    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)
[STDERR]    at   org.primefaces.component.autocomplete.AutoComplete.broadcast(AutoComplete.java:337)
[STDERR]    at javax.faces.component.UIData.broadcast(UIData.java:1093)
[STDERR]    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
[STDERR]    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:935)
[STDERR]    at  com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
[STDERR]    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[STDERR]    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
[STDERR]    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[STDERR]    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329) 
[STDERR]    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) 
[STDERR]    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at com.ramselabs.education.filter.LoginFilter.doFilter(LoginFilter.java:52)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
[STDERR]    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
[STDERR]    at org.eclipse.jetty.server.Server.handle(Server.java:363)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)  
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
[STDERR]    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
[STDERR]    at java.lang.Thread.run(Thread.java:745)
[STDERR] Caused by: java.util.regex.PatternSyntaxException: Illegal repetition
[STDERR] {display_name}.*
[STDERR]    at java.util.regex.Pattern.error(Pattern.java:1924)
[STDERR]    at java.util.regex.Pattern.closure(Pattern.java:3104)
[STDERR]    at java.util.regex.Pattern.sequence(Pattern.java:2101)
[STDERR]    at java.util.regex.Pattern.expr(Pattern.java:1964)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1665)
[STDERR]    at java.util.regex.Pattern.<init>(Pattern.java:1337)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1022)
[STDERR]    at scala.util.matching.Regex.<init>(Regex.scala:153)
user3011731

It was not the pattern's problem. The problem was in my cypher query. The cypher query should be like this:

MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) 
where f.firstName =~{display_name} RETURN f

And adding parameters should be like this:

map.put("display_name", input);  

where input contains the full pattern (like "nameToMatch.*"). This should work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Caused by: java.lang.ClassNotFoundException: org.springframework.util.StreamUtils in GAE

From Dev

Nongreedy regex with alternation and repetition

From Dev

Java PatternSyntaxException: Unmatched closing '('

From Dev

Recursion - Combination with in array with no repetition in Java

From Dev

java.util.regex.PatternSyntaxException: Unclosed character class near index 0

From Dev

Java replaceAll Illegal repetition

From Dev

Android: PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR

From Dev

java.util.regex.PatternSyntaxException: Unclosed character class near index 12 \\b]([^.(|[]+)

From Dev

A Regex to match any sentence but avoiding character repetition

From Dev

Java: PatternSyntaxException thrown with regex .*-\\d+{.*}\\d+-.*

From Dev

Regex to SQL: repetition-operator operand invalid

From Dev

java.util.regex.PatternSyntaxException: Unmatched closing ')' : during string.split operation

From Dev

invalid regular expression : illegal repetition in Java

From Dev

What is benefit in design of java.util.regex.Pattern and java.util.regex.Matcher?

From Dev

Regex Illegal Argument Exception

From Dev

jOOQ 3.6.3 Code Generation Bug? PatternSyntaxException: Illegal/unsupported escape sequence

From Dev

PHP Regex, capture repetition matches

From Dev

Regex to check for repetition

From Dev

Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]

From Dev

regex pattern repetition and ng-invalid

From Dev

What makes scala.util.matching.regex library different from java.util.regex library?

From Dev

Java - Spring injected RegEx - Illegal Character - Ampersand

From Dev

Best practice for regex to match repetition

From Dev

Caused by: java.lang.NoClassDefFoundError: org.apache.http.util.Args

From Dev

nginx rewrite regex min,max repetition

From Dev

java.util.regex.PatternSyntaxException with UCanAccess

From Dev

capture repetition of letters in a word with regex

From Dev

Java Reflection: Determining class of java.util.regex.Pattern in JRuby

From Dev

java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0 +

Related Related

  1. 1

    Caused by: java.lang.ClassNotFoundException: org.springframework.util.StreamUtils in GAE

  2. 2

    Nongreedy regex with alternation and repetition

  3. 3

    Java PatternSyntaxException: Unmatched closing '('

  4. 4

    Recursion - Combination with in array with no repetition in Java

  5. 5

    java.util.regex.PatternSyntaxException: Unclosed character class near index 0

  6. 6

    Java replaceAll Illegal repetition

  7. 7

    Android: PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR

  8. 8

    java.util.regex.PatternSyntaxException: Unclosed character class near index 12 \\b]([^.(|[]+)

  9. 9

    A Regex to match any sentence but avoiding character repetition

  10. 10

    Java: PatternSyntaxException thrown with regex .*-\\d+{.*}\\d+-.*

  11. 11

    Regex to SQL: repetition-operator operand invalid

  12. 12

    java.util.regex.PatternSyntaxException: Unmatched closing ')' : during string.split operation

  13. 13

    invalid regular expression : illegal repetition in Java

  14. 14

    What is benefit in design of java.util.regex.Pattern and java.util.regex.Matcher?

  15. 15

    Regex Illegal Argument Exception

  16. 16

    jOOQ 3.6.3 Code Generation Bug? PatternSyntaxException: Illegal/unsupported escape sequence

  17. 17

    PHP Regex, capture repetition matches

  18. 18

    Regex to check for repetition

  19. 19

    Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]

  20. 20

    regex pattern repetition and ng-invalid

  21. 21

    What makes scala.util.matching.regex library different from java.util.regex library?

  22. 22

    Java - Spring injected RegEx - Illegal Character - Ampersand

  23. 23

    Best practice for regex to match repetition

  24. 24

    Caused by: java.lang.NoClassDefFoundError: org.apache.http.util.Args

  25. 25

    nginx rewrite regex min,max repetition

  26. 26

    java.util.regex.PatternSyntaxException with UCanAccess

  27. 27

    capture repetition of letters in a word with regex

  28. 28

    Java Reflection: Determining class of java.util.regex.Pattern in JRuby

  29. 29

    java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0 +

HotTag

Archive