Problems with Forte 3.0 and WTK1.0.3 Beta

Hi,

I tried to use Forte 3.0 with WTK 1.0.3 beta (the latest tools

available), however got some problems. I used to work with

Forte 2.0 and WTK 1.0.1 FCS and did not have those problems.

I have HelloWorld application which runs perfectly well under

WTK 1.0.3. beta and Zucotto's WHITEboard. I mounted it to

Forte 3.0 filesystem and tried to compile it. It complained that

it could not find javax.microedition.lcdui.* package.

I created a project and added HelloWorld directory to the project

and error disappeared. However, when I tried to execute the

project it complained that it could not find main class file:

java.lang.NoClassDefFoundError: javax/microedition/midlet/MIDlet

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:486)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)

at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:297)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)

at java.lang.ClassLoader.loadClass(ClassLoader.java:253)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)

Exception in thread "main"

What should I do to make the project run?

Thank you,

Jacob Nikom

[1696 byte] By [jacob1111] at [2007-9-26 6:23:36]
# 1

[jacob1111 ],

I ran into the same problem as well. I have reproduced the problem you described with the Forte for Java CE 3.0 and integrating it with J2ME Toolkit 1.0.3 BETA. It might be a bug with this combination.

I am going to investigated further to determine if this is a bug with integrating the Forte for Java CE 3.0 IDE tool and the J2ME Wireless Toolkit 1.0.3 BETA. Stay tuned for more of my postings.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-1 15:25:01 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

[jacob1111],

I found the answer to this problem that you are facing.

Before we discuss any further, there is a document in the directory C:\J2mewtk\docs\ForteJ2MEGuide.pdf that explains how the J2ME Wireless Toolkit operates within the Forte for Java 3.0 environment.

Read pages 3-15 to 3-23 to get the process of creating a MIDlet suite package within Forte for Java 3.0 and compiling/running the MIDlet.

In summary - by just mounting an existing directory that contains the source for a MIDlet will not work in the Forte for Java development environment.

HTH.

Allen Lai

Developer Technical Support

SUN Microsystems

http://www.sun.com/developers/support/

allenlai at 2007-7-1 15:25:01 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

Hi Allen,

I would like to thank you very much for your help with Forte 3.0 and WTK 1.0.1 beta.

Thank you for the pointing me to the ForteJ2MEGuide.pdf file. It is very useful document.

However, even following it I did not succeeded in accomplishing my task.

I was able to follow the instructions and create, compile and run the Hello midlet which

was generated by the IDE. My previous problem related to the fact that I did not create

project and midlet suite for the midlet. After doing all of that the generated midlet worked. However, it was not what I wanted.

First, the instructions in the guide only described how to generate new midlet. I tried

to add the existing midlet to the current project. Unfortunately, the IDE always picked

up the generated template, not my code.

Second, when the generated midlet started to work, it was difficult to debug it. I set

up the breakpoint, but the IDE did not stop at it. I think the reason is the compiler

did not have debugging flag set up. Do you know where it is possible to set it up?

So, at the end I still cannot accomplish very simple task which should not be very

difficult at all:

1. Use my own code to create a midlet.

2. Compile and execute the midlet and see how it runs in emulator.

3. See step-by-step execution of every line of my code and the value

of every variable in the code.

Regards,

Jacob Nikom

jacob1 at 2007-7-1 15:25:01 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

Hi,

I have similar problems:

1. Cannot create a midlet that will use an existing class (wizard doesn't take the last option "Use existing class"; disables Next and Finish buttons).

and even more importantly,

2. Debugger doesn't connect to KVM. I figured out that you need to explicitly load onto POSE the MIDP_g.prc and check "Redirect NetLib calls to host PC". I even tried to set the Port in the same dialog to the same that the Forte is using. As a result, I'm getting the KVM on the POSE to stop at startup saying "Waiting for debugger", and the debugger is saying "connecting to localhost:5500". But they don't connect and finally KVM times out and continue w/o the debugger connected.

Have you tried these things?

Stan Berka

stanberka at 2007-7-1 15:25:01 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
Actually, I succeeded debugging the midlet using the procedure in my previous message. Only that the Port on the POSE doesn't seem to be relevant. I have actually set the Serial Comm. to None on POSE.So, it's working!!!Stan Berka
stanberka at 2007-7-1 15:25:01 > top of Java-index,Java Mobility Forums,Java ME Technologies...