Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Getting exceptions when uploading a file from blackberry

Which version of the WebWorks SDK are you using?

 

I don't know really where to go from here.. if you used my exact code, I tried this on the same build for the same phone. :smileysad:

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
amitgaur06
Posts: 20
Registered: ‎09-06-2011
My Device: torch
My Carrier: Airtel

Re: Getting exceptions when uploading a file from blackberry

Hi Tim,

 

I created the same picker application from Blackberry SDK andsame exception is also coming with this.

Is there anything wrong with my device that it is not populating the FilePicker? Please let me know :smileysad:

Following is the code

 


import net.rim.device.api.ui.UiApplication;

 

public class MyApp extends UiApplication
{
    public static void main(String[] args)
    {   
        MyApp theApp = new MyApp();
        theApp.enterEventDispatcher();
    }
    public MyApp()
    {
        pushScreen(new FilePickScreen());
    } 
}


 

import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.picker.FilePicker;

public class FilePickScreen extends MainScreen {

    public FilePickScreen()
    {
        setTitle("File Picker Sample");
        add(new LabelField("Trying File Picker"));
       
        UiApplication.getUiApplication().invokeLater(new Runnable()
        {
            public void run()
            {
                FilePicker fp = FilePicker.getInstance();
                FilePickListener fileListener = new FilePickListener();
                fp.setListener(fileListener);          
                fp.show(); 
            }
        });
    }
}
class FilePickListener implements FilePicker.Listener
{  
    public void selectionDone(String str)
    {
        Dialog.alert("You selected " + str);
    }
}

 

 

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Getting exceptions when uploading a file from blackberry

Jerome had mentioned some problems with File Picker on OS 6 in the past.  The weird part is that when I load the same build that you are using on the device it works without any issues.

 

Maybe reach out to him to see if he has been able to reproduce your issue.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
amitgaur06
Posts: 20
Registered: ‎09-06-2011
My Device: torch
My Carrier: Airtel

Re: Getting exceptions when uploading a file from blackberry

Hi Tim,

Thanks for looking in my problem so deep.

 

I found one thread discussing same problem of FilePicker and following is the link

http://supportforums.blackberry.com/t5/Java-Development/Is-FilePicker-broken-in-OS6-too/td-p/570253

 

Further, One of its post said that the following is a workaround though it is not a neat one

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800256/...

 

Right now I have used the above workaround and was able to do it successfully but still need the FilePicker as it is the best way.

Can you share me the Jerome profile/link as I was not able to found him.

Thanks again.

Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Getting exceptions when uploading a file from blackberry

Jerome is JCarty on the forums.. you can try reaching out via a PM.

 

If I knew which OS versions had a problem then I could encorporate the work around into my extension... Is there a specific exception that is thrown on the FilePicker Java API that I could trap and then provide the work around dialog?

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
amitgaur06
Posts: 20
Registered: ‎09-06-2011
My Device: torch
My Carrier: Airtel

Re: Getting exceptions when uploading a file from blackberry

The Exception coming is NoClassDefFoundError.
Also it is not very clear which class it is not finding in the classpath. I already try to put a try-catch block in the run method in the FunctionOpenPicker.
It throws the exception exactly on fp.show();
But my try/catch is also not catching the exception and it is weird why it is happening.
Following are the logs of the event logger.

Name: NoClassDefFoundError
GUID: 9c3cd62e3320b498
Time: Sep 24, 2011 20:09:42
No detail message
net_rim_bb_file_explorer_

library-6(4C94D68E)
FileSystemExploreManager
<init>
0x1677
net_rim_bb_file_explorer_library-6(4C94D68E)
FileSystemExploreManager
<init>
0x15F0
net_rim_bb_file_explorer_library-1(4C94D68E)
DocumentExploreScreen
<init>
0x3B03
net_rim_bb_file_explorer_library-6(4C94D68E)
FileSelectionVerb$ScreenProvider
createContextScreen
0x91B
net_rim_bb_file_explorer_library-6(4C94D68E)
FileSelectionVerb$ScreenProvider
getContextScreen
Please use plain text.
Contributor
amitgaur06
Posts: 20
Registered: ‎09-06-2011
My Device: torch
My Carrier: Airtel

Re: Getting exceptions when uploading a file from blackberry

Looking at the exception it tries to find FileSystemExploreManager class some library named net_rim_bb_file_explorer_library-6
It must be internal library of RIM and all the application must be using (including the core apps like Files) this class to open the File Explorer.
Please correct me if I am wrong.
Please use plain text.
BlackBerry Development Advisor
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Getting exceptions when uploading a file from blackberry

I do not know if you are wrong or not.... your delving into depths that I'm not familiar with :smileyhappy:

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Contributor
amitgaur06
Posts: 20
Registered: ‎09-06-2011
My Device: torch
My Carrier: Airtel

Re: Getting exceptions when uploading a file from blackberry

No Tim, I also don't know about the internal frameworks :smileyhappy: but was drilling down in the exception.
While googling I found that the library mentioned above may have been incorrectly installed on my device. I don't know the steps to repair/re-install the OS on my device. Also, I have to take backup of my messages and other things. Can you help me out in doing this?
Please use plain text.