Bug 287904 - [fiximprove]: java.lang.NoClassDefFoundError on emulator launch
Summary: [fiximprove]: java.lang.NoClassDefFoundError on emulator launch
Status: RESOLVED DUPLICATE of bug 332529
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: Project Builder (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows Vista
: P3 enhancement with 10 votes (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2009-08-27 21:19 EDT by Guillermo Mazzola CLA
Modified: 2011-03-21 15:17 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillermo Mazzola CLA 2009-08-27 21:19:04 EDT
The JAR located at '.mtj.tmp\emulation' does not cotains any top level not public class. They are compiled, in the 'bin' folder anyway.

So, when the MIDlet stars, throw an NoClassDefFoundError exception.

This bug was not present at version 0.9, the same project worked perfectly.

TRACE: <at java.lang.NoClassDefFoundError: org.foo.NonPublicClassName>, startApp threw an Exception
java.lang.NoClassDefFoundError: org.foo.NonPublicClassName
 - java.lang.Class.invoke_verify(), bci=0
 - java.lang.Class.initialize(), bci=117
 - gs.infomapa.me.MIDletInfoMapa.startApp(), bci=8
 - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
 - com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
 - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
 - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
 - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
 - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
 - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
Comment 1 David Marques CLA 2009-08-28 09:16:54 EDT
Hi Guillermo,

What version of MTJ are you using ? This issue was fixed for quite a long time now. Please consider updating your MTJ plugins :)

Best Regards,

David Marques

(In reply to comment #0)
> The JAR located at '.mtj.tmp\emulation' does not cotains any top level not
> public class. They are compiled, in the 'bin' folder anyway.
> 
> So, when the MIDlet stars, throw an NoClassDefFoundError exception.
> 
> This bug was not present at version 0.9, the same project worked perfectly.
> 
> TRACE: <at java.lang.NoClassDefFoundError: org.foo.NonPublicClassName>,
> startApp threw an Exception
> java.lang.NoClassDefFoundError: org.foo.NonPublicClassName
>  - java.lang.Class.invoke_verify(), bci=0
>  - java.lang.Class.initialize(), bci=117
>  - gs.infomapa.me.MIDletInfoMapa.startApp(), bci=8
>  - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
>  - com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
>  - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
>  - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
>  - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
>  - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
>  - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
> 

Comment 2 Guillermo Mazzola CLA 2009-08-28 17:45:00 EDT
I've downloaded MTJ yesterday (2009-08-27), from Eclipse Galileo update site.

The version showed in 'About Eclipse Features' dialog is:
******************************************************
Mobile Tools Java

Version: 1.0.0.v200906121354-7V7A7BFEx2XZqZ-lBoXfQ
Build id: 200906121354
******************************************************

(In reply to comment #1)
> Hi Guillermo,
> 
> What version of MTJ are you using ? This issue was fixed for quite a long time
> now. Please consider updating your MTJ plugins :)
> 
> Best Regards,
> 
> David Marques
> 
> (In reply to comment #0)
> > The JAR located at '.mtj.tmp\emulation' does not cotains any top level not
> > public class. They are compiled, in the 'bin' folder anyway.
> > 
> > So, when the MIDlet stars, throw an NoClassDefFoundError exception.
> > 
> > This bug was not present at version 0.9, the same project worked perfectly.
> > 
> > TRACE: <at java.lang.NoClassDefFoundError: org.foo.NonPublicClassName>,
> > startApp threw an Exception
> > java.lang.NoClassDefFoundError: org.foo.NonPublicClassName
> >  - java.lang.Class.invoke_verify(), bci=0
> >  - java.lang.Class.initialize(), bci=117
> >  - gs.infomapa.me.MIDletInfoMapa.startApp(), bci=8
> >  - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
> >  - com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
> >  - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
> >  - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
> >  - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
> >  - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
> >  - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
> > 
> 

Comment 3 Christian CLA 2009-08-31 07:38:25 EDT
I did notice that bug as well (or at least a similar one) - it seems that is sometimes happens when creating a new class that this new class is not checked when checking the class-path in the application descriptor. The result is that the code looks fine in eclipse but the class won't appear in the created jar. 

This happened to me with version 1.0 but I haven't tried it on the current RC1.
Comment 4 Guillermo Mazzola CLA 2010-01-27 07:37:16 EST
I was able to track this bug to the Package Builder and the build.properties file.

So far I know, Package Builder is the last builder to run and filters all classes in bin folder that no math any of the build.properties file entries.

Here is the problem, build.properties editor, only lets you select files from your project, but I’ve an “abstract” project with common classes that my MIDlet project references and I cannot include its bin folder in with the build.properties editor. The result: all classes of this referenced project are getting filtered.

I should disable de Package Builder, and my project will run OK again. I haven’t tried yet. Anyway, I think this is a fiximprove for the build.properties editor.
Comment 5 Gorkem Ercan CLA 2010-09-10 14:04:47 EDT
If the dependent projects are chosen to be exported from the build path properties they will be included on the package build. You can achieve this by right clicking you project selecting Properties->Java Build Properties->Order & Export and checking the dependent projects. 

I will keep this report as an enhancement request for controlling the included parts of dependent projects through build.properties.
Comment 6 Gorkem Ercan CLA 2011-03-21 15:17:03 EDT
A fix for the original problem is relased for bug 332529 closing this as a duplicate
Comment 7 Gorkem Ercan CLA 2011-03-21 15:17:43 EDT
closing as duplicate

*** This bug has been marked as a duplicate of bug 332529 ***