NullPointerException Dogs Newbie

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NullPointerException Dogs Newbie

2,085 Views
cab
Contributor III

CW 10.2 with 1.0.0.0 upgrade.  MC9S08LG32, Win7x64

 

Are you allowed to have two projects in the same workspace--it appears that after I add the second project I get opaque error messages and Java NullPointerExceptions.  I do note that one system file MC9S08LG32.xml is modified and used for both projects.  Error messages like "Error Importing Task" or "Cannot import Target Framework.." And them some java.lang.NullPointerExceptions.  Often right out of the gate--having just reinstalled CW 10.2.  At one point (at least twice) I found that MC9S08LG32.xml has been truncated to 0 length.  That would explain a lot, except who did it (not me).

 

My best try to fix:  I reinstalled CW10.2. I created a new workspace200.  I created a barebones MC9S08LG32 project SM6.1.  I dropped the original Sources from the old problem workspace100 onto the C/C++ perspective of SM6.1.  I then built the project and downloaded to flash and tested -- a few times -- no problems.  Now I made a second barebones project ICCEX_MST in workspace200.  It is an example IIC project, only a few source files to carry over..  After I built and tried to flash I started to get NullPointerExceptions. I went back to the SM6.1 to see that it was infected as well.

 

I am attaching workspace200 with .metadata and logfiles showing NPE's.  As well as a copy HC9S08LG32.xml, but it looks OK so far, only a couple of differences from the install.  I had to remove the first project because I do not have permission to share.  But the NPE problems remain in the second ICCEX_MST..

 

Any help would be appreciated.

-Cab-

Labels (1)
Tags (1)
0 Kudos
15 Replies

1,128 Views
BlackNight
NXP Employee
NXP Employee

Hello,

I tried your project in a workspace, and I have seen no issue.

But I did not do any flashing, as I do not have that microcontroller available.

 

BK

0 Kudos

1,128 Views
cab
Contributor III

More Information:  Since my first post I re-installed CW and 1.0.0 update and was careful not to make any copies of projects--always doing a barebones project first and then copying the source code,  But I did nake a copy from workspace100 to a new workspce200 by using File->Import->Existing Project into Workspace, being careful to check [x] Copy projects into workspace (rather than making a link). 

  • This seemed to have workd in the new workspace200--I could build flash etc. the copied project and derivatives (using the first method of copying).
  • Tonight I am once-again dead in the water--if I click on most any button having to do with downloading, I get the jaqva.lang.NullPointerExceptions again.
  • Here is an update message to support about this problem:

    Update to Service Request SR# 1-882535601

    The following may help: I see that I now have two target tasks for

    Simple Flash Temporary: MC9S08LG32 / CopyOfMC908LG32

    According to the blog http://mcuoneclipse.wordpress.com/2012/03/17/copy-my-project/ this can be a problem if the wrong one is selected. I was aware of that when I made my copy, but I could not find two target tasks so did not fix as he suggested. This may have been missed. Erich Styger did not mention NPE and getting stuck like this--I can download -NO- project even unrelated ones.

0 Kudos

1,128 Views
BlackNight
NXP Employee
NXP Employee

Hello,

target tasks are evil, and don't understand why you have target tasks at all for your LG32?

You should be able to download/program/flash the LG32 without the need for target tasks, just with the P&E cable.

The P&E multilink cares about the flash programming.

 

Are you flashing your board with Run > Debug as... and then select the launch config and press debug button?

Try it that way.

 

I'm guessing you are using the 'Simple flash programmer' (blue lightning bolt) which is using target tasks. Don't use that for now, as I think this could be the cause of your problems?

 

Hope this helps,

BK

0 Kudos

1,127 Views
cab
Contributor III

Yes, now I agree, the blue lightning bolt (and target tasks?) -ar-e evil.  Because 1) it's whatever was there last--and 2) the project entries can be inconsistent, which would easily confuse our Java..  I -do- use Debug and Run-Configurations. now. A lot easier and always consistent.  I recommend this for all.  Thanks BK.

0 Kudos

1,127 Views
cab
Contributor III

They are back--the NullPointerExceptions.  After more than two weeks with practically no such problems, the NPE's are  back.  Yes, I hit the blue ligtning-bolt and tried a 'erase whole device.'  I did this becuase I could -not- program flash using debug or run configurations--I kept getting the 'cannot contact device and power dialog and retry--none of which worked, even after restart. Out of desparation I gave it a try.  This is what happened on my -first- hit of erase-whole-device button

  • I got many windows full of java.lang NullPointerException lines.  I looked at my mc9so8lg32.xml file--it was oK (3k).
  • I went back to 'Debug Configurations' and tried that again.  I got many windows full of NPE lines, so many it seemd like it was in an infinte loop of windows.  Eventually I dismissed them all and saw a 'Could not import Target Task Data Model'.  I knew then that my .xml-file was hosed.  Sure enough C:\Freescale\CW MCU v10.2\MCU\bin\plugins\support\TargetTask\Flash_Programmer\HC08\MC9S08LG32.xml was 0KB.  (See earlier entry from support about this)
    .
  • I replaced this file (from an earlier installation of CW that I had copied), and all seemed to be OK--no more NPE's from Debug or Run Configurations.  (But I still have the cannot connect message)
    .
  • I have attached .bak_1.log which shows the very first NullPointerException which started off this latest splurge.  A while back a Support said he has heard about the problem but could not reproduce or find out much about it.  This logfile showing the first occurrence could be very useful

Yes, BK.  You gave me fair warning and I thank you for taking the time.

0 Kudos

1,128 Views
cab
Contributor III

Thanks for your response, BK.

 

I don't know why I used target tasks either.  I didn't see any when I copied my task from workspace100 to workspace200.

  • I tried recover by re-installing CW10.2 (without 1.0.0) and making a fresh workspace300 and copying projects from 200 to 300 Bareboard and adding the source files--I don't have any special settings other than the processor type.  But
  • As soon as I opened CodeWarrior with the fresh install (using workspace200) I got an immediate "Error restoring target task data model." but no NPE, nor even a .log file entry.  I persevered and set up the new workspace.  But the new workspace soon gave me a NPE and my system MC9S08LG32.xml was 0 bytes.  So my workspace200 projects are "infected" in some way.
  • I was able to restore the MC9S08LG32.xml from an earlier installation I had saved.  Now after I made a new workstation400, I was careful to go immediately to it and use it to make the Bareboard project-files.  This has worked without problems today.
  • I believe the problem in my last post happened after I built both my bareboard project and my original project (spreading the infection).  But I don't know anything.

From what I have seen and read, I agree that target tasks may be the root of the problems.  I do use the lightning bolt. It is mighty convenient because I make many minor fixes and would hate to give it up.  I will try your method as well.  Your Debug-Configurations suggestion on how to start Debug has been very useful.

 

CW is highly feature-intensive--I am sure it is the fruit of monumental efforts, but I have encountered many features which are, frankly, buggy.  If CW has great success, it is probably among those who have used it many times in the past, and have learned the zigs and zags of using it successfully.  I am a new user and may be encountering problems most experienced users (perhaps like yourself) know how to avoid.

 

-Cab-

 

 

0 Kudos

1,128 Views
BlackNight
NXP Employee
NXP Employee

Hello,

a few observations and questions:

- where do you have this MC9S08LG32.xml file? I checked your workspace zip file you uploaded, and this one is not there?

- I tried a 'flash to file' in an empty workspace. For this I have to set up a connection and consequently target tasks.

  On my machine I have then files stored in

  .metadata\.plugins\com.freescale.targettaskframework

 but looking at your workspace, that folder is empty. strange. I *guess* that there should be something in that folder.

  I have a file TargetTaskFrameworkDataModel.xml in that folder, so I think this is why you get that "Error restoring target task data model." error message.

- the 'flash file to target' creates a launch configuration 'LC for Simple Flash': maybe this is the problem: use Run > Debug Configrations...> CodeWarrior Connect and delete the 'LC for Simple Flash' launch configuration.

- just as a side note: the .metadata folder is not meant to be moved or copied into a new location. Weired things might happen as this .metafolder data is the internal data base of the workspace, and should not be moved.

 

I'm thinking that the 'simple flash programmer' is causing you the troubles. Looks there is a strange bug in that implementation, but I cannot reproduce it. I believe it has nothing to do with your installation itself (so uninstall/install) will not fix it, as it is related to the workspace data.

 

What I suggest otherwise:

- create a new workspace (e.g. c:\tmp\wsp) folder

- copy your IICEX_MST project folder into c:\tmp\wsp

- start eclipse with c:\tmp\wsp workspace

- import IICEX_MST project into workspace (menu file > import > existing workspace)

- do the same for any other project you use

- download/debug the project using Run > Debug

 

I believe the bug in CodeWarrior has to do with how you used the simple Flash programmer. It looks from the file MC9S08LG32.xml that you used 'Import Flash task'? Maybe you could describe exactly what you are using.

 

I appologize, but this is really mudding in the dark water :smileysad:

 

Hope this helps,

BK

0 Kudos

1,128 Views
cab
Contributor III

BK-

 

I know nothing about MC9S08LG32.xml (though I talked about it as if I thought everyone else knew all about it), except that I noticed it was 0KB when all its siblings were 3KB.  I happened upon it when clicking on (blue-lightning)->(Import Flash Task)->HC08/MC9S08LG32.xml to rescue my project.  (When the ship is sinking one can even use a coffin as a lifeboat I think).  Later I noticed it was 0 bytes, done surreptitiously a few times and the source of a particular NPE failure message.  This appears to be a shared system system file--C:\Freescale\CW MCU v10.2\MCU\bin\plugins\support\TargetTask\Flash_Programmer\HC08\MC9S08LG32.xml--that gets modified by current projects.  Sounds like a red flag in itself, but why it bit me and no one else I do not yet know.

 

No I didn't know I was supposed to have something in the .targettaskframework (I created all my projects originallyfrom Bareboard+source-files).  And yes, my first tough error message was LC-for-Simple-Flash (thanks for your help on it)--but why did it pick on me?

 

You have roughly described the procedure I used to get out of the infection--start with Bareboards and don't carry over anything but source code (in my last post).  So far, no NPE's in at least three days.  You suggest .metadata, parts of which must get copied over when I do a File->Import or any other sort of copy. I won't criticize the procedure because it was not advertised to cured any ailment or disease.

 

Thanks for your support.

 

-Cab-

 

 

0 Kudos

1,130 Views
BlackNight
NXP Employee
NXP Employee

Hello,

 

>>You suggest .metadata, parts of which must get copied over when I do a File->Import or any other sort of copy.

 

Just to be clear: do not copy things from the .metadata folder by hand (except you know exactly what you are doing). Yes, if using File > Import or File > Export, this is the right way of doing things, and it will transfer things from the .metadata as appropriate.

 

Bottom line is that I think there is a serious bug somehow in the 'simple flash programmer'. If it truncates your MC9S08LG32.xml file, then this is really, really bad. Not sure what was causing this, and I was not able to reproduce it on my end. I'll ask around, but in any case I suggest that you stick with the procedure you are using right now.

 

Thanks,

BK

0 Kudos

1,130 Views
cab
Contributor III

>>/>>You suggest .metadata, parts of which must get copied over when I do a File->Import or any other sort of copy.

What I meant to say was that since File->import 'must' use ,metadata, I avoid it at all costs.  I have not had any NPE since I rebuilt my workspace without .metadata.  I got a reply from support, which I will reproduce here:

=============================
In reply to your message regarding Service Request SR 1-882535601:

Please first accept my apology for the time it has taken to get back to you on your issue.
I'm heavily backlogged recently and I appreciate your patience on this problem.

Regarding to the issue:

I've read your post in Freescale forum and NK's replies.
And now, it seems that the .xml is the trouble maker. For a CW Eclipse project, the .xml is used to store a copy of all RSE (remote system explorer) systems referenced by the project. In a simple word, the .xml file stores some key configurations for flashing target MCU. And the systems can be automatically recreated when the project is imported in a new workspace.
This file will be automatically generated and updated by the Eclipse IDE.

Let come back to your issue, there must be something wrong that causes the failure of updating of .xml file.

As I know, some of Windows System Environment Settings might this problem. I have met a case in which the same problem was caused by a non-English language Settings in his PC. This problem was solved by launch his CW once by below way:

Right click folder “eclipse” in CW 10.2 installation folder and then click “CMD Prompt here”.
In the launched DOS window, enter the command: cwide.exe –nl en

Could you please try it on your side?

====================================================================

 

Now I have another problem--which I will tack on here:

'Launching SMICK_MC9S08LG32_PnE U-MultiLink' has encountered a problem.

Failed to resume target process., Download using 3rd party component...

 

I tried your suggestion on flashing.  When I do DebugAs.. the only choicesI see are

1 CodeWarrior Attach

2 CodeWarrior Connect

3 CodeWarrior Download.

 

When I choose Download, I get the same mesage.  reboot, rest whatever does me no good.  Dead in the water again.  Not a complaint to you, BK, just getting my documention together.

 

There may -indeed- be something about my Windows setup and I will respond to support.  Meanwhile, I need to accomplish something so I try a few more things then will just have to download CodeWarrior again

 

 

 

 

0 Kudos

1,130 Views
cab
Contributor III

I only tried closing my project thenopening itagain--and I got

An internal error occurred during: "Executing task MC9S08LG32".
java.lang.NullPointerException

 

But MC9S08LG32.xml is still 3KB

- So reload CW and rebuild using Bareborad.

0 Kudos

1,130 Views
BlackNight
NXP Employee
NXP Employee

Hi cab,

I have sent you a private message: maybe we could chat and solve your problem.

 

In any case: I suggest not to uninstall-reinstall the tools. I think this will be a waste of time. The problem is somewhere else in my view.

 

BK

0 Kudos

1,130 Views
cab
Contributor III

I didn't get your PM yet--but I will be happy to respond when I do.  Waste of time? You can say that again--and I don't bother to download 1.0.0 anymore.

 

By the way, support has responded again

===============================================================================

Dear Cab Jones,

In reply to your message regarding Service Request SR 1-882535601:

Thanks for your feedback!
I'm sorry, I've got the wrong case. A language setting would cause the problem as showed in the attached image!
It will not cause the NPE error.

Regarding to this NPE error, I've also contacted a guy from dev-tech team.
As he said, the install order of patch 1.0.0 and MQX 3.8 would cause a similar problem.
But, since this issue can't be reproduced on our side, I can't say it for sure.

As they suggested, if you want to install MQX3.8, then, please first install the 1.0.0 patch before the installation of MQX 3.8 after CW 10.2 is installed.

But, if you only installed the CW 10.2 on your PC, then, could you please find your project folder, the CW 10.2 folder or the .metadata folder to see if there is a log file (with the extension name .log) which updated after the NPE occurs. If yes, then, please send it to me for investigating.

I'm so sorry for this inconvenience has caused to you!

Should you need to contact us with regard to this message, please see the notes below.

Best Regards,
Yong
Technical Information & Commercial Support

=================================================================================

I do have plenty of logfiles for them--in fact some humorous ones--which I would like to post when I find them again.

 

0 Kudos

1,130 Views
BlackNight
NXP Employee
NXP Employee

Hi cab,

you get PM's from the forum not in your normal email inbox, but into the forums email box. On this page, just below the 'Search' button (upper right corner), there should be an email envelope icon for this inbox.

 

As for the log files: yes, please send them in.

 

BK

0 Kudos

1,128 Views
cab
Contributor III

I have attached the most humorous logfile pertaining to my java NPE's.  The following excerpts are the entries from a single mouse-click (Blue Lightning->FlashFile->Erase-and-program, I think) in my workspace100/.metadata/.log--note the directory name changes from /Copy/ to /Co/, /C/, //, /CA/, /CAL/ and on it goes--all timestamps are within 3-seconds.


!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:44.125
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/Copy/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:44.318
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/Cop/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:44.540
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/Co/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:44.740
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/C/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:44.947
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc://MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:45.875
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/C/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:46.251
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CA/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:46.881
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CAL/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:47.539
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CALC/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:48.148
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CALCF/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:48.603
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CALCF2/MC9S08LG32/SM6.1.abs}
...
!ENTRY com.freescale.core.debugger.cdt 4 120 2012-05-23 16:19:49.458
org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${workspace_loc:/CALCF2./MC9S08LG32/SM6.1.abs}


0 Kudos