hotscrubsboi / replicatorg

Automatically exported from code.google.com/p/replicatorg
GNU General Public License v2.0
0 stars 0 forks source link

Application fails to run on Mac OS X 10.5.2 due to NullPointerException #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download mac DMG
2. Extract and move to folder (but not Applications)
3. Double-click application

What is the expected output? What do you see instead?

Expect to see application running.

Get error message about NullPointerException over top of Application GUI and 
only option is to 
quit.

While I might have missed configuring something it would be helpful to get a 
better message 
than this even if I messed up. :)

What version of the product are you using? On what operating system?

-rc1 and -rc2 of Mac OS X on 10.5.2

Please provide any additional information below.

Here's the syslog output:

Jun 29 23:59:30 ... [0x0-0x114114].ReplicatorG[1962]: [JavaAppLauncher] A 
64-bit JVM is 
available for 1.5.0
Jun 29 23:59:30 ... [0x0-0x114114].ReplicatorG[1962]: [JavaAppLauncher] 
JVMArchs not found 
in Java dictionary
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: Loading machine: Unknown
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: No driver config found.
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: Loading driver: NullDriver
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: Machine set to 
replicatorg.app.MachineController@627b8b
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: [LaunchRunner Error] 
replicatorg.app.Base.main(String[]) threw an exception:
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]: 
java.lang.NullPointerException
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.MachineStatusPanel.updateMachineStatus(MachineStatusPanel.java:7
9)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.MachineStatusPanel.setMachine(MachineStatusPanel.java:56)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.Editor.setMachine(Editor.java:2263)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.Editor.loadMachine(Editor.java:2267)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.Base.<init>(Base.java:183)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.Base.main(Base.java:132)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
java.lang.reflect.Method.invoke(Method.java:585)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
apple.launcher.LaunchRunner.run(LaunchRunner.java:115)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
apple.launcher.LaunchRunner.callMain(LaunchRunner.java:50)
Jun 29 23:59:32 ... [0x0-0x114114].ReplicatorG[1962]:   at 
apple.launcher.JavaApplicationLauncher.launch(JavaApplicationLauncher.java:52)
Jun 29 23:59:33 ... [0x0-0x114114].ReplicatorG[1962]: Exception in thread 
"Thread-2" 
java.lang.NullPointerException
Jun 29 23:59:33 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.MachineStatusPanel.updateMachineStatus(MachineStatusPanel.java:7
9)
Jun 29 23:59:33 ... [0x0-0x114114].ReplicatorG[1962]:   at 
replicatorg.app.MachineStatusPanel.run(MachineStatusPanel.java:108)
Jun 29 23:59:33 ... [0x0-0x114114].ReplicatorG[1962]:   at 
java.lang.Thread.run(Thread.java:613)

Original issue reported on code.google.com by follower@gmail.com on 29 Jun 2009 at 12:49

GoogleCodeExporter commented 9 years ago
(Note, the exception occurring on line 79 is for rc-2 AFAICT, the previous 
version had the error on line 81 
according to the log.)

Original comment by follower@gmail.com on 29 Jun 2009 at 12:53

GoogleCodeExporter commented 9 years ago
Screen shot attached. I notice that it mentions there is "No machine currently 
connected" but if that's displayed 
how is line 79 even executed?.

Original comment by follower@gmail.com on 29 Jun 2009 at 1:00

Attachments:

GoogleCodeExporter commented 9 years ago
Okay, so, my theory of the cause is:

* 'DriverBaseImplementation' has a 'Version' property 'version' which is 
initially 'null'.

* 'NullDriver' does not replace the version property.

* 'Version' has a method 'compareTo' which does not handle being passed a 
'null' value.

Original comment by follower@gmail.com on 29 Jun 2009 at 1:35

GoogleCodeExporter commented 9 years ago
The following patch seems to "fix" the issue:

Index: src/replicatorg/app/drivers/NullDriver.java
===================================================================
--- src/replicatorg/app/drivers/NullDriver.java (revision 363)
+++ src/replicatorg/app/drivers/NullDriver.java (working copy)
@@ -35,6 +35,8 @@
        super();

        speedup = 10;
+
+       version = new Version(0,0);
    }

    public void loadXML(Node xml) {

I have no idea if that's the best approach or not.

But it seems the NullDriver may not be handled well in general as it doesn't 
have a presence in the 
"Machine>Driver" menu and selecting "Machine>Control Panel" crashes (report to 
be added).

Perhaps it would be better to default to the simulator driver rather than a 
NullDriver? After all, my reason for 
running the application without configuration was to see how the simulation 
worked since I didn't have a 
machine.

Original comment by follower@gmail.com on 29 Jun 2009 at 2:14

GoogleCodeExporter commented 9 years ago
The NPE is now fixed in SVN, but it's almost certainly not fatal.  I'll try to
reproduce this in a few hours when I finally get access to a Mac.

Original comment by pho...@gmail.com on 29 Jun 2009 at 2:41

GoogleCodeExporter commented 9 years ago
I can confirm that I can now update & rebuild SVN and the NPE no longer occurs 
AFAICT. 

Original comment by follower@gmail.com on 29 Jun 2009 at 3:12

GoogleCodeExporter commented 9 years ago
Thanks for confirming that; appears to be fixed after refactor in 0005.

Original comment by pho...@gmail.com on 22 Jul 2009 at 10:28