Link to home
Start Free TrialLog in
Avatar of bbdriver
bbdriver

asked on

Creating Images - JavaME

I am creating images using the following code..However, my app will stop after printing out STATEMENT 3 which means I can't use Image image = Image.createImage(input);

Is there anyway I can ctach this type of excpetion beside IOexception and Exception?
Does anyone have any idea? Thank in advance.

FileConnection filenames = (FileConnection)Connector.open(main_directory +  "testFolder" + "/"
                                                + imageName ,Connector.READ);
InputStream input = filenames.openInputStream();
try {
                                                Logger.logEventInfo("STATEMENT 3");
                                                Image image = Image.createImage(input);
                                                Logger.logEventInfo("READING: " + imageName +"\n");
                                                Logger.logEventInfo("STATEMENT 4");
                                                if(image != null){               
                                                      Logger.logEventInfo("STATEMENT 5");                                                
                                                }
                                                else continue;                                      
                                                Logger.logEventInfo("STATEMENT 7");
                                          }
                                          catch (IOException e) {
                                                Logger.logEventInfo("STATEMENT 8");                                                
                                                description = e.toString();
                                                Logger.logEventInfo("STATEMENT 9");
                                                Logger.logEventInfo("READING: " + imageName +"\n");
                                          } catch (Exception e)  {
                                                Logger.logEventInfo("STATEMENT 11");
                                                Exceptiondescription = e.toString();
                                                Logger.logEventInfo("STATEMENT 12");                                                
                                                updateContent("READING: " + imageName);      
                                                Logger.logEventInfo("READING: " + imageName +"\n");
                                                Logger.logEventInfo("STATEMENT 13");
                                          }                              
                                          Logger.logEventInfo("STATEMENT 14");
                                          input.close();
Avatar of Shura85
Shura85
Flag of United States of America image

Can you show the code you use to get and configure the logger?  That might provide some insight into why it is throwing an error to begin with.  
Avatar of bbdriver
bbdriver

ASKER

I am not sure if it's about the logger cause some of other images are able to pass STATEMENT 3 and goes into either createimage or Exception. However, for some image, it was unable to go anywhere
What kind can I use to catch the exception beside IOException and Exception?
ASKER CERTIFIED SOLUTION
Avatar of Shura85
Shura85
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial