Thursday, March 27, 2008

InvalidJadException in Netbeans Mobility Pack

If one comes across the following error in Netbeans 5.5 Mobility Pack with Sun Wireless Toolkit 2.5, then a possible reason could be that you copied the Midlet from another project and placed it into the mobile project where this error is occuring.

com.sun.kvem.midletsuite.InvalidJadException: Reason = 22
The manifest or the application descriptor MUST contain the attribute: MIDlet-1


This is how I fixed the problem:

In your problematic Netbeans Mobility Project go to /nbproject/project.properties
Search for the property "manifest.midlets". In my case, this property had no value and so I had to add one like this

manifest.midlets=MIDlet-1: , , \n

Put a new line feed "\n" if using Notepad in Windows. and include the space between the two commas above.

So for example:

manifest.midlets=MIDlet-1: HelloMidlet, , com.midlet.HelloMidlet

If there are other reasons/solutions to this above problems, please drop a line

13 comments:

Anonymous said...

thanks mate!!!

Himanshu said...

The pleasure is all mine.....

Anonymous said...

Thanks a lot!

Umair Azfar Khan said...

Thanks a lot! I got a headache while trying to fix that problem from inside netbeans, that is, going to project properties and then trying to add a line to the application descriptor. It was not letting me do it from there!

Anonymous said...

This should not happen any more, that was the bug which was causing it - try NetBeans 6.7 M3 +.
--Petr

Adolpho Galindo said...

I know that it can be too late, but i found another way to do the same...


->right Click over the project
->proprieties
->APlication descriptor
->MIDlets
->Add

Hope this help too...
and thanks...
you helped me a lot with your post

Unknown said...

I found another way to do the same...

->Right click over de project
->Proprieties
->Aplications descriptor
->MIDlets
->Add

hope this help too...

and thanks for your post... it helped me a lot..

Unknown said...

Thanks Guys!

Sidra said...

Thanks! God bless you!

Anonymous said...

Thanks the author for finding a way out to this.
@Adolpho Galindo: your solution is smarter!
Thank you all guys, Do you know why this happens??

Anonymous said...

thank you

Agni said...

Thanks...helped a lot

Agni said...

Thanks these small things can screw with the mind of devs :) Your solution helped \m/