Hey,

Personlly, as a programmer, I enjoy having control. I don't like to
hear that I cant access a file. here's a bit of the background on the
issue.

I have to read quite a bit of information off of a .txt file, which I
wrote and placed into the WEB-INF folder. That information is then
read as follows, on the server side.

public void loadWords(String listName) {

wordList = new TreeMap<String, ArrayList<String>>();

try {
        BufferedReader in = new BufferedReader(new FileReader("/war/WEB-INF/"
+ listName + ".txt"));
        String lineOfText;
        String[] items;
        int count = 0;

        while ((lineOfText = in.readLine()) != null) {
        count++;
        ArrayList<String> fWords = new ArrayList<String>();

        items = lineOfText.split(", ");

        String word = items[0];
        for(int i = 1; i < items.length; i++){
                          fWords.add(items[i]);

                }

        wordList.put(word, fWords);
        System.out.println(word + " " + fWords + " " + count);

        }
                        in.close();
                } catch (FileNotFoundException e) {
                        System.out.println("no file found");
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }

        }

I felt that this was decently simple, and have done it before.
However, i get the following error:

Sep 24, 2009 1:52:51 PM
com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: [1253800371140000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract void jake.rocks.taboo.client.GreetingService.loadWords
(java.lang.String)' threw an unexpected exception:
java.security.AccessControlException: access denied
(java.io.FilePermission \war\WEB-INF\EasyList.txt read)
        at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure
(RPC.java:360)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:546)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:166)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
..........

Any thoughts? I have done some searching but cannot seem to find a
definite answer as to what the problem is, or how to fix it. Again,
this code is all on the server side.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to