Re: Unable to load image, please help
If it's meant for an isolated network, it means you'll not use Google App Engine to host it, right? in this case, why are you enabling it for your project? In Eclipse: Project - Properties - Google - App Engine: uncheck -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Unable to load image, please help
I debugged for some time and realized, that the actual problem is that my server side code doesnt find the JFreeChart external libraries when running. I copied the libraries to /war/WEB-INF/lib but the behaivor still the same. On Jan 27, 10:38 am, Sednus sed...@gmail.com wrote: Hi, Im trying load an image from the server using RPC, the problem is that it always fails to load the image and throws the following error: com.google.gwt.user.client.rpc.StatusCodeException: 403 html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 403 FORBIDDEN/title /head bodyh2HTTP ERROR 403/h2 pProblem accessing /diskmonitor/. Reason: pre FORBIDDEN/pre/phr /ismallPowered by Jetty:///small/ibr/ Im implementing my classes as the following: public class ChartImage extends Image { private UpdatePlotsServiceAsync plotService; public ChartImage(String hostname) { super(); /* * Setup connection to chart generator service. */ plotService = (UpdatePlotsServiceAsync) GWT.create(UpdatePlotsService.class); ServiceDefTarget endpoint = (ServiceDefTarget)plotService; String url = GWT.getModuleBaseURL()+; System.out.println(url); endpoint.setServiceEntryPoint(url); /* * Setup the callback from the chart generator service. */ AsyncCallbackString callback = new AsyncCallbackString() { /* * If the call was successful, we will get back the name of the chart * that was created and stored on the server. */ public void onSuccess(String s) { String chartName = (String)s; String imageUrl = GWT.getModuleBaseURL() + chartName; setUrl(imageUrl); } /* * Something went wrong with the call. Handle the issue how you'd like. */ public void onFailure(Throwable ex) { System.out.println(Failed to load image); ex.printStackTrace(); } }; /* * Make the call to the chart generator service with the previously created * callback. */ plotService.getImagesPaths(default, callback); /* * Since we've made an asynchronous call, we don't need to do anything further. * The callback object will handle the remainder of the work for us. */ } } The image is generated in the server side using JFreeChart public class UpdatePlotsServiceImpl extends RemoteServiceServlet implements UpdatePlotsService { @Override public String getImagesPaths(String hostname) { String chartName = ; /* * Create the data for the pie chart */ DefaultPieDataset dataset = new DefaultPieDataset(); //Fake Data dataset.setValue(Available, 71); dataset.setValue(Used, 39); String title = Data at:+ info.getHostname()+-+ info.getLocation(); JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, false, false); File file = new File(chart.png); //Save the image try { ChartUtilities.saveChartAsPNG(file, chart, 800, 600); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return file.getName(); } } Please help -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Unable to load image, please help
It throws the following errors and they are thrown when I try to create an object of the JFreeChart library: [ERROR] javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.naic.client.UpdatePlotsService.getImagesPaths(java.lang.String)' threw an unexpected exception: java.lang.NoClassDefFoundError: javax.swing.event.EventListenerList is a restricted class. Please see the Google App Engine developer's guide for more details. at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java: 378) ... Caused by: java.lang.NoClassDefFoundError: javax.swing.event.EventListenerList is a restricted class. Please see the Google App Engine developer's guide for more details. at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java: 51) ... com.google.gwt.user.client.rpc.StatusCodeException: 500 The call failed on the server; see server log for details at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java: 192) On Jan 28, 9:05 am, Sednus sed...@gmail.com wrote: I debugged for some time and realized, that the actual problem is that my server side code doesnt find the JFreeChart external libraries when running. I copied the libraries to /war/WEB-INF/lib but the behaivor still the same. On Jan 27, 10:38 am, Sednus sed...@gmail.com wrote: Hi, Im trying load an image from the server using RPC, the problem is that it always fails to load the image and throws the following error: com.google.gwt.user.client.rpc.StatusCodeException: 403 html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1/ titleError 403 FORBIDDEN/title /head bodyh2HTTP ERROR 403/h2 pProblem accessing /diskmonitor/. Reason: pre FORBIDDEN/pre/phr /ismallPowered by Jetty:///small/ibr/ Im implementing my classes as the following: public class ChartImage extends Image { private UpdatePlotsServiceAsync plotService; public ChartImage(String hostname) { super(); /* * Setup connection to chart generator service. */ plotService = (UpdatePlotsServiceAsync) GWT.create(UpdatePlotsService.class); ServiceDefTarget endpoint = (ServiceDefTarget)plotService; String url = GWT.getModuleBaseURL()+; System.out.println(url); endpoint.setServiceEntryPoint(url); /* * Setup the callback from the chart generator service. */ AsyncCallbackString callback = new AsyncCallbackString() { /* * If the call was successful, we will get back the name of the chart * that was created and stored on the server. */ public void onSuccess(String s) { String chartName = (String)s; String imageUrl = GWT.getModuleBaseURL() + chartName; setUrl(imageUrl); } /* * Something went wrong with the call. Handle the issue how you'd like. */ public void onFailure(Throwable ex) { System.out.println(Failed to load image); ex.printStackTrace(); } }; /* * Make the call to the chart generator service with the previously created * callback. */ plotService.getImagesPaths(default, callback); /* * Since we've made an asynchronous call, we don't need to do anything further. * The callback object will handle the remainder of the work for us. */ } } The image is generated in the server side using JFreeChart public class UpdatePlotsServiceImpl extends RemoteServiceServlet implements UpdatePlotsService { @Override public String getImagesPaths(String hostname) { String chartName = ; /* * Create the data for the pie chart */ DefaultPieDataset dataset = new DefaultPieDataset(); //Fake Data dataset.setValue(Available, 71); dataset.setValue(Used, 39); String title = Data at:+ info.getHostname()+-+ info.getLocation(); JFreeChart chart = ChartFactory.createPieChart(title, dataset, true, false, false); File file = new File(chart.png); //Save the image try { ChartUtilities.saveChartAsPNG(file, chart, 800,
Re: Unable to load image, please help
On Friday, January 28, 2011 2:34:43 PM UTC+1, Sednus wrote: javax.swing.event.EventListenerList is a restricted class. Please see the Google App Engine developer's guide for more details. If you're building your app on Google App Engine, maybe you should rather use Google's Chart API instead of JFreeChart: http://code.google.com/apis/chart/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Unable to load image, please help
Thanks a lot. I'll take a look at it. On Jan 28, 11:11 am, Thomas Broyer t.bro...@gmail.com wrote: On Friday, January 28, 2011 2:34:43 PM UTC+1, Sednus wrote: javax.swing.event.EventListenerList is a restricted class. Please see the Google App Engine developer's guide for more details. If you're building your app on Google App Engine, maybe you should rather use Google's Chart API instead of JFreeChart:http://code.google.com/apis/chart/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Unable to load image, please help
I checked it out, but my code is meant for an isolated network, so I need to be able to generate the images on the server-side. Apparently I am having trouble adding the JFreeChart libraries properly. Could someone help with a walk-trough on how to? Thanks a lot anyway it was very useful. On Jan 28, 11:11 am, Thomas Broyer t.bro...@gmail.com wrote: On Friday, January 28, 2011 2:34:43 PM UTC+1, Sednus wrote: javax.swing.event.EventListenerList is a restricted class. Please see the Google App Engine developer's guide for more details. If you're building your app on Google App Engine, maybe you should rather use Google's Chart API instead of JFreeChart:http://code.google.com/apis/chart/ -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.