Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8080

'bin/solr start' should print informative errors when the JVM version is insufficient

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3, 5.4, 6.0
    • Fix Version/s: 6.3, master (7.0)
    • Component/s: scripts and tools
    • Labels:
      None

      Description

      From the unpacked 5.3.0 distribution, with Java6 set in $JAVA_HOME and the $PATH, there is some indication that there is a problem (Java7 is minimum supported JVM version) - bin/solr times out waiting for Solr to start up - but no info is printed about what the problem might be:

      $ echo $JAVA_HOME
      /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
      
      $ java -version
      java version "1.6.0_65"
      Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
      Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
      
      $ bin/solr start
      Waiting up to 30 seconds to see Solr running on port 8983 [\]  Still not seeing Solr listening on 8983 after 30 seconds!
      tail:~/temp/solr-5.3.0/server/logs/solr.log: No such file or directory
      

      On trunk (built via ant server with Java8), the situation is worse - although Solr started, it's not in a usable state, and there is no indication given that there is a problem:

      $ java -version
      java version "1.7.0_71"
      Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
      
      $ echo $JAVA_HOME
      /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
      
      sarowe@smb [2048]$ bin/solr start
      Waiting up to 30 seconds to see Solr running on port 8983 [/]  
      Started Solr server on port 8983 (pid=50551). Happy searching!
      

      From server/logs/solr.log:

      2015-09-21 17:15:28.991 WARN  (main) [   ] o.e.j.u.c.AbstractLifeCycle FAILED So
      lrRequestFilter: java.lang.UnsupportedClassVersionError: org/apache/solr/servlet
      /SolrDispatchFilter : Unsupported major.minor version 52.0
      java.lang.UnsupportedClassVersionError: org/apache/solr/servlet/SolrDispatchFilt
      er : Unsupported major.minor version 52.0
              at java.lang.ClassLoader.defineClass1(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
      2)
              at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
              at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      
      [...]
      
      2015-09-21 17:15:29.020 INFO  (main) [   ] o.e.j.s.ServerConnector Started ServerConnector@24d25ddc{HTTP/1.1}{0.0.0.0:8983}
      2015-09-21 17:15:29.020 INFO  (main) [   ] o.e.j.s.Server Started @1237ms
      
      1. SOLR-8080.patch
        3 kB
        Jan Høydahl

        Issue Links

          Activity

          Hide
          steve_rowe Steve Rowe added a comment -

          Anshum Gupta, why did you remove 5.4 from the list of affected versions? I see the same behavior on branch_5x as with the 5.3 distribution:

          $ java -version
          java version "1.6.0_65"
          Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
          Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
          
          $ echo $JAVA_HOME
          /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
          
          $ bin/solr start
          Waiting up to 30 seconds to see Solr running on port 8983 [\]  Still not seeing Solr listening on 8983 after 30 seconds!
          tail: ~/svn/lucene/dev/branches/branch_5x/solr/server/logs/solr.log: No such file or directory
          
          Show
          steve_rowe Steve Rowe added a comment - Anshum Gupta , why did you remove 5.4 from the list of affected versions? I see the same behavior on branch_5x as with the 5.3 distribution: $ java -version java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode) $ echo $JAVA_HOME /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home $ bin/solr start Waiting up to 30 seconds to see Solr running on port 8983 [\] Still not seeing Solr listening on 8983 after 30 seconds! tail: ~/svn/lucene/dev/branches/branch_5x/solr/server/logs/solr.log: No such file or directory
          Hide
          anshumg Anshum Gupta added a comment -

          That must've been accidental (keyboard shortcut). But, I was actually thinking of removing that as it still affects only 5.3 and might be fixed with 5.4.

          That's been my interpretation of the affected versions field, but I could be wrong there. I generally only add already released versions in the list of 'affected versions'.

          I'll add that back and if this gets fixed in time for 5.4, we could always remove 5.4 from there again.

          Show
          anshumg Anshum Gupta added a comment - That must've been accidental (keyboard shortcut). But, I was actually thinking of removing that as it still affects only 5.3 and might be fixed with 5.4. That's been my interpretation of the affected versions field, but I could be wrong there. I generally only add already released versions in the list of 'affected versions'. I'll add that back and if this gets fixed in time for 5.4, we could always remove 5.4 from there again.
          Hide
          janhoy Jan Høydahl added a comment -

          Attaching fix.

          Sample output on Debian when no Java installed:

          root@a57c6a4949aa:/# service solr start
          Java not found, or an error was encountered when running java.
          A working Java 8 JRE is required to run Solr!
          Please install latest version of Java 8 or set JAVA_HOME properly.
          Command that we tried: 'java -version', with response:
          /opt/solr/bin/solr: line 124: java: command not found
          
          Debug information:
          JAVA_HOME: N/A
          Active Path:
          /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
          

          Sample print when Java version too old:

          root@a57c6a4949aa:/# service solr start
          Your current version of Java is too old to run this version of Solr
          We found version 1.7.0_111, using command 'java'
          Please install latest version of Java 8 or set JAVA_HOME properly.
          
          Debug information:
          JAVA_HOME: N/A
          Active Path:
          /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
          
          Show
          janhoy Jan Høydahl added a comment - Attaching fix. Sample output on Debian when no Java installed: root@a57c6a4949aa:/# service solr start Java not found, or an error was encountered when running java. A working Java 8 JRE is required to run Solr! Please install latest version of Java 8 or set JAVA_HOME properly. Command that we tried: 'java -version', with response: /opt/solr/bin/solr: line 124: java: command not found Debug information: JAVA_HOME: N/A Active Path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games Sample print when Java version too old: root@a57c6a4949aa:/# service solr start Your current version of Java is too old to run this version of Solr We found version 1.7.0_111, using command 'java' Please install latest version of Java 8 or set JAVA_HOME properly. Debug information: JAVA_HOME: N/A Active Path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 4574cb8ceafad2e2530955923946d16f2cf71a96 in lucene-solr's branch refs/heads/master from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4574cb8 ]

          SOLR-8080: bin/solr start script now exits with informative message if using wrong Java version

          Show
          jira-bot ASF subversion and git services added a comment - Commit 4574cb8ceafad2e2530955923946d16f2cf71a96 in lucene-solr's branch refs/heads/master from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4574cb8 ] SOLR-8080 : bin/solr start script now exits with informative message if using wrong Java version
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 09d399791a37681b5233248841bae738b799d8e1 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=09d3997 ]

          SOLR-8080: bin/solr start script now exits with informative message if using wrong Java version

          (cherry picked from commit 4574cb8)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 09d399791a37681b5233248841bae738b799d8e1 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=09d3997 ] SOLR-8080 : bin/solr start script now exits with informative message if using wrong Java version (cherry picked from commit 4574cb8)
          Hide
          shalinmangar Shalin Shekhar Mangar added a comment -

          Closing after 6.3.0 release.

          Show
          shalinmangar Shalin Shekhar Mangar added a comment - Closing after 6.3.0 release.

            People

            • Assignee:
              janhoy Jan Høydahl
              Reporter:
              steve_rowe Steve Rowe
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development