I would put the file in the WEB-INF/XML/
change the path to the file to xml/users.xml or /xml/user.xml

On Jul 27, 1:57 pm, Jose Luis Estrella Campaña <[email protected]>
wrote:
> Hello dane !
>
> You're right in assuming something it's not working. Here's the
> thing... I need to read from the xml file so I can perform some
> operations on it and then save it again, here's the code I'm trying to
> get to work:
>
> import ....
>
> public class GreetingServiceImpl extends RemoteServiceServlet
> implements
>                 GreetingService {
>         public String greetServer(String input) throws
> IllegalArgumentException {
>
>                 FileInputStream fin;
>
>                 try {
>                     fin = new FileInputStream ("users.xml");
>                     System.out.println( new DataInputStream(fin).readLine() );
>                     fin.close();
>                     } catch (IOException e) {
>                         System.err.println ("Unable to read from file");
>                         System.exit(-1);
>                     }
>                 return "success reading file";
>
>         }
>
> }
>
> And here's the exception I'm getting:
>
> Unable to read from file
> .
> .
> .
> Caused by: java.security.AccessControlException: access denied
> (java.lang.RuntimePermission exitVM.-1)
>
> ---------------------------------------------------------------------------­---------------------------------------------------------------------------­--------
>
> This last test was performed putting the file where you suggested.
> (src/org/jose/server. )
>
> Thank you very much,
>
> Jose.
>
> On Jul 27, 1:13 pm, "dane.molotok" <[email protected]> wrote:
>
>
>
> > I guess I'm missing something in the question. Have you tried some
> > things and it's not working like you'd expect? I would think you could
> > put it in src/org/jose/server.
>
> > On Jul 27, 11:21 am, Jose Luis Estrella Campaña <[email protected]>
> > wrote:
>
> > > Good day everybody,
>
> > > I have this particular need, where I need to have a file (xml) within
> > > my GWT app. I have some data in this xml I must read, change, and then
> > > write (update)
> > > The file must be delivered or included within the Gwt App. Can anybody
> > > please tell me where can I place this file, so I can read/write it
> > > using java's file APi from an RPC Servlet.
>
> > > Here's a brief description of how my App's directory structure looks
> > > like:
>
> > > GwtApp
> > >             |__ src
> > >             |          |__org
> > >             |          |       |__jose
> > >             |          |                 |__client
> > >             |          |                 |__server
> > >             |          |                 |__shared
> > >             |          |
> > >             |          |__META-INF
> > >             |
> > >             |__ war
> > >                       |__gwtapp
> > >                       |__WEB-INF
>
> > > For my current needs, where would you suggest placing the file ?
>
> > > Thank you very much in advance,
>
> > > Have a nice day,
>
> > > Jose- Hide quoted text -
>
> - Show quoted text -

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

Reply via email to