the source of "uts.dae.model.rest.Calculadora" class
package uts.dae.model.rest;
import javax.ejb.Stateless;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
/**
*
* @author x2010s
*/
@Stateless
@Path("/calculadora")
public class Calculadora {
@GET
public String Suma(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Suma(num1,num2));
}
@Path("calculadora/suma")
double $Suma(double num1,double num2) {
double resultado;
resultado = num1 + num2;
return resultado;
}
@GET
public String Resta(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Resta(num1,num2));
}
@Path("calculadora/resta")
double $Resta(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
double resultado;
resultado = num1 - num2;
return resultado;
}
@GET
public String Multiplicacion(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Multiplicacion(num1,num2));
}
@Path("calculadora/multiplicacion")
double $Multiplicacion(double num1,double num2) {
double resultado;
resultado = num1 * num2;
return resultado;
}
@GET
public String Division(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Division(num1,num2));
}
@Path("calculadora/Division")
double $Division(double num1,double num2) {
double resultado;
resultado = num1 / num2;
return resultado;
}
@GET
public String Modulo(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
return Double.toString($Modulo(num1,num2));
}
@Path("calculadora/Modulo")
double $Modulo(@QueryParam("num1") double num1,@QueryParam("num2") double num2) {
double resultado;
resultado = num1 % num2;
return resultado;
}
}
when I deploy, the following error occurs, if they have different url:
[[WARNING] A sub-resource model, double uts.dae.model.rest.Calculadora.$Suma(double,double), MUST be public scoped otherwise the method is ignored; source='class uts.dae.model.rest.Calculadora', [WARNING] A sub-resource model, double uts.dae.model.rest.Calculadora.$Multiplicacion(double,double), MUST be public scoped otherwise the method is ignored; source='class uts.dae.model.rest.Calculadora', [WARNING] A sub-resource model, double uts.dae.model.rest.Calculadora.$Resta(double,double), MUST be public scoped otherwise the method is ignored; source='class uts.dae.model.rest.Calculadora', [WARNING] A sub-resource model, double uts.dae.model.rest.Calculadora.$Modulo(double,double), MUST be public scoped otherwise the method is ignored; source='class uts.dae.model.rest.Calculadora', [WARNING] A sub-resource model, double uts.dae.model.rest.Calculadora.$Division(double,double), MUST be public scoped otherwise the method is ignored; source='class uts.dae.model.rest.Calculadora', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Suma(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Resta(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Suma(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Multiplicacion(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Suma(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Division(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Suma(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Modulo(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Resta(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Multiplicacion(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Resta(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Division(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Resta(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Modulo(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Multiplicacion(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Division(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Multiplicacion(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Modulo(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f', [FATAL] A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by"@Consumes" and "@Produces" annotations at Java methods public java.lang.String uts.dae.model.rest.Calculadora.Division(double,double) and public java.lang.String uts.dae.model.rest.Calculadora.Modulo(double,double) at matching regular expression /calculadora. These two methods produces and consumes exactly the same mime-types and therefore their invocation as a resource methods will always fail.; source='org.glassfish.jersey.server.model.RuntimeResource@1f7972f']