Shop OBEX P1 Docs P2 Docs Learn Events
Runtime error... — Parallax Forums

Runtime error...

Steve64Steve64 Posts: 11
edited 2006-11-14 01:03 in General Discussion
I’m getting the following runtime error when instantiating a one of my objects that contains 2 uart VPs:

[noparse][[/noparse]Error IDE-0028] Unhandled exception in JVM: java.lang.NullPointerException
Exception thrown in file ‘C:\...\VirtualPreipheral.java’ at line 15


It appears that the error is occurring when the first of·the uart VPs is created. The uarts would be the 4th and 5th VPs created. Any clues there I should be looking for the problem?

Thanks

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-11-04 18:11
    Post your code.
    regards peter
  • Steve64Steve64 Posts: 11
    edited 2006-11-04 18:51
    Not mine to post·on a public forum. Is there a private way to get it to you?
    ·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-11-04 19:05
    You can post it to verkaik6@zonnet.nl
    regards peter
  • Steve64Steve64 Posts: 11
    edited 2006-11-04 19:37
    Peter,

    my email was rejected by your mail server eyes.gif

    The original message was received at Sat, 4 Nov 2006 10:37:01 -0800
    from adsl-68-122-0-169.dsl.pltn13.pacbell.net [noparse][[/noparse]68.122.0.169]

    ·
    The following addresses had permanent fatal errors

    <verkaik6@zonnet.nl>
    ··· (reason: 553 We do not accept mail from IP addresses without reverse DNS. See http://wikipedia.org/wiki/reverse_dns)

    I'll figure out the runtime error myself...

    Thanks anyway
    Steve
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-11-04 20:17
    A nullpointer exception usually refers to an uninitialized variable.
    For example, if you define
    Uart myUarts[noparse]/noparse = new Uart[noparse][[/noparse]2]; //define array of 2 uarts
    Then you must still initialize the array elements.
    myUarts[noparse][[/noparse]0] = new Uart(...);
    myUarts[noparse][[/noparse]1] = new Uart(...);
    before using those elements.

    regards peter
  • Steve64Steve64 Posts: 11
    edited 2006-11-14 01:03
    Now that the first pass on the projsct shipped out, time to provide an update on the problem...

    I was consistantly able to fix the issue by doing one of two thing:

    1. Replace the Javelin Module with another then·reload the code. This worked most of the time.

    2. Load a completely different piece of code, run it, then reload the original code. This worked every time.

    Another observation is the problem completely went away after I switched from using my ThinkPad laptop to a desk top machine as the host of the IDE.

    It's entirely possible that I had NULL pointers in my code that I subconsciously fixed when I moved from the ThinkPad to the desk top machine. I guess we'll never know.

    Another interesting nugget of information: A seemingly random "out of memory" error that I was experiencing also went away when I switched computers...

    Steve
Sign In or Register to comment.