/** * Here we can butify error message text. * @param throwable * @return */ public static String getCauseMessage(Throwable throwable) { if (throwable.getCause() == null) { return throwable.toString(); } else { return getCauseMessage(throwable.getCause()); } }
} catch (IOException e) { Message.error("Error reading file: " + fileChooser.getSelectedFile().getName() + ", " + Message.getCauseMessage(e), e); return; } finally { J2SEDevice.class)); } catch (IOException e) { Message.error("Error parsing device profile, " + Message.getCauseMessage(e), e); return; Message.error("Error adding device profile, " + Message.getCauseMessage(e), e); return;
urls[0] = file.toURL(); } catch (IOException ex) { Message.error("Error reading file: " + fileDialog.getFileName() + ", " + Message.getCauseMessage(ex), ex); return; DeviceImpl.create(emulatorContext, classLoader, entry.getName())); } catch (IOException ex) { Message.error("Error parsing device profile, " + Message.getCauseMessage(ex), ex); return; Message.error("Error adding device profile, " + Message.getCauseMessage(ex), ex); return;
return true; } catch (MalformedURLException e) { Message.error(errorTitle, errorTitle + ", " + Message.getCauseMessage(e), e); } catch (IOException e) { Message.error(errorTitle, errorTitle + ", " + Message.getCauseMessage(e), e); } catch (Throwable e) { Message.error(errorTitle, errorTitle + ", " + Message.getCauseMessage(e), e);
Message.error("Unable to destroy MIDlet, " + Message.getCauseMessage(e), e); Message.error(errorTitle, "Unable to create MIDlet, " + Message.getCauseMessage(e), e); MIDletBridge.destroyMIDletContext(context); return null; return context; } catch (Throwable e) { Message.error(errorTitle, "Unable to start MIDlet, " + Message.getCauseMessage(e), e); MIDletBridge.destroyMIDletContext(context); return null;
midletClass = classLoader.loadClass(midletClassOrUrl); } catch (MalformedURLException e) { Message.error("Error", "Unable to find MIDlet class, " + Message.getCauseMessage(e), e); return; } catch (NoClassDefFoundError e) { Message.error("Error", "Unable to find MIDlet class, " + Message.getCauseMessage(e), e); return; } catch (ClassNotFoundException e) { Message.error("Error", "Unable to find MIDlet class, " + Message.getCauseMessage(e), e); return; midletClass = instance.getClass().getClassLoader().loadClass(midletClassOrUrl); } catch (ClassNotFoundException e) { Message.error("Error", "Unable to find MIDlet class, " + Message.getCauseMessage(e), e); return;
private MIDletClassLoader createMIDletClassLoader(boolean forJad) { MIDletClassLoader mcl = new MIDletClassLoader(getExtensionsClassLoader()); if (!Serializable.class.isAssignableFrom(Injected.class)) { Logger.error("classpath configuration error, Wrong Injected class detected. microemu-injected module should be after microemu-javase in eclipse"); } if (mIDletClassLoaderConfig != null) { try { mcl.configure(mIDletClassLoaderConfig, forJad); } catch (MalformedURLException e) { Message.error("Error", "Unable to find MIDlet classes, " + Message.getCauseMessage(e), e); } } mcl.disableClassPreporcessing(Injected.class); mcl.disableClassPreporcessing(MIDletThread.class); mcl.disableClassPreporcessing(MIDletTimer.class); mcl.disableClassPreporcessing(MIDletTimerTask.class); MIDletResourceLoader.classLoader = mcl; return mcl; }
protected void startLauncher(MIDletContext midletContext) { if ((midletContext != null) && (midletContext.isLauncher())) { return; } if (midletContext != null) { try { MIDletAccess previousMidletAccess = midletContext.getMIDletAccess(); if (previousMidletAccess != null) { previousMidletAccess.destroyApp(true); } } catch (Throwable e) { Logger.error("destroyApp error", e); } if (exitOnMIDletDestroy) { System.exit(0); } } try { launcher = new Launcher(this); MIDletBridge.getMIDletAccess(launcher).startApp(); launcher.setCurrentMIDlet(launcher); } catch (Throwable e) { Message.error("Unable to start launcher MIDlet, " + Message.getCauseMessage(e), e); handleStartMidletException(e); } finally { MIDletBridge.setThreadMIDletContext(null); } }