Menu

#145 Cannot setup Server port

server_0.1.0_Beta
closed
9
2009-10-22
2009-10-15
No

karatasi server 0.1.0 Beta / svn 1533
When I try to setup the server port in the settings to a different than the current (default?) number 8089, it throws an exception as soon as I press the OK or 'Apply' button.
Caused by: java.lang.ClassCastException: java.lang.Long
at net.sf.karatasi.desktop.KaratasiDesktopPrefs.apply(KaratasiDesktopPrefs.java:184)
at net.sf.japi.swing.prefs.PreferencesPane.apply(PreferencesPane.java:262)
at net.sf.japi.swing.prefs.PreferencesPane.ok(PreferencesPane.java:254)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.sf.japi.swing.action.ReflectionAction.actionPerformed(ReflectionAction.java:174)
... 62 more

Discussion

  • Mathias Kussinger

    fixed at svn1537

     
  • Mathias Kussinger

    • assigned_to: nobody --> kussinger
    • status: open --> closed
     
  • Christa Runge

    Christa Runge - 2009-10-20

    Reopened.
    The current solution fails on some machines.
    We need to to find a solution which works on all.

     
  • Christa Runge

    Christa Runge - 2009-10-20
    • status: closed --> open
     
  • Christa Runge

    Christa Runge - 2009-10-20

    To sum up our findings so far:

    (1) Intel hardware 32 bit, MAC-OS X 10.5, Java 5
    java version "1.5.0_19"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
    Java HotSpot(TM) Client VM (build 1.5.0_19-137, mixed mode, sharing)
    (a) prefs.putInt(PREFS_KEY_NETWORK_PORT, (Integer) portField.getValue()); // crashes
    (b) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Long) portField.getValue()).intValue()); // works fine
    (c) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Integer) portField.getValue()).intValue()); // crashes
    Caused by: java.lang.ClassCastException: java.lang.Long

    (2) Intel hardware 64 bit, MAC-OS X 10.5, Java 6
    java version "1.6.0_15"
    Java(TM) SE Runtime Environment (build 1.6.0_15-b03-226)
    Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-92, mixed mode)
    (b) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Long) portField.getValue()).intValue()); // crashes
    Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
    (c) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Integer) portField.getValue()).intValue()); // works fine

    (3) Intel hardware 64 bit, Ubuntu in a virtual box (32 bit), Java 6
    java version "1.6.0_0"
    OpenJDK Runtime Environment (IcedTea6 1.4.1) (6b14-1.4.1-0ubuntu11)
    OpenJDK Client VM (build 14.0-b08, mixed mode, sharing)
    (b) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Long) portField.getValue()).intValue()); // works fine
    (c) prefs.putInt(PREFS_KEY_NETWORK_PORT, ((Integer) portField.getValue()).intValue()); // crashes
    Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer

    Note:
    (a) was implemented before svn 1537.
    (b) was implemented in svn 1537 to fix the issue on 32-bit machine, but crashes on 64 bit machine.
    (c) was then implemented in svn 1549 to fix the issue with 64 bit machine, but crashes on the 32 bit machines.

    We need a solution which works on all three configurations mentioned above, and also test it on
    - true 64 bit machine with Linux / Ubuntu
    - Windows machine

     
  • Mathias Kussinger

    finally fixed in svn1557

     
  • Mathias Kussinger

    • status: open --> closed
     
  • Christa Runge

    Christa Runge - 2017-07-29

    Ticket moved from /p/karatasi/bugs/179/

    Can't be converted:

    • _milestone: server_0.1.0_Beta
     

Log in to post a comment.