Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-13320

Display a nicer message when using a Java version incompatible with XWiki

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.1-milestone-1
    • Fix Version/s: 9.0-rc-1
    • Component/s: Jetty resources (Tool)
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      To reproduce install Java 7 and start XWiki 8.1M1.

      You get this stacktrace:

      Starting Jetty on port 8080, please wait...
      2016-04-12 14:10:01.273:INFO::main: Logging initialized @226ms
      java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:606)
              at org.eclipse.jetty.start.Main.invokeMain(Main.java:321)
              at org.eclipse.jetty.start.Main.start(Main.java:817)
              at org.eclipse.jetty.start.Main.main(Main.java:112)
      Caused by: java.lang.UnsupportedClassVersionError: org/xwiki/tools/jetty/listener/NotifyListener : 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:142)
              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)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              at org.eclipse.jetty.util.Loader.loadClass(Loader.java:86)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:364)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:754)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1125)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1030)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:721)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
              at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:354)
              at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:262)
              at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1243)
              at java.security.AccessController.doPrivileged(Native Method)
              at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
              ... 7 more
      
      Usage: java -jar start.jar [options] [properties] [configs]
             java -jar start.jar --help  # for more information
      Press any key to continue . . .

      It would be better for users to see: "You need to upgrade your Java version to 8 in order to start XWiki" or some similar message.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                msmeria Manuel Smeria
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: