• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding external classes? Please help...

 
Jerry A. Shaw
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to add some external classes from Motorola. I'm using KToolbar and developing for an i95cl mobile phone.
When I put their i95clStubclasses.zip file (which holds their stubbed classes) into the apps\lib directory (per the directions in the i95cl's Developers' Guide - although I admit to reading between the lines), KToolbar seems to find it and compiles everything ok, but it coughs up the following during preverification:

"Error preverifying class MidiPlayer
Class loading error: Wrong name..."

I've checked to make sure that the path inside the .zip file matches the package in my file. I've also tried extracting the MidiPlayer.class file into a com\motorola\midi directory on my classpath, but that didn't work either.

Any thoughts or suggestions would be greatly appreciated. Thanks!
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What JDK version do you use to compile your MIDlets? JDK 1.4 will cause errors. See this tread for more info.
 
Jerry A. Shaw
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've read the thread you mentioned. I'm not compiling by hand, though, I'm using KToolbar and the thread you referred me to specifically says that if you use KToolbar you shouldn't see this problem.
The external classes may have been compiled by another version of JDK, but I'm not sure what to do about that, if anything.
Any other ideas/suggestions?
Thanks,
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have only two suggestions.
1. Check out this thread
2. If that does not answer your question and the class giving preverify errors is in the downloaded lib, the lib might come pre-verified. You can skip the pre-verify step and pakc the lib files directly in your final JAR?
 
Jerry A. Shaw
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had tried putting the .zip file in that directory already (the one mentioned in the thread) but it didn't help my problem. It allowed me to compile but not to preverify.
It is possible that it is preverified. I'll check that next.
Thank you for your help. Any other thoughts and ideas are welcome.
Jerry Shaw
 
Jerry A. Shaw
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem has evolved, so let me update the status and tell you what I've learned so far. To re-cap:
I am developing an application for Motorola's i95cl. The phone has the abiity to play midi files from J2ME via an OEM add-on class (MidiPlayer). Per the i95cl's developers' manual instructions, I downloaded the stubbed classes and placed the zip file in kToolBar's lib/apps directory. The results are described in my previous posts.
I then tried extracting MidiPlayer.class and placing it into an appropriate directory (com/motorola/...midi). At first I had the same problem as before, but then the preverification problem went away when I stopped trying to use kToolBar and used a batch file with the standard command line calls instead.
I was able to build a jar/jad pair, which downloaded to the phone just fine. But, when I attempted to install (as opposed to download it)it on the phone, during the "Loading Classes" step, I received an error message: "VM Error". I have lived with this error for over 5 days now.
Searching the boards resulted in several leads, but nothing has panned out. Among the things I've looked into are:
1. Looked for classes that are no longer used, but are included in the jad (this problem is caused by Motorola's verifying routine somehow).
2. "Formatting" and "Resetting" the Java system on the phone (per Motorola's tech guy).
3. Re-downloading the stubbed classes in case they were corrupt (no change).
4. Reading and re-reading web sites, manuals, and books (headache and general grumpiness).
I next downloaded Motorola's own latest SDK and modelled my project on their demos. I then rebuilt using the same batch file they use for their demos. None of this caused any change in the symptoms. I then took one of their demo apps and put two lines of code in; one importing the MidiPlayer class, the other calling MidiPlayer.play. It didn't work either, but when I remove the line, it installs fine.
In desperation, I contacted Motorola Tuesday of this week and they asked me to send an example of the behavior to them, which I did. I just received a msg today (Friday) saying that it works fine for them!! In other words - sorry, we can't help.
What could be going on? It has just occured to me that they might be compiling with the actual classes (as opposed to the stubbed classes I'm using). What else could be different? I'm calling them again and I'd like some ideas, please...!?
Thanks!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic