BlackBerry javaclassnotfoundexception

12 messages - 2775 views

Hi,

I have a big big problem. I created an application with kuix and I have transformed from jad and jar files into a cod file to be able to load program on the blackberry emulator.The problem is that when I start the program with blackberry emulator I receive more errors JavaClassNotFoundException, first of them for KuixCanvas.

I have made the same thing with the kuixdemo example presented by you on the site. And the same problem, i cannot launch the program on blackberry platform.

The command that I use it (from command prompt) for transformation is :

C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\bin>rapc.exe -midlet import="C:\Program Files\Research In Motion\BlackBerry JDE 4.6.0\lib\net_rim_api.jar" codename=D:\NetBeansProjects\kuixdemo_BB D:\NetBeansProjects\kuixdemo.jad D:\NetBeansProjects\kuixdemo.jar

Also, have somebody launch the programs for BB and it works?

Any solution for this?

Thanks

Did you test it on a real BlackBerry phone or only on the emulator.

Those exceptions come from the platform auto-detection. This is resulting exceptions on BlackBerry emulator event if those exception are surrounded by a try {} catch.

No, only on emulator.

Thanks for reply. I will notice you if it is ok.

Hi again,

 

The exceptions which are surrounded by try{} catch can be avoid from edit, debugging settings.

Now the application starts, but no key event is generated. I took the latest version from  svn for kuix and kutil and I have made jars from them. I have put a system.out at the start of processkeyevent() method from KuixCanvas and no action is received when i press a key. Where is the problem? Your kuix demo works on BB, but my application no and curious is that no event is found by the kuixCanvas. Any key I press nothing is happen. Have you a solution for this?

Have you a jar file for kuix which really works on bb?

I have some more tests and with the same custom kuix and kutil jar your application works and mine not. I have put system.out in keyPressed, keyReleased and keyRepeated methods and for my applicaiton these methods are never called when i press a key. There is a listener or something to set to catch the events in canvas? I notice that my application is fully developped only in java code.

HI,

I have investigated a little your kuix demo application and it looks that only key soft right and key soft left are supported. If I press enter, nothing is happened. Has kuix support for all keys for blackberry or not?

JavaME and then Kuix include native mapping only on numeric keys and direction keys. Then if you use a Querty BlackBerry, you won't be able to use all alpha keys as shortcuts for example.

But BB querty keyboard is a real problem because the Canvas.getGameAction(keyCode) could returns direction key for some alpha keys ...

Else on a BB, the Enter key do no return the same code as Fire (press on the trackball), and the focus request is don on the Fire keyPressed event.

Ok, thanks for reply. About the problem that no event is received in kuixCanvas have you any ideea about what can generate this?

Do you extends the KuixMIDlet to create the application ?

 

You can download on SVN KuixKeyValidator MIDlet sources to check key mapping.

Hi!

With respect to ClassNotFoundException on BlackBerry handsets I experienced the same and resolved it with a BlackBerry specific build of the Kuix framework.

(I use the BlackBerry JDE side-by-side with Netbeans but I build my BlackBerry apps using the JDE. It just makes life easier when deploying. Anyway, to get to the point:....)

Tofu is right when saying:

Those exceptions come from the platform auto-detection.

 When you are building specifically for BlackBerry you don't need to auto-detect the platform (coz you know you are building for BlackBerry). Therefore it makes sense to remove the platform detection code from the KuixCanvas class.

Here's how I did it (Be advised - you are doing this at your own risk. Back up before you try this!)

OPEN:
org.kalmeo.kuix.core.KuixCanvas;

FIND METHOD:
getPlatform();

DO:
Remove all try{}catch() blocks that contains Class.forName("nothingToDoWithBlackBerry") - where nothingToDoWithBlackBerry=classNames that are used to detect Non-BB platforms.

This is what my new getPlatform method looks like:

        /**
         * Returns mobile phone platform
         *
         * @return name mobile phone platform
         */
        private String getPlatform() {               
                return KuixConstants.PLATFORM_BLACKBERRY;
        }

Worked for me and tested and several BB handsets.

Let me know if there was a better way of doing this.

Friendly greetings from Sunny South Africa!

PS. If you haven't yet bought a Kuix license please consider doing so ASAP. We need to support this project. It is possibly the best effort at a portable GUI for J2ME around. I have tried many and nothing compares. Buy a license!