Solr
  1. Solr
  2. SOLR-7652

example/files update-script.js does not work on Java7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.2
    • Fix Version/s: 5.2.1, 5.3, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      A colleague reported that example/files does not work with Java 7, but did with Java 8.

      $ bin/solr create -c files -d example/files/conf/
      
      Setup new core instance directory:
      /Users/erikhatcher/dev/clean-branch_5x/solr/server/solr/files
      
      Creating new core 'files' using command:
      http://localhost:8983/solr/admin/cores?action=CREATE&name=files&instanceDir=files
      
      Failed to create core 'files' due to: Error CREATEing SolrCore 'files': Unable to create core [files] Caused by: missing name after . operator (<Unknown source>#73)
      

      with this in solr.log:

      Caused by: org.apache.solr.common.SolrException: Unable to evaluate script: update-script.js
      	at org.apache.solr.update.processor.StatelessScriptUpdateProcessorFactory.initEngines(StatelessScriptUpdateProcessorFactory.java:313)
      	at org.apache.solr.update.processor.StatelessScriptUpdateProcessorFactory.inform(StatelessScriptUpdateProcessorFactory.java:227)
      	... 33 more
      Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: missing name after . operator (<Unknown source>#73) in <Unknown source> at line number 73
      	at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:224)
      	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
      	at org.apache.solr.update.processor.StatelessScriptUpdateProcessorFactory.initEngines(StatelessScriptUpdateProcessorFactory.java:311)
      
      1. SOLR-7652.patch
        1 kB
        Erik Hatcher

        Activity

        Hide
        Erik Hatcher added a comment -

        Here's a patch that fixes example/files update-script.js for Java7

        Show
        Erik Hatcher added a comment - Here's a patch that fixes example/files update-script.js for Java7
        Hide
        ASF subversion and git services added a comment -

        Commit 1684510 from Erik Hatcher in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1684510 ]

        SOLR-7652: Fix example/files update-script.js to work with Java 7

        Show
        ASF subversion and git services added a comment - Commit 1684510 from Erik Hatcher in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1684510 ] SOLR-7652 : Fix example/files update-script.js to work with Java 7
        Hide
        ASF subversion and git services added a comment -

        Commit 1684511 from Erik Hatcher in branch 'dev/branches/lucene_solr_5_2'
        [ https://svn.apache.org/r1684511 ]

        SOLR-7652: Fix example/files update-script.js to work with Java 7 (merged from branch_5x r1684510)

        Show
        ASF subversion and git services added a comment - Commit 1684511 from Erik Hatcher in branch 'dev/branches/lucene_solr_5_2' [ https://svn.apache.org/r1684511 ] SOLR-7652 : Fix example/files update-script.js to work with Java 7 (merged from branch_5x r1684510)
        Hide
        Erik Hatcher added a comment -

        Except, this now fails on Java 8, ARG, 5x and trunk:

        2015-06-09 20:13:48.485 ERROR (qtp434176574-13) [   x:files] o.a.s.c.SolrCore java.lang.ClassCastException: Cannot cast jdk.internal.dynalink.beans.StaticClass to java.lang.Class
        	at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:312)
        	at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:307)
        	at jdk.nashorn.internal.scripts.Script$\^eval\_.processAdd(<eval>:74)
        	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:537)
        	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:209)
        	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
        

        Time to research if there's a way to get this to work in both versions of the built-in Java 7 and 8 JavaScript engines. For now I'll leave it with the fix for Java7 on 5x, and Java8 on trunk.

        Show
        Erik Hatcher added a comment - Except, this now fails on Java 8, ARG, 5x and trunk: 2015-06-09 20:13:48.485 ERROR (qtp434176574-13) [ x:files] o.a.s.c.SolrCore java.lang.ClassCastException: Cannot cast jdk.internal.dynalink.beans.StaticClass to java.lang. Class at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:312) at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:307) at jdk.nashorn.internal.scripts.Script$\^eval\_.processAdd(<eval>:74) at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:537) at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:209) at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378) Time to research if there's a way to get this to work in both versions of the built-in Java 7 and 8 JavaScript engines. For now I'll leave it with the fix for Java7 on 5x, and Java8 on trunk.
        Hide
        ASF subversion and git services added a comment -

        Commit 1685667 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1685667 ]

        SOLR-7652: Adding the change log entry to 5.2.1 (it was accidentally deleted)

        Show
        ASF subversion and git services added a comment - Commit 1685667 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1685667 ] SOLR-7652 : Adding the change log entry to 5.2.1 (it was accidentally deleted)
        Hide
        ASF subversion and git services added a comment -

        Commit 1685668 from shalin@apache.org in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1685668 ]

        SOLR-7652: Adding the change log entry to 5.2.1 (it was accidentally deleted)

        Show
        ASF subversion and git services added a comment - Commit 1685668 from shalin@apache.org in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1685668 ] SOLR-7652 : Adding the change log entry to 5.2.1 (it was accidentally deleted)
        Hide
        ASF subversion and git services added a comment -

        Commit 1685669 from shalin@apache.org in branch 'dev/branches/lucene_solr_5_2'
        [ https://svn.apache.org/r1685669 ]

        SOLR-7652: Adding the change log entry to 5.2.1 (it was accidentally deleted)

        Show
        ASF subversion and git services added a comment - Commit 1685669 from shalin@apache.org in branch 'dev/branches/lucene_solr_5_2' [ https://svn.apache.org/r1685669 ] SOLR-7652 : Adding the change log entry to 5.2.1 (it was accidentally deleted)

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Erik Hatcher
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development