SOLUCIONADO: Backed Java WebScript (SecureContext was not
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2009 09:23 AM
Estoy desarrollando un backed Java WebScript, y para empezar y a modo de prueba, he añadido para ver si funciona la siguiente línea services.getNodeService().getStores(); pero no me funciona
La Respuesta de la ejecución del WebScript es esta:
A valid SecureContext was not provided in the RequestContext [Ljava.lang.StackTraceElement;@e474af null error class= class net.sf.acegisecurity.AuthenticationCredentialsNotFoundException {"uid":1256216408907,"estado":"OK","idEstado":"200"}
Aquí os dejo el código Java:
He estado viendo ejemplos y no consego averiguar porque me esta dando este error. Alguna pista??
gracias,
saioa

La Respuesta de la ejecución del WebScript es esta:
A valid SecureContext was not provided in the RequestContext [Ljava.lang.StackTraceElement;@e474af null error class= class net.sf.acegisecurity.AuthenticationCredentialsNotFoundException {"uid":1256216408907,"estado":"OK","idEstado":"200"}
Aquí os dejo el código Java:
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException { try { services.getNodeService().getStores(); } catch(Exception e) { res.getWriter().write("\n\n"+ e.getMessage()+"\n\n"+ e.getStackTrace()+"\n\n"+ e.getCause()+"\n\n"+ "error class= "+e.getClass() + "\n\n\n\n\n\n"); } try{ // build a json object JSONObject obj = new JSONObject(); // put some data on it obj.put("idEstado", "200"); obj.put("estado", "OK"); obj.put("uid", System.currentTimeMillis()); // build a JSON string and send it back String jsonString = obj.toString(); res.getWriter().write(jsonString); } catch(JSONException e) { throw new WebScriptException("Unable to serialize JSON"); } }
He estado viendo ejemplos y no consego averiguar porque me esta dando este error. Alguna pista??
gracias,
saioa
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2009 05:47 AM
Ya está lo he solucionado, el tema era la authentication del webscript antes había puesto none y al cambiar a user me ha devuelto el resultado esperado.
<webscript>
<shortname>The World's Simplest Webscript</shortname>
<description>Hands back a little bit of JSON</description>
<url>/demo/createFile</url>
<authentication>user</authentication>
<format default="">argument</format>
</webscript>
Espero que os sirva de ayuda.
saioa
<webscript>
<shortname>The World's Simplest Webscript</shortname>
<description>Hands back a little bit of JSON</description>
<url>/demo/createFile</url>
<authentication>user</authentication>
<format default="">argument</format>
</webscript>
Espero que os sirva de ayuda.
saioa
