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

Java Development

Reply
Super Contributor
pg1181
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido

Source not found?

Hi. I'm having more and more trouble trying to get my code to work. It seems that I'm always getting a nullpointerexception, after having checked my code about 10 times and finding nothing wrong. The thing is when I try and debug it, the debugger seems to stop when it wants and says "source not found". What does this error mean?? I'm wasting time trying to figure out where my nullpointerexception is coming from because I can't even debug. Thanks in advance.

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Source not found?

Are you sure it isn't the debugger stopping when the NullPointerException is thrown? If it's similar to this http://supportforums.blackberry.com/t5/BlackBerry-Curve-BlackBerry-8300/Source-not-found/m-p/486605 then it's just saying that it's getting thrown from an object you haven't created (meaning, part of the API) and so it doesn't have the source to show you.

 

If that isn't the case, can you post some code where you think it's happening?

Please use plain text.
Super Contributor
pg1181
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido

Re: Source not found?

I think that the error might be coming from this method. Thanks.

 

public void createTripButtons(Database db)// throws Exception
 {
  Vector myTrips = new Vector();
    
  try
        {         
            // Read in all records from tblTrips
   
            Statement statement = db.createStatement("SELECT * FROM tblTrips"); 
            statement.prepare();
            Cursor cursor = statement.getCursor();
            
            // Iterate through the the result set.  For each row, add a
            // new TripItem object to the vector.
            while(cursor.next())
            {                   
                Row row = cursor.getRow();
               
                String aPnrID = row.getString(0);                                                               
               
                GTGTrip item = new GTGTrip(aPnrID);
                myTrips.addElement(item);
            }
            statement.close();
            cursor.close();
            db.close();
        }
    catch(DatabaseException dbe)
        {
            //SQLiteDemo.errorDialog(dbe.toString());
         Dialog.alert(dbe.toString());
        }
    catch(DataTypeException dte)
        {
            //SQLiteDemo.errorDialog(dte.toString());
         Dialog.alert(dte.toString());
        }
  
 }

Please use plain text.
Developer
Hithredin
Posts: 404
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Source not found?

About "source not found" you have to click on a button and specify yourself your project's URI on worskpace where your source are.

 

Have you tryed catching a NullPointerException on this method?

 

Please use plain text.
Super Contributor
pg1181
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido

Re: Source not found?

I think I've solved my problem (as in my code is working). Still not too sure how the "source not found" thing works but it may have something to do with putting breakpoints on statements that need to be signed, like a lot of the Database methods. The reason my program wasn't working was mainly because I was calling row.getString() when the value of that field was "1". It is a VARCHAR in the database but for some reason it wouldn;t recognize it as a string. I had to say getInteger() instead and it seems to be working fine. Well, back to work (until the next problem arises of course). Thanks for your time.

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Source not found?

"Source not found" occurs when you throw an exception in a module that has no source on your system.  This might happen (for example) when you are failing to initialize something correctly, causing a RIM conponent to throw the NullPointerException.

 

Please use plain text.