Sorry, I forgot the attachments. On Wed, 09 Jun 2010 14:11:57 -0300, <vy...@maneh.org> wrote: > Occurred errors in my tests with WSO2 Data Services Server 2.5.0 4RC22. > > My problems occurred when I use field type for input of types: date, > timestamp and int and I try passed "null" in value. > > In attachment my service and mysql dump. > > > > Erros recevieds in log: > > === with all fields "NULL" > > Name: Products > Location: > /home/lsaraiva/Applications/wso2/wso2dataservices-2.5.0/repository/deployment/server/dataservices/Products.dbs > Description: N/A > Default Namespace: http://ws.wso2.org/dataservice > Current Request Name: selectProduct > Current Params: {id=null, updated_at=null, name=null, created_at=null, > quantity=null} > Nested Exception:- > java.lang.NumberFormatException: For input string: "null" > at > java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) > at java.lang.Integer.parseInt(Integer.java:449) > at java.lang.Integer.parseInt(Integer.java:499) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setIntValue(SQLQuery.java:1329) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:832) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:813) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.processNormalQuery(SQLQuery.java:471) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.runQuery(SQLQuery.java:1411) > at > org.wso2.carbon.dataservices.dispatch.query.Query.execute(Query.java:214) > at > org.wso2.carbon.dataservices.dispatch.CallQuery.execute(CallQuery.java:154) > at > org.wso2.carbon.dataservices.dispatch.CallQueryGroup.execute(CallQueryGroup.java:108) > at > org.wso2.carbon.dataservices.dispatch.operation.Operation.execute(Operation.java:63) > at > org.wso2.carbon.dataservices.dispatch.DataService.invoke(DataService.java:327) > at > org.wso2.carbon.dataservices.dispatch.DSOMDataSource.serialize(DSOMDataSource.java:90) > > > === with id = 1 and other all fields "NULL" > > Name: Products > Location: > /home/lsaraiva/Applications/wso2/wso2dataservices-2.5.0/repository/deployment/server/dataservices/Products.dbs > Description: N/A > Default Namespace: http://ws.wso2.org/dataservice > Current Request Name: selectProduct > Current Params: {id=1, updated_at=null, name=null, created_at=null, > quantity=null} > Nested Exception:- > java.lang.RuntimeException: In valid string to parse > at > org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(ConverterUtil.java:603) > at org.wso2.carbon.dataservices.DBUtils.getDate(DBUtils.java:521) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setDateValue(SQLQuery.java:995) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:851) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:813) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.processNormalQuery(SQLQuery.java:471) > at > org.wso2.carbon.dataservices.dispatch.query.SQLQuery.runQuery(SQLQuery.java:1411) > at > org.wso2.carbon.dataservices.dispatch.query.Query.execute(Query.java:214) > at > org.wso2.carbon.dataservices.dispatch.CallQuery.execute(CallQuery.java:154) > at > org.wso2.carbon.dataservices.dispatch.CallQueryGroup.execute(CallQueryGroup.java:108) > at > org.wso2.carbon.dataservices.dispatch.operation.Operation.execute(Operation.java:63) > at > org.wso2.carbon.dataservices.dispatch.DataService.invoke(DataService.java:327) > at > org.wso2.carbon.dataservices.dispatch.DSOMDataSource.serialize(DSOMDataSource.java:90) > > > > On Sat, 5 Jun 2010 09:25:03 +0530, Milinda Pathirage <mili...@wso2.com> > wrote: >> http://builder.wso2.org/~carbon/releases/carbon/3.0.0/4RC22/ >> >> <http://builder.wso2.org/~carbon/releases/carbon/3.0.0/4RC22/>Thanks >> Milinda >> >> >
-- MySQL dump 10.13 Distrib 5.1.41, for debian-linux-gnu (i486) -- -- Host: localhost Database: products -- ------------------------------------------------------ -- Server version 5.1.41-3ubuntu12.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `products` -- DROP TABLE IF EXISTS `products`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `created_at` datetime NOT NULL, `updated_at` datetime NOT NULL, `quantity` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `products` -- LOCK TABLES `products` WRITE; /*!40000 ALTER TABLE `products` DISABLE KEYS */; INSERT INTO `products` VALUES (1,'Bike','2010-06-09 00:00:00','2010-06-09 11:11:42',12); /*!40000 ALTER TABLE `products` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET time_zo...@old_time_zone */; /*!40101 SET sql_mo...@old_sql_mode */; /*!40014 SET foreign_key_chec...@old_foreign_key_checks */; /*!40014 SET unique_chec...@old_unique_checks */; /*!40101 SET character_set_clie...@old_character_set_client */; /*!40101 SET character_set_resul...@old_character_set_results */; /*!40101 SET collation_connecti...@old_collation_connection */; /*!40111 SET sql_not...@old_sql_notes */; -- Dump completed on 2010-06-09 14:08:07
<data name="Products" enableBatchRequests="false" enableBoxcarring="false" serviceStatus="active"> <config id="Products"> <property name="org.wso2.ws.dataservice.driver">com.mysql.jdbc.Driver</property> <property name="org.wso2.ws.dataservice.protocol">jdbc:mysql://localhost/products</property> <property name="org.wso2.ws.dataservice.user">root</property> <property name="org.wso2.ws.dataservice.password"></property> <property name="org.wso2.ws.dataservice.minpoolsize"></property> <property name="org.wso2.ws.dataservice.maxpoolsize"></property> <property name="org.wso2.ws.dataservice.validation_query"></property> </config> <query id="insertProduct" useConfig="Products"> <sql>insert into products (name, created_at, updated_at, quantity) values (:name, :created_at, now(), :quantity)</sql> <param name="name" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="1" /> <param name="quantity" paramType="SCALAR" sqlType="INTEGER" type="IN" ordinal="3" /> <param name="created_at" paramType="SCALAR" sqlType="DATE" type="IN" ordinal="2" /> </query> <query id="updateProduct" useConfig="Products"> <sql>update products set name = :name, updated_at = now(), quantity = :quantity where id = :id</sql> <param name="name" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="1" /> <param name="quantity" paramType="SCALAR" sqlType="INTEGER" type="IN" ordinal="2" /> <param name="id" paramType="SCALAR" sqlType="INTEGER" type="IN" ordinal="3" /> </query> <query id="selectProduct" useConfig="Products"> <sql>select id, name, created_at, updated_at, quantity from products where (:id is null or id = :id) or (:name is null or name like :name) or (:created_at is null or created_at = :created_at) or (:updated_at is null or updated_at = :updated_at) or (:quantity is null or quantity = :quantity)</sql> <result element="products" rowName="product" defaultNamespace="http://ws.mcorp.com.br/products"> <element name="id" column="id" xsdType="xs:integer" /> <element name="name" column="name" xsdType="xs:string" /> <element name="updatedAt" column="updated_at" xsdType="xs:dateTime" /> <element name="createdAt " column="created_at" xsdType="xs:dateTime" /> <element name="quantity" column="quantity" xsdType="xs:integer" /> </result> <param name="id" paramType="SCALAR" sqlType="INTEGER" type="IN" ordinal="1" /> <param name="name" paramType="SCALAR" sqlType="STRING" type="IN" ordinal="2" /> <param name="created_at" paramType="SCALAR" sqlType="DATE" ordinal="3" /> <param name="updated_at" paramType="SCALAR" sqlType="DATE" ordinal="4" /> <param name="quantity" paramType="SCALAR" sqlType="INTEGER" type="IN" ordinal="5" /> </query> <operation name="insertProduct"> <call-query href="insertProduct"> <with-param name="name" query-param="name" /> <with-param name="quantity" query-param="quantity" /> <with-param name="created_at" query-param="created_at" /> </call-query> </operation> <operation name="updateProduct"> <call-query href="updateProduct"> <with-param name="name" query-param="name" /> <with-param name="quantity" query-param="quantity" /> <with-param name="id" query-param="id" /> </call-query> </operation> <operation name="selectProduct"> <call-query href="selectProduct"> <with-param name="id" query-param="id" /> <with-param name="name" query-param="name" /> <with-param name="created_at" query-param="created_at" /> <with-param name="updated_at" query-param="updated_at" /> <with-param name="quantity" query-param="quantity" /> </call-query> </operation> </data>
_______________________________________________ Carbon-dev mailing list Carbon-dev@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev