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 <[email protected]> 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 <[email protected]> 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"/>
> > <title>Error 403 FORBIDDEN</title>
> > </head>
> > <body><h2>HTTP ERROR 403</h2>
> > <p>Problem accessing /diskmonitor/. Reason:
> > <pre> FORBIDDEN</pre></p><hr /><i><small>Powered by
> > Jetty://</small></i><br/>
> > ....
>
> > 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.
> > */
> > AsyncCallback<String> callback = new AsyncCallback<String>()
> > {
> > /*
> > * 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.