Harmony
  1. Harmony
  2. HARMONY-4252

[drlvm][api][app] cannot start FreeCol application

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      I've unpacked http://dfn.dl.sourceforge.net/sourceforge/freecol/freecol-0.6.1.zip and launched the application. On RI the application starts with a defaut heap. On Harmony I got an error message.

      $ cd c:/tmp/freecol/freecol
      $ $HY_HOME/bin/java -Xmx512M -jar FreeCol.jar
      You need to assign more memory to the JVM. Restart FreeCol with:
      java -Xmx128M -jar FreeCol.jar

      1. getUI.patch
        0.8 kB
        Aleksey Lagoshin
      2. modifiedUIDefaults.patch
        1 kB
        Tharindu Mathew

        Activity

        Hide
        Xiao-Feng Li added a comment -

        When I used:

        drlvm/java.exe -Xmx256m -Xms256m -jar FreeCol.jar

        It says:
        Uncaught exception in main:
        java.lang.reflect.InvocationTargetException
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        at java.lang.reflect.Method.invoke(Method.java:317)
        at org.apache.harmony.vm.JarRunner.main(JarRunner.java:89)
        Caused by: java.lang.NullPointerException
        at java.awt.image.ColorConvertOp.createCompatibleDestImage(ColorConvertO
        p.java:415)
        at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:448)
        at net.sf.freecol.client.gui.ImageLibrary.convertToGrayscale(ImageLibrar
        y.java:830)
        at net.sf.freecol.client.gui.ImageLibrary.loadUnits(ImageLibrary.java:30
        7)
        at net.sf.freecol.client.gui.ImageLibrary.init(ImageLibrary.java:242)
        at net.sf.freecol.client.gui.ImageLibrary.<init>(ImageLibrary.java:218)
        at net.sf.freecol.FreeCol.main(FreeCol.java:198)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        ... 2 more

        Show
        Xiao-Feng Li added a comment - When I used: drlvm/java.exe -Xmx256m -Xms256m -jar FreeCol.jar It says: Uncaught exception in main: java.lang.reflect.InvocationTargetException at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) at java.lang.reflect.Method.invoke(Method.java:317) at org.apache.harmony.vm.JarRunner.main(JarRunner.java:89) Caused by: java.lang.NullPointerException at java.awt.image.ColorConvertOp.createCompatibleDestImage(ColorConvertO p.java:415) at java.awt.image.ColorConvertOp.filter(ColorConvertOp.java:448) at net.sf.freecol.client.gui.ImageLibrary.convertToGrayscale(ImageLibrar y.java:830) at net.sf.freecol.client.gui.ImageLibrary.loadUnits(ImageLibrary.java:30 7) at net.sf.freecol.client.gui.ImageLibrary.init(ImageLibrary.java:242) at net.sf.freecol.client.gui.ImageLibrary.<init>(ImageLibrary.java:218) at net.sf.freecol.FreeCol.main(FreeCol.java:198) at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java) ... 2 more
        Hide
        Alexei Fedotov added a comment -

        A good workaround, thanks. Incompatible behavior of the stack size option may be another issue, but of less priority than AWT one.

        Show
        Alexei Fedotov added a comment - A good workaround, thanks. Incompatible behavior of the stack size option may be another issue, but of less priority than AWT one.
        Hide
        Alexei Fedotov added a comment -

        Xiao Feng's exceptions is fixed by HARMONY-5643. Here is the next error:

        ERROR: UIDefaults.getUI() failed: java.lang.NullPointerException
        at javax.swing.UIDefaults.getUI(UIDefaults.java:339)
        at javax.swing.UIManager.getUI(UIManager.java:222)
        at javax.swing.JPanel.updateUI(JPanel.java:141)
        at javax.swing.JPanel.<init>(JPanel.java:56)
        at javax.swing.JPanel.<init>(JPanel.java:76)
        at javax.swing.JRootPane.createGlassPane(JRootPane.java:278)
        at javax.swing.JRootPane.<init>(JRootPane.java:78)
        at javax.swing.JFrame.createRootPane(JFrame.java:175)
        at javax.swing.JFrame.frameInit(JFrame.java:393)
        at javax.swing.JFrame.<init>(JFrame.java:123)
        at net.sf.freecol.client.gui.FullScreenFrame.<init>(FullScreenFrame.java:34)
        at net.sf.freecol.client.FreeColClient.startGUI(FreeColClient.java:218)
        at net.sf.freecol.client.FreeColClient.access$000(FreeColClient.java:31)
        at net.sf.freecol.client.FreeColClient$1.run(FreeColClient.java:142)
        at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:90)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:78)
        at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:138)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:144)
        at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)

        Show
        Alexei Fedotov added a comment - Xiao Feng's exceptions is fixed by HARMONY-5643 . Here is the next error: ERROR: UIDefaults.getUI() failed: java.lang.NullPointerException at javax.swing.UIDefaults.getUI(UIDefaults.java:339) at javax.swing.UIManager.getUI(UIManager.java:222) at javax.swing.JPanel.updateUI(JPanel.java:141) at javax.swing.JPanel.<init>(JPanel.java:56) at javax.swing.JPanel.<init>(JPanel.java:76) at javax.swing.JRootPane.createGlassPane(JRootPane.java:278) at javax.swing.JRootPane.<init>(JRootPane.java:78) at javax.swing.JFrame.createRootPane(JFrame.java:175) at javax.swing.JFrame.frameInit(JFrame.java:393) at javax.swing.JFrame.<init>(JFrame.java:123) at net.sf.freecol.client.gui.FullScreenFrame.<init>(FullScreenFrame.java:34) at net.sf.freecol.client.FreeColClient.startGUI(FreeColClient.java:218) at net.sf.freecol.client.FreeColClient.access$000(FreeColClient.java:31) at net.sf.freecol.client.FreeColClient$1.run(FreeColClient.java:142) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:90) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:78) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:138) at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:74) at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)
        Hide
        Aleksey Lagoshin added a comment -

        Patch for UIDefaults.getUI() failed: java.lang.NullPointerException

        Show
        Aleksey Lagoshin added a comment - Patch for UIDefaults.getUI() failed: java.lang.NullPointerException
        Hide
        Aleksey Lagoshin added a comment -

        It seems that was the last exception and now FreeCol is able to start on Harmony. But only in windowed mode.
        So to start FreeCol use this:

        java -Xmx256m -Xms256m -jar FreeCol.jar --windowed

        But unfortunately FreeCol is not playable: some modal dialogs don't respond to keyboard and mouse, so it's impossible to close them.
        Also there are still many small bugs in UI and problem with performance.

        Show
        Aleksey Lagoshin added a comment - It seems that was the last exception and now FreeCol is able to start on Harmony. But only in windowed mode. So to start FreeCol use this: java -Xmx256m -Xms256m -jar FreeCol.jar --windowed But unfortunately FreeCol is not playable: some modal dialogs don't respond to keyboard and mouse, so it's impossible to close them. Also there are still many small bugs in UI and problem with performance.
        Hide
        Tharindu Mathew added a comment -

        Cleaned the code of the patch

        Show
        Tharindu Mathew added a comment - Cleaned the code of the patch
        Hide
        Alexei Fedotov added a comment -

        Tharindu, that's great. Aleksey pointed me that his approach requires less checks in the typical case (when all is defined). From the other side is more readable IMHO. I believe a committer will choose one of two patches, this is not a big difference anyway.

        Show
        Alexei Fedotov added a comment - Tharindu, that's great. Aleksey pointed me that his approach requires less checks in the typical case (when all is defined). From the other side is more readable IMHO. I believe a committer will choose one of two patches, this is not a big difference anyway.
        Hide
        Tim Ellison added a comment -

        Awaiting ACQs

        Show
        Tim Ellison added a comment - Awaiting ACQs
        Hide
        Alexei Fedotov added a comment -

        I found a problem with modifiedUIDefaults.patch. put(uiClass, method) is invoked regardless of method existence in the table. Putting put right after getCreateUIMethodPriveledged(uiClass) would speed up the solution.

        Show
        Alexei Fedotov added a comment - I found a problem with modifiedUIDefaults.patch. put(uiClass, method) is invoked regardless of method existence in the table. Putting put right after getCreateUIMethodPriveledged(uiClass) would speed up the solution.
        Hide
        Tim Ellison added a comment -

        So what's the conclusion guys

        Are you going for "getUI.patch" or want to rewrite "modifiedUIDefaults.patch" ?

        Show
        Tim Ellison added a comment - So what's the conclusion guys Are you going for "getUI.patch" or want to rewrite "modifiedUIDefaults.patch" ?
        Hide
        Alexei Fedotov added a comment -

        Tharindu, is it ok with you if Tim commits Aleksey's patch?

        Show
        Alexei Fedotov added a comment - Tharindu, is it ok with you if Tim commits Aleksey's patch?

          People

          • Assignee:
            Tim Ellison
            Reporter:
            Alexei Fedotov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development