List of usage examples for java.rmi RemoteException getMessage
public String getMessage()
From source file:de.willuhn.jameica.hbci.passports.pintan.Controller.java
/** * Testet die Konfiguration.//from w w w . j a va 2 s . c om */ public synchronized void handleTest() { // Speichern, damit sicher ist, dass wir vernuenftige Daten fuer den // Test haben und die auch gespeichert sind if (!handleStore()) return; try { new PassportTest().handleAction(new PassportHandleImpl(getConfig())); } catch (ApplicationException ae) { GUI.getStatusBar().setErrorText(ae.getMessage()); } catch (RemoteException e) { Logger.error("error while testing passport", e); GUI.getStatusBar() .setErrorText(i18n.tr("Fehler beim Testen der Konfiguration. Bitte prfen Sie das Protokoll. ") + e.getMessage()); } }
From source file:de.ipbhalle.metfrag.pubchem.PubChemWebService.java
/** * PubChem get hits by sum formula. TODO: fix inefficient smiles generation * //from w w w . j a v a 2s. c om * @param sumFormula the sum formula * * @return the vector< string> * * @throws Exception the exception */ public Vector<String> getHitsbySumFormula(String sumFormula, boolean useProxy) throws Exception { Vector<String> candidatesString = new Vector<String>(); PUGLocator pug_locator = new PUGLocator(); PUGSoap pug_soap = pug_locator.getPUGSoap(); MFSearchOptions mf_options = new MFSearchOptions(); mf_options.setAllowOtherElements(false); String listKey = pug_soap.MFSearch(sumFormula, mf_options, null); System.out.println("MFSearch " + sumFormula + " " + listKey); StatusType status; while ((status = pug_soap.getOperationStatus(listKey)) == StatusType.eStatus_Running || status == StatusType.eStatus_Queued) { System.out.println("Waiting for query to finish..."); Thread.sleep(10000); } int[] cids = null; //get cids try { cids = pug_soap.getIDList(listKey); } catch (RemoteException e) { System.err.println("Error: No hit!?" + e.getMessage()); return candidatesString; } String listkey = pug_soap.inputList(cids, PCIDType.eID_CID); String downloadKey = pug_soap.download(listkey, FormatType.eFormat_SDF, CompressType.eCompress_None, false); status = null; System.out.print("Waiting for download to finish..."); while ((status = pug_soap.getOperationStatus(downloadKey)) == StatusType.eStatus_Running || status == StatusType.eStatus_Queued) { System.out.print("."); Thread.sleep(1000); } System.out.println(); // On success, get the download URL, save to local file if (status == StatusType.eStatus_Success) { // PROXY if (useProxy) { System.getProperties().put("ftp.proxySet", "true"); System.getProperties().put("ftp.proxyHost", "www.ipb-halle.de"); System.getProperties().put("ftp.proxyPort", "3128"); } URL url = new URL(pug_soap.getDownloadUrl(downloadKey)); System.out.println("Success! Download URL = " + url.toString()); // get input stream from URL URLConnection fetch = url.openConnection(); InputStream input = fetch.getInputStream(); // open local file based on the URL file name File tempFile = File.createTempFile( url.getFile().substring(url.getFile().lastIndexOf(System.getProperty("file.separator"))), ".sdf"); // Delete temp file when program exits. tempFile.deleteOnExit(); FileOutputStream output = new FileOutputStream(tempFile); // buffered read/write byte[] buffer = new byte[10000]; int n; while ((n = input.read(buffer)) > 0) output.write(buffer, 0, n); output.close(); //read the file FileInputStream in = null; in = new FileInputStream(tempFile); //IChemObjectReader cor = null; //cor = new ReaderFactory().createReader(in); MDLV2000Reader reader = new MDLV2000Reader(in); ChemFile fileContents = (ChemFile) reader.read(new ChemFile()); //ReaderFactory factory = new ReaderFactory(); //ISimpleChemObjectReader reader = factory.createReader(in); //IChemFile content = (IChemFile)reader.read(new ChemFile()); //IChemFile content = (IChemFile)cor.read(DefaultChemObjectBuilder.getInstance().newChemFile()); this.containers = ChemFileManipulator.getAllAtomContainers(fileContents); System.out.println("Got " + containers.size() + " atom containers"); // Retrieve CIDs SmilesGenerator generatorSmiles = new SmilesGenerator(); for (int i = 0; i < cids.length; i++) { candidatesString.add(cids[i] + ""); this.retrievedHits.put(cids[i], generatorSmiles.createSMILES( fileContents.getChemSequence(0).getChemModel(i).getMoleculeSet().getMolecule(0))); } } else { System.out.println("Error: " + pug_soap.getStatusMessage(downloadKey)); } return candidatesString; }
From source file:com.collabnet.ccf.pi.sfee.v44.TimeoutWrapper.java
/** * This method determines whether the exception is timeout related and will * be handled in this method or whether it should be handled by another * layer/*w ww . j av a 2s . c o m*/ * * @param e * exception that was intercepted * @param numberOfTries * number this method was already called for the same method * call, this will help to determine the timeout * @param connectionManager * this object is used to retrieve timeout related configuration * parameters * @return true if exception was handled here and method call should be * retried, false if exception should be passed to next layer * @throws RemoteException */ protected boolean handleException(RemoteException e, int numberOfTries, ConnectionManager<Connection> connectionManager) throws RemoteException { if (!connectionManager.isEnableRetryAfterNetworkTimeout()) throw e; int msToSleep = (numberOfTries - 1) * connectionManager.getRetryIncrementTime(); int maxMsToSleep = connectionManager.getMaximumRetryWaitingTime(); Throwable cause = e.getCause(); if (cause instanceof java.net.SocketException || cause instanceof java.net.UnknownHostException) { if (numberOfTries == 1) { // first try, long error message log.warn("Network related problem occurred while calling TF/CSFE webservice. Try operation again", e); } else if (msToSleep < maxMsToSleep) { // error occurred again, short error message, go to sleep // we switched to a linear increase of the timeout value, may // have to revisit this decision later // int timeOut = (int) Math.pow(2, numberOfTries); log.warn("Network related error occurred again (" + e.getMessage() + "), incremented timeout, now sleeping for " + msToSleep + " milliseconds."); try { Thread.sleep(msToSleep); } catch (InterruptedException e1) { log.error("Interrupted sleep in timeout method: ", e1); } } else { log.warn("Network related error occurred again, switched to maximum waiting time (" + e.getMessage() + "), sleeping for " + maxMsToSleep + " milliseconds."); try { Thread.sleep(maxMsToSleep); } catch (InterruptedException e1) { log.error("Interrupted sleep in timeout method: ", e1); } } return true; } else return false; }
From source file:ReportGen.java
private void residentsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_residentsItemStateChanged try {/* ww w .jav a 2 s. c o m*/ if (residents.getItemCount() > 0) { String resident = residents.getSelectedItem().toString(); weeklyPreviewOfLate(client.getResidentId(resident)); } } catch (RemoteException ex) { // Logger.getLogger(ReportGen.class.getName()).log(Level.SEVERE, null, ex); new MessageDialog().error(this, ex.getMessage()); } }
From source file:ReportGen.java
private void weeklyPreviewOfLate(String residentId) { try {//from w w w . j a v a2 s.c om exportcounttableexcel.setEnabled(true); exportcounttablepdf.setEnabled(true); // exportgraphtoimage.setEnabled(true); tableModel = (DefaultTableModel) dataTable.getModel(); tableModel.getDataVector().removeAllElements(); tableModel.fireTableDataChanged(); String str[] = { "Months", "Values" }; tableModel.setColumnIdentifiers(str); ChartPanel chartPanel; displaypane.removeAll(); displaypane.revalidate(); displaypane.repaint(); displaypane.setLayout(new BorderLayout()); //row String series1 = "Results"; //column, String days[] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; String resident = residents.getSelectedItem().toString(); int value[] = new int[12]; int c = 0; for (String day : days) { value[c] = client.getDailyReport("0" + (c + 1), client.getResidentId(resident)); c++; } for (int i = 0; i < days.length; i++) { tableModel.addRow(new Object[] { days[i], value[i] }); } DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(value[0], series1, days[0]); dataset.addValue(value[1], series1, days[1]); dataset.addValue(value[2], series1, days[2]); dataset.addValue(value[3], series1, days[3]); dataset.addValue(value[4], series1, days[4]); dataset.addValue(value[5], series1, days[5]); dataset.addValue(value[6], series1, days[6]); chart = ChartFactory.createBarChart("181 North Place Residences Graph", // chart title "Months of the Year 2014", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); // set the background color for the chart... chart.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); // set the range axis to display integers only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); final org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); chartPanel = new ChartPanel(chart); displaypane.add(chartPanel, BorderLayout.CENTER); } catch (RemoteException ex) { // Logger.getLogger(ReportGen.class.getName()).log(Level.SEVERE, null, ex); new MessageDialog().error(this, ex.getMessage()); } }
From source file:ReportGen.java
private void monthlyPreview2014Reservation() throws NumberFormatException { try {/* w ww. j ava2 s .c o m*/ exportcounttableexcel.setEnabled(true); exportcounttablepdf.setEnabled(true); // exportgraphtoimage.setEnabled(true); tableModel = (DefaultTableModel) dataTable.getModel(); tableModel.getDataVector().removeAllElements(); tableModel.fireTableDataChanged(); String str[] = { "Months", "Values" }; tableModel.setColumnIdentifiers(str); ChartPanel chartPanel; displaypane.removeAll(); displaypane.revalidate(); displaypane.repaint(); displaypane.setLayout(new BorderLayout()); //row String series1 = "Results"; //column, String months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; String yr = datecombobox.getSelectedItem().toString(); int value[] = new int[12]; int c = 0; for (String month : months) { value[c] = client.getCountMonthlyReportReservation("0" + (c + 1), yr); c++; } for (int i = 0; i < months.length; i++) { tableModel.addRow(new Object[] { months[i], value[i] }); } DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(value[0], series1, months[0]); dataset.addValue(value[1], series1, months[1]); dataset.addValue(value[2], series1, months[2]); dataset.addValue(value[3], series1, months[3]); dataset.addValue(value[4], series1, months[4]); dataset.addValue(value[5], series1, months[5]); dataset.addValue(value[6], series1, months[6]); dataset.addValue(value[7], series1, months[7]); dataset.addValue(value[8], series1, months[8]); dataset.addValue(value[9], series1, months[9]); dataset.addValue(value[10], series1, months[10]); dataset.addValue(value[11], series1, months[11]); chart = ChartFactory.createBarChart("181 North Place Residences Graph", // chart title "Months of the Year 2014", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); // set the background color for the chart... chart.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); // set the range axis to display integers only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); final org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); chartPanel = new ChartPanel(chart); displaypane.add(chartPanel, BorderLayout.CENTER); } catch (RemoteException ex) { // Logger.getLogger(ReportGen.class.getName()).log(Level.SEVERE, null, ex); new MessageDialog().error(this, ex.getMessage()); } }
From source file:ReportGen.java
private void yearlyPreview(String table) throws NumberFormatException { try {//from w w w. ja v a2 s. co m exportcounttableexcel.setEnabled(true); exportcounttablepdf.setEnabled(true); // exportgraphtoimage.setEnabled(true); tableModel = (DefaultTableModel) dataTable.getModel(); tableModel.getDataVector().removeAllElements(); tableModel.fireTableDataChanged(); String str[] = { "Months", "Values" }; tableModel.setColumnIdentifiers(str); ChartPanel chartPanel; displaypane.removeAll(); displaypane.revalidate(); displaypane.repaint(); displaypane.setLayout(new BorderLayout()); //row String series1 = "Results"; //column, String years[] = { "2014", "2015", "2016", "2017", "2018", "2019", "2020" }; int value[] = new int[7]; int c = 0; switch (table) { case "Reservation": for (String year : years) { value[c] = client.getCountYearlyReportReservation(year); c++; } break; case "Registration": for (String year : years) { value[c] = client.getCountYearlyReportRegistration(year); c++; } break; } for (int i = 0; i < years.length; i++) { tableModel.addRow(new Object[] { years[i], value[i] }); } DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(value[0], series1, years[0]); dataset.addValue(value[1], series1, years[1]); dataset.addValue(value[2], series1, years[2]); dataset.addValue(value[3], series1, years[3]); dataset.addValue(value[4], series1, years[4]); dataset.addValue(value[5], series1, years[5]); dataset.addValue(value[6], series1, years[6]); chart = ChartFactory.createBarChart("181 North Place Residences Graph", // chart title "Months of the Year 2014", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); // set the background color for the chart... chart.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); // set the range axis to display integers only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); final org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); chartPanel = new ChartPanel(chart); displaypane.add(chartPanel, BorderLayout.CENTER); } catch (RemoteException ex) { // Logger.getLogger(ReportGen.class.getName()).log(Level.SEVERE, null, ex); new MessageDialog().error(this, ex.getMessage()); } }
From source file:ReportGen.java
private void monthlyPreview(String year, String table) throws NumberFormatException { try {//from w w w . ja va 2 s .c om exportcounttableexcel.setEnabled(true); exportcounttablepdf.setEnabled(true); // exportgraphtoimage.setEnabled(true); tableModel = (DefaultTableModel) dataTable.getModel(); tableModel.getDataVector().removeAllElements(); tableModel.fireTableDataChanged(); String str[] = { "Months", "Values" }; tableModel.setColumnIdentifiers(str); ChartPanel chartPanel; displaypane.removeAll(); displaypane.revalidate(); displaypane.repaint(); displaypane.setLayout(new BorderLayout()); //row String series1 = "Results"; //column, String months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; String yr = year; int value[] = new int[12]; int c = 0; switch (table) { case "Reservation": for (String month : months) { value[c] = client.getCountMonthlyReportReservation("0" + (c + 1), yr); c++; } break; case "Registration": for (String month : months) { value[c] = client.getCountMonthlyReportRegistration("0" + (c + 1), yr); c++; } break; case "Bill": for (String month : months) { String result = client.getMonthlyBillingReport("0" + (c + 1), yr); if (result != null) { String[] dates = result.split("-"); if (Integer.parseInt(dates[2]) > 5) { value[c] += 1; } } c++; } break; } for (int i = 0; i < months.length; i++) { tableModel.addRow(new Object[] { months[i], value[i] }); } DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(value[0], series1, months[0]); dataset.addValue(value[1], series1, months[1]); dataset.addValue(value[2], series1, months[2]); dataset.addValue(value[3], series1, months[3]); dataset.addValue(value[4], series1, months[4]); dataset.addValue(value[5], series1, months[5]); dataset.addValue(value[6], series1, months[6]); dataset.addValue(value[7], series1, months[7]); dataset.addValue(value[8], series1, months[8]); dataset.addValue(value[9], series1, months[9]); dataset.addValue(value[10], series1, months[10]); dataset.addValue(value[11], series1, months[11]); chart = ChartFactory.createBarChart("181 North Place Residences Graph", // chart title "Months of the Year 2014", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); // set the background color for the chart... chart.setBackgroundPaint(Color.white); // get a reference to the plot for further customisation... final CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); // set the range axis to display integers only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.lightGray); final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.lightGray); renderer.setSeriesPaint(0, gp0); renderer.setSeriesPaint(1, gp1); renderer.setSeriesPaint(2, gp2); final org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)); chartPanel = new ChartPanel(chart); displaypane.add(chartPanel, BorderLayout.CENTER); } catch (RemoteException ex) { // Logger.getLogger(ReportGen.class.getName()).log(Level.SEVERE, null, ex); new MessageDialog().error(this, ex.getMessage()); } }
From source file:com.lp.server.artikel.ejbfac.WebshopItemServiceEjb.java
@Override public ShopgroupResult getShopGroupFindByCnr(WebshopAuthHeader header, String name) { if (HelperWebshop.isEmptyString(name)) { return new ShopgroupResult(BaseRequestResult.ERROR_NULL_PARAMETER, "name == null (or blank/empty)"); }/*w ww. ja v a 2s . c o m*/ setupSessionParams(header); try { ShopgruppeDto sgDto = getArtikelFac().shopgruppeFindByCNrMandantOhneExc(name, webClientDto); if (null == sgDto) return new ShopgroupResult(ShopgroupResult.ERROR_NOT_FOUND, name); ShopgroupResult sgResult = retrieveWebShopgroup(sgDto, name); return sgResult; } catch (RemoteException ex) { return new ShopgroupResult(BaseRequestResult.ERROR_RMI_EXCEPTION, ex.getMessage()); } catch (EJBExceptionLP ex) { return new ShopgroupResult(BaseRequestResult.ERROR_EJB_EXCEPTION + ex.getCode(), ex.getMessage()); } }
From source file:com.lp.server.artikel.ejbfac.WebshopItemServiceEjb.java
@Override public ShopgroupResult getShopGroupFindById(WebshopAuthHeader header, Integer id) { if (null == id) { return new ShopgroupResult(BaseRequestResult.ERROR_NULL_PARAMETER, "id == null"); }//from w w w.j a va 2 s. c om setupSessionParams(header); try { ShopgruppeDto sgDto = getArtikelFac().shopgruppeFindByPrimaryKey(id, webClientDto); if (null == sgDto) return new ShopgroupResult(ShopgroupResult.ERROR_NOT_FOUND, id.toString()); ShopgroupResult sgResult = retrieveWebShopgroup(sgDto, id.toString()); return sgResult; } catch (RemoteException ex) { return new ShopgroupResult(BaseRequestResult.ERROR_RMI_EXCEPTION, ex.getMessage()); } catch (EJBExceptionLP ex) { return new ShopgroupResult(BaseRequestResult.ERROR_EJB_EXCEPTION + ex.getCode(), ex.getMessage()); } }