Hi Shammi. Thanks for help me on this. The problem in this case was that I can´t update the jar file using the console UI, so I thought that I have made the change when it was not, I had to change the jar inside the aar file by hand to make it work.
I will test this again, but I thinks this is a issue. Saludos, Ing. Jorge Infante Osorio. J´Dpto Soluciones SOA. CDAE. Fac. 5. UCI. De: Shammi Jayasinghe [mailto:[email protected]] Enviado el: martes, 02 de agosto de 2011 1:48 Para: [email protected]; [email protected] Asunto: Re: [Carbon-dev] error: Cannot create a custom Java object form XML in BRS Hi Jorge, I have created a rule service with the use of the fact class and the rule script that you have provided. Here i have attached it and it works fine with the request that you have provided. So I was unable to reproduce the error that you have pointed out. If you further can reproduce the error that you have pointed out here, could you please send us your rule service's aar file. Then, we ll be able to figure out the route cause for this error. Thanks Shammi On Tue, Aug 2, 2011 at 6:00 AM, Jorge Infante Osorio <[email protected]> wrote: Any ideas about this error? This is the rule script I used: ******************************************************** package Asignar; import aplicacion.rrhh.Empleado; import java.math.BigDecimal; rule "Programador" salience 10 dialect "mvel" no-loop true when $empleado : Empleado(promedioConocimientos >= 8) then $empleado.setCargo("Programador"); $empleado.setSalario(BigDecimal.valueOf(1000)); end rule "Lider de Proyecto" salience 9 dialect "mvel" no-loop true when $empleado : Empleado(promedioConocimientos >= 4, promedioConocimientos <= 7) then $empleado.setCargo("Lider de Proyecto"); $empleado.setSalario(BigDecimal.valueOf(2000)); end rule "Gerente" salience 8 dialect "mvel" no-loop true when $empleado : Empleado(promedioConocimientos >= 0, promedioConocimientos <= 3) then $empleado.setCargo("Gerente"); $empleado.setSalario(BigDecimal.valueOf(3000)); end ******************************************************** And this is the XML I send to the ws: ******************************************************** <body> <p:SetTipoRequest xmlns:p="http://wso2.org/sample/rule"> <p:Empleado> <xs:cargo xmlns:xs="http://rrhh.aplicacion/xsd">nada</xs:cargo> <xs:nombre xmlns:xs="http://rrhh.aplicacion/xsd">Juan</xs:nombre> <xs:promedioConocimientos xmlns:xs="http://rrhh.aplicacion/xsd">9</xs:promedioConocimientos> <xs:salario xmlns:xs="http://rrhh.aplicacion/xsd">0</xs:salario> </p:Empleado> <p:Empleado> <xs:cargo xmlns:xs="http://rrhh.aplicacion/xsd">nada</xs:cargo> <xs:nombre xmlns:xs="http://rrhh.aplicacion/xsd">Pedro</xs:nombre> <xs:promedioConocimientos xmlns:xs="http://rrhh.aplicacion/xsd">5</xs:promedioConocimientos> <xs:salario xmlns:xs="http://rrhh.aplicacion/xsd">0</xs:salario> </p:Empleado> <p:Empleado> <xs:cargo xmlns:xs="http://rrhh.aplicacion/xsd">nada</xs:cargo> <xs:nombre xmlns:xs="http://rrhh.aplicacion/xsd">Jose</xs:nombre> <xs:promedioConocimientos xmlns:xs="http://rrhh.aplicacion/xsd">2</xs:promedioConocimientos> <xs:salario xmlns:xs="http://rrhh.aplicacion/xsd">0</xs:salario> </p:Empleado> </p:SetTipoRequest> </body> ******************************************************** Saludos, Ing. Jorge Infante Osorio. J´Dpto Soluciones SOA. CDAE. Fac. 5. UCI. De: [email protected] [mailto:[email protected]] En nombre de Jorge Infante Osorio Enviado el: domingo, 31 de julio de 2011 3:56 Para: [email protected] Asunto: [Carbon-dev] error: Cannot create a custom Java object form XML in BRS Hi folks. I´m testing BRS 1.2.0 with a rule service and receive this error using the try it: TID: [] [WSO2 BRS] [2011-07-31 03:38:33,093] ERROR {org.apache.axis2.transport.http.AxisServlet} - Cannot create a custom Java object form XML. Java class is : aplicacion.rrhh.Empleado and XML is : <p:SetTipoRequest xmlns:p="http://brs.carbon.wso2.org"><!--0 or more occurrences--><p:Empleado><!--0 to 1 occurrence--><xs:cargo xmlns:xs="http://rrhh.aplicacion/xsd">null</xs:cargo><!--0 to 1 occurrence--><xs:nombre xmlns:xs="http://rrhh.aplicacion/xsd">bbbbbbbbb</xs:nombre><!--0 to 1 occurrence--><xs:promedioConocimientos xmlns:xs="http://rrhh.aplicacion/xsd">8</xs:promedioConocimientos><!--0 to 1 occurrence--><xs:salario xmlns:xs="http://rrhh.aplicacion/xsd">0</xs:salario></p:Empleado></p:SetTipo Request> {org.apache.axis2.transport.http.AxisServlet} org.wso2.carbon.rulecep.commons.LoggedRuntimeException: Cannot create a custom Java object form XML. Java class is : aplicacion.rrhh.Empleado and XML is : <p:SetTipoRequest xmlns:p="http://brs.carbon.wso2.org"><!--0 or more occurrences--><p:Empleado><!--0 to 1 occurrence--><xs:cargo xmlns:xs="http://rrhh.aplicacion/xsd">null</xs:cargo><!--0 to 1 occurrence--><xs:nombre xmlns:xs="http://rrhh.aplicacion/xsd">bbbbbbbbb</xs:nombre><!--0 to 1 occurrence--><xs:promedioConocimientos xmlns:xs="http://rrhh.aplicacion/xsd">8</xs:promedioConocimientos><!--0 to 1 occurrence--><xs:salario xmlns:xs="http://rrhh.aplicacion/xsd">0</xs:salario></p:Empleado></p:SetTipo Request> at org.wso2.carbon.rulecep.adapters.impl.POJOResourceAdapter.getAdaptedFacts(PO JOResourceAdapter.java:210) at org.wso2.carbon.rulecep.adapters.impl.POJOResourceAdapter.adaptInput(POJORes ourceAdapter.java:161) at org.wso2.carbon.rulecep.adapters.DefaultInputAdaptationStrategy.adapt(Defaul tInputAdaptationStrategy.java:81) at org.wso2.carbon.rulecep.adapters.InputManager.processInputs(InputManager.jav a:114) at org.wso2.carbon.rule.service.RuleServiceInvoker.invoke(RuleServiceInvoker.ja va:100) at org.wso2.carbon.rule.service.RuleServiceInOutMessageReceiver.invokeBusinessL ogic(RuleServiceInOutMessageReceiver.java:83) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic( AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageRe ceiver.java:110) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT TPTransportUtils.java:172) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:641) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest( ServletRegistration.java:90) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxySer vlet.java:111) at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet. java:67) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:155) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100 ) at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:241) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399) at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java: 396) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(H ttp11NioProtocol.java:356) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java: 1534) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja va:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9 08) at java.lang.Thread.run(Thread.java:619) This is the Empleado class: package aplicacion.rrhh; import java.math.BigDecimal; public class Empleado { public String nombre; public Integer promedioConocimientos; public String cargo; public BigDecimal salario; public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public Integer getPromedioConocimientos() { return promedioConocimientos; } public void setPromedioConocimientos(Integer promedioConocimientos) { this.promedioConocimientos = promedioConocimientos; } public String getCargo() { return cargo; } public void setCargo(String cargo) { this.cargo = cargo; } public BigDecimal getSalario() { return salario; } public void setSalario(BigDecimal salario) { this.salario = salario; } } Any idea? Saludos, Ing. Jorge Infante Osorio. J´Dpto Soluciones SOA. CDAE. Fac. 5. UCI. _______________________________________________ Carbon-dev mailing list [email protected] http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev -- Best Regards, Shammi Jayasinghe Senior Software Engineer; WSO2, Inc.; http://wso2.com, mobile: +94 71 4493085 _______________________________________________ Carbon-dev mailing list [email protected] http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
