Trouble loading sampleData.xml into Applet

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
shoey
Newbie
Newbie
Posts: 9
Joined: Mon Aug 27, 2007 12:00 am

Trouble loading sampleData.xml into Applet

Post by shoey » Mon Sep 03, 2007 7:22 am

I'm having trouble getting the xml import of data into the applet to work. I have tried the example in the TChart.Features.jar and can not get either an xml file from a url or from my local harddisk to import.

Have also tried loading the file clientside using JavaScript

Code: Select all

sampleChart.setChart(sampleChart.getImport().getTemplate().fromXML("\Data\SampleData.xml"));
Am getting exception:
java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission \Data\SampleData.xml read)

I'm new to this and not sure where to start. Any help would be much appreciated

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Sep 05, 2007 8:25 am

Hi shoey,

This is a known issue being investigated. We will get back to you when we have further news.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Wed Sep 05, 2007 11:53 pm

I have tried the example in the TChart.Features.jar and can not get either an xml file from a url or from my local harddisk to import.
Do you mean that even in the example you can't load the file from your local disk? ie. that the example application doesn't work?
java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission \Data\SampleData.xml read)
I guess that you are trying to load the file from an applet. The error you get is normally caused when an unsigned applet is trying to load a file from a local hard disk. You can solve this by signing the applet or by using an url instead.

shoey
Newbie
Newbie
Posts: 9
Joined: Mon Aug 27, 2007 12:00 am

Post by shoey » Thu Sep 06, 2007 6:45 am

Tom,

Yes even the example application does not work for me. Either through a url or from my harddisk. I would be interested to know if you have managed to get the import to work either using the example application or by puting the applet in a webpage and trying to populate it using:

Code: Select all

tChart1.getImport().getTemplate().fromXML("http://www.steema.com/SampleData.xml");
The example error that I quoted was using that line of import code for the following applet.

Code: Select all

<applet id="tChart1" codebase="/Illuminator/Classes" archive="TeeChart.Swing.jar" code="com.steema.teechart.TChartApplet.class"
width="100%" height="400" name="tChart1" align="middle" vspace="10" hspace="10" >
<PARAM name="__XMLSOURCE" value="/BHPB/CSM/BMA/90_Sandpit/Geoff/SampleChart.xml">
</applet>
The entire stack trace reported via the Sun Java Console is as follows:
java.security.AccessControlException: access denied (java.io.FilePermission http:\www.steema.com\SampleData.xml read)

at java.security.AccessControlContext.checkPermission(Unknown Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkRead(Unknown Source)

at java.io.FileInputStream.<init>(Unknown Source)

at java.io.FileInputStream.<init>(Unknown Source)

at com.steema.teechart.imports.Imports$Template.fromXML(Imports.java:48)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)

at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)

at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)

at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)

at sun.plugin.com.DispatchImpl$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin.com.DispatchImpl.invoke(Unknown Source)

java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission http:\www.steema.com\SampleData.xml read)

at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)

at sun.plugin.com.DispatchImpl$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
I gave up trying to get the import to work through the applet param as it was not reporting anything.

I believe the applet is signed as it provides a popup asking if I want to trust the applet. Though I am not sure about the permissions for this?

I have read in some other forums information about policies for the applets access but as yet have been unable to locate this. Could this be part of the problem?

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Sun Sep 09, 2007 10:30 pm

Hi,

The example is somewhat confusing. It mimics the sample of the other teeChart versions, but it uses the native Java XML and not the specification of other teeChart versions (as the template example). The native Java XML uses XMLEncoder and XMLDecoder.

Unfortunately, we noticed some issues in the export functionality of the native Java XML. Those are being checked and any problems will be resolved as soon as possible.

The alternative XML import, to match the specification of other teeChart version exports (eg SampleData.xml) is not implement, but will be available for the end-of-year.

Regards,
tom

Post Reply