2 qq 30562993 qq_30562993 于 2016.05.04 18:10 提问

数据解析String count;count就是下面的数据。希望各位能帮个忙

addPolizeisacheList{
polizeisacheList{
bicycleOwner{
id: 53bicycleOwnerName: "\345\274\240\344\270\21153"gender: 0iDCardNumber: "320211199408090712"phone: "15312362612"address: "\344\270\212\346\265\267\346\265\246\344\270\234"username: "owner53"domicile: "\346\261\237\350\213\217\350\213\217\345\267\236"createTime: 1454320052799
}bicycle{
id: 117bicycleOwnerID: 53model: "45"color: "415"number: "45"vehicleIdentifyNumber: "56"motorNumber: "45"price: "45"shoppingPoint: "45"shoppingTime: "2016-01-28"licenseUrl: "/picture/bicycle/2016/04/6b13d4b8-4aaa-4137-8e03-0b2d27713b6d.png"brandUrl: "/picture/bicycle/2016/04/e148a7f4-4d80-42a3-8a17-0cf0be29396c.png"frontUrl: "/picture/bicycle/2016/04/5de4e9dd-e523-4706-a9df-4a8042356bae.png"backUrl: "/picture/bicycle/2016/04/3cdb7ac7-8816-4ff7-b6de-6ea972ad5c32.png"IdentityCardForwardUrl: "/picture/bicycle/2016/04/01427ca8-cda7-49d3-bf9e-8707086bc26b.png"IdentityCardBackUrl: "/picture/bicycle/2016/04/41e69903-e583-4724-a232-187ac50ea77d.png"batteryNumber: "45"rfid: 19616434createTime: 1460183312000policeStationID: 11theftStatus: 1
}happeningTime: 1461639765000reporter: "\345\274\240\344\270\21153"phone: "53"happeningPlace: "w"description: "w"policemans{
id: 195name: "\345\274\240\351\224\246\351\272\237"number: "002"
}policemans{
id: 195name: "\345\274\240\351\224\246\351\272\237"number: "002"
}policemans{
id: 196name: "\347\224\260\347\247\213\347\237\263"number: "ht003"
}policeStations{
id: 11policeStationName: "\346\250\252\346\262\224\346\211\200"
}policeStations{
id: 51policeStationName: "java\345\274\200\345\217\221\347\273\204"
}handleTime: 1460183312000handleTime: 1461639767000handleTime: 1461654339318status: 1trackList{

}

}
}lastPushTime: 1462351346resutl: true

3个回答

caozhy
caozhy   Ds   Rxr 2016.05.05 00:17

这就是标准的json格式,用你用的语言+json解析作为关键字,google下就有。

qq_30562993
qq_30562993 帮我在看看下面的错误
一年多之前 回复
qq_30562993
qq_30562993   2016.05.05 10:57

图片说明
05-05 10:53:38.834: W/System.err(10449): org.json.JSONException: Value lastPushTime of type java.lang.String cannot be converted to JSONObject
05-05 10:53:38.835: W/System.err(10449): at org.json.JSON.typeMismatch(JSON.java:111)
05-05 10:53:38.836: W/System.err(10449): at org.json.JSONObject.(JSONObject.java:158)
05-05 10:53:38.837: W/System.err(10449): at org.json.JSONObject.(JSONObject.java:171)
05-05 10:53:38.838: W/System.err(10449): at cn.bearhunting.push.service.NettyService.onData(NettyService.java:110)
05-05 10:53:38.839: W/System.err(10449): at cn.bearhunting.push.netty.handler.MessageHandler.channelRead0(MessageHandler.java:50)
05-05 10:53:38.839: W/System.err(10449): at cn.bearhunting.push.netty.handler.MessageHandler.channelRead0(MessageHandler.java:1)
05-05 10:53:38.840: W/System.err(10449): at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
05-05 10:53:38.841: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.842: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.842: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
05-05 10:53:38.843: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.844: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.845: W/System.err(10449): at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
05-05 10:53:38.846: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.847: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.847: W/System.err(10449): at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1110)
05-05 10:53:38.848: W/System.err(10449): at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:968)
05-05 10:53:38.849: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:349)
05-05 10:53:38.850: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
05-05 10:53:38.851: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.852: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.853: W/System.err(10449): at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
05-05 10:53:38.854: W/System.err(10449): at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
05-05 10:53:38.855: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
05-05 10:53:38.856: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:430)
05-05 10:53:38.857: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:384)
05-05 10:53:38.858: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
05-05 10:53:38.858: W/System.err(10449): at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
05-05 10:53:38.859: W/System.err(10449): at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
05-05 10:53:38.860: W/System.err(10449): at java.lang.Thread.run(Thread.java:838)

我把count转jsons时候出这个错了

qq_30562993
qq_30562993   2016.05.05 10:59

05-05 10:53:38.834: W/System.err(10449): org.json.JSONException: Value lastPushTime of type java.lang.String cannot be converted to JSONObject
05-05 10:53:38.835: W/System.err(10449): at org.json.JSON.typeMismatch(JSON.java:111)
05-05 10:53:38.836: W/System.err(10449): at org.json.JSONObject.(JSONObject.java:158)
05-05 10:53:38.837: W/System.err(10449): at org.json.JSONObject.(JSONObject.java:171)
05-05 10:53:38.838: W/System.err(10449): at cn.bearhunting.push.service.NettyService.onData(NettyService.java:110)
05-05 10:53:38.839: W/System.err(10449): at cn.bearhunting.push.netty.handler.MessageHandler.channelRead0(MessageHandler.java:50)
05-05 10:53:38.839: W/System.err(10449): at cn.bearhunting.push.netty.handler.MessageHandler.channelRead0(MessageHandler.java:1)
05-05 10:53:38.840: W/System.err(10449): at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
05-05 10:53:38.841: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.842: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.842: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
05-05 10:53:38.843: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.844: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.845: W/System.err(10449): at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
05-05 10:53:38.846: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.847: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.847: W/System.err(10449): at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1110)
05-05 10:53:38.848: W/System.err(10449): at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:968)
05-05 10:53:38.849: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:349)
05-05 10:53:38.850: W/System.err(10449): at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
05-05 10:53:38.851: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
05-05 10:53:38.852: W/System.err(10449): at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
05-05 10:53:38.853: W/System.err(10449): at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
05-05 10:53:38.854: W/System.err(10449): at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
05-05 10:53:38.855: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
05-05 10:53:38.856: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:430)
05-05 10:53:38.857: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:384)
05-05 10:53:38.858: W/System.err(10449): at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
05-05 10:53:38.858: W/System.err(10449): at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
05-05 10:53:38.859: W/System.err(10449): at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
05-05 10:53:38.860: W/System.err(10449): at java.lang.Thread.run(Thread.java:838)

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!