Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Monday, 6 September 2010

Error Tomcat " permission denied " calling webservice

Error tomcat permission denied calling webservice

This is a usual error when we work with webServices and Tomcat.
Read all Post before prove the solution.

The solution is:

Go to your Tomcat base directory
Find the file 50local.policy ( usually you can find it in "$TOMCAT_BASE/conf/policy.d/" ) If you haven't this directory structure, I'm sure that you can find the file catalina.policy in directory "$TOMCAT_BASE/conf/". (Both file are OK).

You have to edit one of these. At the final of the file you should type this:

//Grant all permissions to the Your Webservice Name
grant codeBase "file:${catalina.base}/webapps/yourWebserviceName/-" {
permission java.security.AllPermission;
};

Finally save the file and restart the server.

* You must replace the red text with your information.

I hope that this resolve your problem.
Regards.

Thursday, 2 September 2010

Error call AJAX JQuery


Error call AJAX with JQuery

I’m sure that you have ever had this problem.

" Access to restricted URI denied ” code: “ 1012 "

Or the AJAX request with JQuery is correct but it seems that don’t run?

Well, is very important to ensure that the call is being made to a service within the same domain as the AJAX service.

I always do the following: I create a web Service likes a Proxy. This will make the intermediary between the AJAX page and the world.

That is, our AJAX page always connect with our Proxy web Service, and this will implement the necessary calls to Internet.


Once done, our AJAX web and our Proxy web Service always will be together anywhere where we deploy them.

I personally, to create the Proxy web Service, use Java, creating a REST service with the Jersey library help. (this library is used to server and client). https://jersey.dev.java.net/

Later I will post a small tutorial on how to create a web Service REST in JAVA and how call to another web Service from JAVA.

Llamar AJAX xon JQuery: http://no-suelo.blogspot.com/2010/09/llamada-ajax-con-jquery-parametros.html


Regards.

Error llamada Ajax Jquery

Error llamada AJAX con JQuery

Seguro que habéis tenido este problema alguna vez...

" Access to restricted URI denied ” code: “ 1012 "

¿O simplemente la petición AJAX con JQuery és correcta pero parece que no hace nada?

Bueno, es muy importante asegurarse que la llamada se esté haciendo a un servicio dentro del mismo dominio que la del servicio AJAX.

En mi caso siempre hago lo siguiente: Creo un web Service que haga de Proxy entre nuestra página AJAX y el mundo...

És decir, nuestra página AJAX se cone
cta siempre contra nuestro web Service Proxy, y éste a su vez implementará las llamadas necesarias al exterior.

Una vez hecho esto, nuestra web AJAX y nuestro web Service Proxy siempre irán juntitos allí donde los despleguemos.

Yo personalmente para crear el web Service Proxy uso Java, creando un REST con la ayuda de la librería Jersey. (Nos sirve para hacer de servidor y de cliente)
https://jersey.dev.java.net/

Más adelante publicaré un pequeño tutorial de cómo crear un web Service JAVA y de cómo hacer llamadas a otro web Service desde JAVA.

http://no-suelo.blogspot.com/2010/09/llamada-ajax-con-jquery-parametros.html

Saludos.