Tag Archives: json

com.alibaba.fastjson .JSONException: For input string: “3000-01-01” or “9999-12-31”

FastJSON Parser exception after 2999 time range

Exception in thread "main" com.alibaba.fastjson.JSONException: For input string: "9999-12-31 00:00:00.000+0000"
    at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:665)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:365)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:269)
    at com.alibaba.fastjson.JSON.parseObject(JSON.java:488)
    at com.xxx.xxx.main(StpBpmVariableSetter.java:146)
Caused by: java.lang.NumberFormatException: For input string: "9999-12-31 00:00:00.000+0000"

FastJSON is known to be fixed in version 1.2.49, and can be fixed with an upgrade

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.49</version>
</dependency>

 

Transformation of JS map and JSON

I was going to store the map as a JSON string in window.localStorage, but I found that I could not convert the map to a JSON string

var map = new Map(); 
map.set(21,'A');
map.set(22,'B');
console.log(JSON.stringify(map));


ah

Socket Error 104 bug

Description of the bug
Technology stack
nginxuwsgibottle
Error details
Alarm robots often have the following warnings:

<27>1 2018-xx-xxT06:59:03.038Z 660ece0ebaad admin/admin 14 - - Socket Error: 104
<31>1 2018-xx-xxT06:59:03.038Z 660ece0ebaad admin/admin 14 - - Removing timeout for next heartbeat interval
<28>1 2018-xx-xxT06:59:03.039Z 660ece0ebaad admin/admin 14 - - Socket closed when connection was open
<31>1 2018-xx-xxT06:59:03.039Z 660ece0ebaad admin/admin 14 - - Added: {'callback': <bound method SelectConnection._on_connection_start of <pika.adapters.select_connection.SelectConnection object at 0x7f74752525d0>>, 'only': None, 'one_shot': True, 'arguments': None, 'calls': 1}
<28>1 2018-xx-xxT06:59:03.039Z 660ece0ebaad admin/admin 14 - - Disconnected from RabbitMQ at xx_host:5672 (0): Not specified
<31>1 2018-xx-xxT06:59:03.039Z 660ece0ebaad admin/admin 14 - - Processing 0:_on_connection_closed
<31>1 2018-xx-xxT06:59:03.040Z 660ece0ebaad admin/admin 14 - - Calling <bound method _CallbackResult.set_value_once of <pika.adapters.blocking_connection._CallbackResult object at 0x7f74752513f8>> for "0:_on_connection_closed"

The debug process
Determine the error location
If you have a log, it’s easy to do. First of all, look at where the log is typed.
Our own code
No.
Uwsgi code
root@660ece0ebaad:/# uwsgi –version
2.0.14
from github co down, no.
Python Library code
Execute in the container

>>> import sys
>>> sys.path
['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0']

Under these directories, grep is found in pika

root@660ece0ebaad:/usr/local/lib/python2.7# grep "Socket Error" -R .
Binary file ./dist-packages/pika/adapters/base_connection.pyc matches
./dist-packages/pika/adapters/base_connection.py:            LOGGER.error("Fatal Socket Error: %r", error_value)
./dist-packages/pika/adapters/base_connection.py:            LOGGER.error("Socket Error: %s", error_code)

Determine the PIKA version.

>>> import pika
>>> pika.__version__
'0.10.0'

Error determination logic
It can be seen from the code that the Socket Error is the Error code of errno, and it is determined that the meaning of the Error code is that RST is sent to the opposite end.

>>> import errno
>>> errno.errorcode[104]
'ECONNRESET'

Suspected rabbitmq server address error, an unlistened port will return RST, after verification found that it is not.
then suspected link timeout break without notifying the client, etc. Take a look at the RabbitMQ Server logs and find a large number of:

=ERROR REPORT==== 7-Dec-2018::20:43:18 ===
closing AMQP connection <0.9753.18> (172.17.0.19:27542 -> 192.168.44.112:5672):
missed heartbeats from client, timeout: 60s
--
=ERROR REPORT==== 7-Dec-2018::20:43:18 ===
closing AMQP connection <0.9768.18> (172.17.0.19:27544 -> 192.168.44.112:5672):
missed heartbeats from client, timeout: 60s

It is found that all the links between RabbitMQ Server and Admin Docker have been broken

root@xxxxxxx:/home/dingxinglong# netstat -nap | grep 5672  | grep "172.17.0.19"

So why does RabbitMQ Server kick out piKA’s links?Look at the PIKA code comment:

    :param int heartbeat_interval: How often to send heartbeats.
                              Min between this value and server's proposal
                              will be used. Use 0 to deactivate heartbeats
                              and None to accept server's proposal.

We did not pass in the heartbeat interval, so in theory we should use the server default 60S. In fact, the client has never sent heartbeat packets.
verifies that a HeartbeatChecker object has been successfully created and a timer has been successfully created by printing, but the timer has never been called back.
follows through the code using blocking_connections, as seen in its add_timeout comment:

def add_timeout(self, deadline, callback_method):
    """Create a single-shot timer to fire after deadline seconds. Do not
    confuse with Tornado's timeout where you pass in the time you want to
    have your callback called. Only pass in the seconds until it's to be
    called.

    NOTE: the timer callbacks are dispatched only in the scope of
    specially-designated methods: see
    `BlockingConnection.process_data_events` and
    `BlockingChannel.start_consuming`.

    :param float deadline: The number of seconds to wait to call callback
    :param callable callback_method: The callback method with the signature
        callback_method()

The timer is triggered by process_data_Events and we are not calling it. So the client heartbeat is never triggered. Simply turn off heartbeat to solve this problem.
Specific trigger point

follows the code of basic_publish interface.
receives RST when sending, and finally prints socket_error in base_connection.py:452, _handle_error function.

def connect_mq():
    mq_conf = xxxxx
    connection = pika.BlockingConnection(
        pika.ConnectionParameters(mq_conf['host'],
                                  int(mq_conf['port']),
                                  mq_conf['path'],
                                  pika.PlainCredentials(mq_conf['user'],
                                                        mq_conf['pwd']),
                                  heartbeat_interval=0))
    channel = connection.channel()
    channel.exchange_declare(exchange=xxxxx, type='direct', durable=True)
    return channel

channel = connect_mq()

def notify_xxxxx():
    global channel

    def _publish(product):
        channel.basic_publish(exchange=xxxxx,
                              routing_key='xxxxx',
                              body=json.dumps({'msg': 'xxxxx'}))

res://ieframe.dll/acr_ error.htm Error resolution | IE8 website restore error real feasible solution

Ie8 website restore error real feasible solution, this morning to open the computer, prompted to update the system patch, so the recommended three most important patches installed. On QQ, open the IE8 browser page of QQ space and suddenly switch quickly, and then the website restore error immediately appears, url header res:// IEframe. DLL /acr_error. HTM, after testing QQ space and other interactive websites will appear this problem.

use IE repair, but still not, looked up on the Internet there is no solution, only to see an article that reinstall IE8 can solve this problem. But since it’s a reinstallation of IE, I don’t think this is the solution. At first glance, I suspect the problem was caused by the morning update patch, and the most likely patch is JSON interoperability of Internet Explorer 8.
The real solution to the IE8 web restoration error is to check out the patch on Microsoft’s website: Install this update to improve JSON interoperability with Internet Explorer 8 according to the new ECMAScript (5th edition standard). You may have to restart your computer after installing this update.

solution: remove the JSON interoperability patch for Internet Explorer 8, the patch number KB976662. First go to the control panel – Add/remove program – display update – find the number KB976662 – delete.

ie8 website restore error really feasible solution, delete need to restart, after the test QQ space and other interactive website open normal. Above method is original, in WIN2003+IE8 under the test is feasible.

R reads JSON data

You can use the Library (JSONLite) package
jsonmessage< -read_json(name.json,simplifyVector = FALSE)
jsonmessage$Month$minute[[1]]$number\
You can use layers of lists to find the information you want
But jsonLite will report an error when reading a Chinese-named JSON file
Error in parse_con(TXT, bigint_as_char) :
circum-error: invalid char in json text.
Now I can change it to Library (RJSONIO)
ts1< -RJSONIO::fromJSON(name.json)
If something is character and you can’t select one of them, just make it a list
ts1$month$minute[[1]]
Name, age, gender, job
Lili 20 female enginner
This string has a noun corresponding to it
To the list
ts1$month$minute[[1]]< -as.list(ts1$month$minute[[1]])
You can turn it into a list and continue to select the items you want

Reproduced in: https://www.cnblogs.com/zhenghuali/p/10455509.html

ASP compilation error 800a03ea


If ASP makes an error like this:
Microsoft VBScript compilation error ‘800a03ea’
Syntax error
class.asp, line 2
Class clsClass
^ — — — — — — — — — — — — —
Most likely, the following reasons:
1. Included files are written in the control statement, such as included in if… Between then and else or end if;
2. The class has been redefined, that is, the file has been contained multiple times.

Local workspace file (‘angular.json’) could not be found.

The following error was reported while running ng serve

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (D:\nodejs\node_global\node_modules\@angular\cli\models\workspace-loader.js:44:
19)
    at WorkspaceLoader.loadWorkspace (D:\nodejs\node_global\node_modules\@angular\cli\models\workspace-loader.js:31:21)
    at ServeCommand._loadWorkspaceAndArchitect (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:201:32)
    at ServeCommand.<anonymous> (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:53:25)
    at Generator.next (<anonymous>)
    at D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:3:12)
    at ServeCommand.initialize (D:\nodejs\node_global\node_modules\@angular\cli\models\architect-command.js:52:16)
    at Object.<anonymous> (D:\nodejs\node_global\node_modules\@angular\cli\models\command-runner.js:127:23)

Error cause: Possible angular/ CLI version mismatch
Solutions:
Upgrade presents/cli
Uninstall Angular/CLI globally

npm uninstall -g @angular/cli

2. Clean up

npm cache verify

Install Angular/CLI globally

npm install -g @angular/cli@latest

4. Uninstall Angluar/CLI under the project path

npm uninstall --save-dev @angular/cli

5. Install under the project path:

npm install --save-dev @angular/[email protected]

6. NPM install or YARN Install under the project path
7. Fix the problem after NPM installation:

npm audit fix

8. Resolve “Angular. Json” related issues:

ng update @angular/cli --migrate-only --from=1.4.9

 

Reproduced in: https://www.cnblogs.com/shira-t/p/9759142.html

Hash verification failed for CDH5.8.2 installation

Problem Hash Verification failed
In cdh5.8.2 web interface cluster installation process, Parcels hash check failed.

2. Solution 1(Hoodwink)

1. Modify the hash value of manifest.JSON

[root @ hadoop – 01 parcels] # cat CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel. Sha

227d11e344698c70e654ca6768fc017735b73ae3

[root @ hadoop – 01 parcels] # sha1sum CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel

cb7c70d07e68a256a1cb3b06e79e688ac64f3432 CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel

[root @ hadoop – 01 parcels] # cat manifest. Json | grep CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel

“ParcelName” : “CDH – 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel”,
 

[root @ hadoop – 01 parcels] # vi manifest. The json

# by/into the search mode, the input CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel,
the hash from 227 d11e344698c70e654ca6768fc017735b73ae3 instead of cb7c70d07e68a256a1cb3b06e79e688ac64f3432

2. In the Web interface, click Back, and then click Continue

Iii. Solution 2(Root cause)

If solution 1 , still can’t solve, may parcel file damage.

so you need to download, then web interface don’t shut down, click Back , click Continue .

Delete the local CDH-5.8.2-1.CDH5.8.2.p0.3-el6.Parcel file

[root @ hadoop – 01 parcels] # rm -f CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel
2. Redownload

[root @ hadoop – 01 parcels] # wget HTTP:// http://archive.cloudera.com/cdh5/parcels/5.8.2/CDH-5.8.2-1.cdh5.8.2.p0.3-el6.parcel
3. Check the hash value again for comparison

[root @ hadoop – 01 parcels] # sha1sum CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel

227 d11e344698c70e654ca6768fc017735b73ae3 CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel

[root @ hadoop – 01 parcels] #
[root @ hadoop – 01 parcels] # cat CDH 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel. Sha

227d11e344698c70e654ca6768fc017735b73ae3
 
### # consistent, that means the download file is complete, not damaged
4. In the Web interface, click Back and then click Continue to find the error


ERROR:

?The Src file/opt/cloudera/parcels/flood/CDH – 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel/CDH – 5.8.2-1. Cdh5.8.2. P0.3 – el6. Parcel does not exist – hadoop – 01… and 4 others

5. In the Web interface, click Back quickly and decisively

 

6. To each machine manually delete the folder/opt/cloudera/parcels /. Flood and restart the agent

[root@hadoop-01 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-02 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-03 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-04 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-05 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-06 ~]# rm -rf /opt/cloudera/parcels/.flood

[root@hadoop-01 ~]# service cloudera-scm-agent restart

[root@hadoop-02 ~]# service cloudera-scm-agent restart

[root@hadoop-03 ~]# service cloudera-scm-agent restart

[root@hadoop-04 ~]# service cloudera-scm-agent restart

[root@hadoop-05 ~]# service cloudera-scm-agent restart

[root-Hadoop-06 ~]# Service Cloudera-SCM-Agent Restart
7. In the Web interface, click Continue again and find the following error

?Untar failed with return code: 2, with tar output: stdout: [], stderr: [ gzip: stdin: invalid compressed data–crc error tar: Child returned status 1 tar: Error is not recoverable: No coinages now] -Hadoop-04

8. Google, cloudera community search, unable to resolve

9. Perform step 6 again

Close the current page, open http://172.16.101.54:7180

11. Click Add Cloudera Management Service to create CMS Service

12. Click Add Cluster, create Cluster, failed, cannot click Continue, should be a bug

13. Force uninstall and clean the cluster’s files and install packages

14. Reinstall, the interface is as follows

 

Iv. Lessons learned:

A. Verify downloaded files

B When Hash Verification failed occurs, do not do solution 1, go to Solution 2 step 1-3, then click back and continue button

C. Simply follow steps 13-14 of Solution 2
 

 
5. Note
Encounter the problem, fight it, exhaust methods, improve yourself, start again.

From “ITPUB blog” link: http://blog.itpub.net/30089851/viewspace-2128607/, if you want to reprint, please indicate the source, otherwise will be investigated for legal responsibility.

Reproduced in: http://blog.itpub.net/30089851/viewspace-2128607/

Miscellaneous Notes (2)

Hide the scroll bar and keep the scroll effect


.outer-container {
    overflow: hidden;        // 隐藏滚动条
    width: 240px;          // 内容宽度,同时配合子元素
    height: 100%;
  }
  .inner-container {
    overflow-x: hidden; // 隐藏水平滚动条
    overflow-y: scroll;    // 产生垂直滚动
    width: 257px;       // 比父元素宽出滚动条的宽度 17px
    height: 100%;          // 设置产生滚动条
  }
  .inner-container::-webkit-scrollbar {
    display: none;            //  webkit 内核的浏览器仅需设置此属性
  }

// 另一种方法,在滚动的容器设置
.inner-container {
    margin-right: -17px;
}

错误:pathspec的字段与git已知的任何文件不匹配。

// 需要在提交时将描述信息放在两重引号中,原因疑是 git 无法识别 文件名或路径
git add .
git commit -m "'your message'"
git pull origin master
git push origin master

Check whether to jump after logging in to prevent an endless loop


router.beforeEach((to, from, next) => {
    out //判断登录状态简单实例
    var userInfo = window.localStorage.getItem('token');
    if (userInfo) {
        next();
    } else {
        next('/login');
    }
})

// 以上会发现出现如下错误:出现 dead loop错误,解决方法如下所示
// 解决思路:排除此时地址 = 转向的地址 的情况,避免dead loop
router.beforeEach((to, from, next) => {
    var userInfo = window.localStorage.getItem('token');//获取浏览器缓存的用户信息
    if(userInfo){ //如果有就直接到首页咯
        next();
    } else {
        if(to.path=='/login'){ //如果是登录页面路径,就直接next()
            next();
        } else { //不然就跳转到登录;
            next('/login');
        }

    }
})

BrowserslistError: Unknown browser major
Bootstrap.min. js normal bootstrap.min. CSS error reporting


ERROR in ./node_modules/css-loader?minimize!./node_modules/autoprefixer-loader!./node_modules/bootstrap/dist/css/bootstrap.min.css
    Module build failed: BrowserslistError: Unknown browser major
        at error (E:\project\node_modules\browserslist\index.js:37:11)
        at Function.browserslist.checkName (E:\project\node_modules\browserslist\index.js:320:18)
        at Function.select (E:\project\node_modules\browserslist\index.js:438:37)
        at E:\project\node_modules\browserslist\index.js:207:41
        at Array.forEach (<anonymous>)
        at browserslist (E:\project\node_modules\browserslist\index.js:196:13)
        at Browsers.parse (E:\project\node_modules\autoprefixer\lib\browsers.js:44:14)
        at new Browsers (E:\project\node_modules\autoprefixer\lib\browsers.js:39:28)
        at loadPrefixes (E:\project\node_modules\autoprefixer\lib\autoprefixer.js:56:18)
        at plugin (E:\project\node_modules\autoprefixer\lib\autoprefixer.js:62:18)
        at LazyResult.run (E:\project\node_modules\postcss\lib\lazy-result.js:274:20)
        at LazyResult.sync (E:\project\node_modules\postcss\lib\lazy-result.js:261:32)
        at LazyResult.stringify (E:\project\node_modules\postcss\lib\lazy-result.js:285:14)
        at LazyResult.get (E:\project\node_modules\postcss\lib\lazy-result.js:334:25)
        at Object.module.exports (E:\project\node_modules\autoprefixer-loader\index.js:55:35)

Solutions:

// Edit node_modules\bootstrap\package.json: Remove these lines:

"last 1 major version",
">= 1%",

Use the font – awesome webpack – vue
NPM installs font-awesome and any dependencies it requires


npm install less less-loader css-loader style-loader file-loader font-awesome --save

Globally register font-awesome in the entry file


import 'font-awesome/css/font-awesome.min.css';

Configure the parsing


{
    test: /\.(gif|jpg|jpeg|png|woff|svg|eot|ttf)\??.*$/,
    loader: 'url-loader?limit=1024'
},

Iview navigation component: after the current page is selected, click refresh or click the browser back button, the selected navigation bar disappears


在vuex的 state 存储 active-name,根据路由用 computed 取出 active-name

Reproduced in: https://www.cnblogs.com/anani/p/9643819.html

HTTP 405 Error: Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

carelessness:

    $.ajax({
        type: 'POST',
        async: false,
        url: url,
        dataType: 'json',
        contentType: 'application/json',
        data: JSON.stringify(postData),
        success: function(result){
            if(result.state==1){
                //成功
                var data = result.data.tableList;
                var sumnum = result.data.iSumNum;
                grid.setDatasource(data,sumnum);
            }else{
                cui.error("数据初始化失败");
            }
        }
    });
}
开始的时候没写url导致该错误

Mybatis uses step-by-step lazy loading to cause abnormal JSON conversion. The interface 500 reports an error

Mybatis USES lazy step loading to cause json conversion exception

  1. anomaly description
    No serializer found for class org. Apache. Ibatis. Executor. Loader. The javassist. JavassistProxyFactory...

  2. solve abnormal * * *

    in distributed query each related bean class add annotation @ JsonIgnoreProperties (value = {} "handler")

  3. reason

    lazy loading is you have to use data will give you query 0, but 1 directly query object 2 into json string will lead to 3 results have not been query out of json4, This is what causes the interface 500 exception. Note : object does not load SQL query, only when output this object is use this data 0 will be 1 query 2 from the database and assign data to dependent object

    3

  4. 4

5

JSON and map convert to each other (using fastjson)

article directory

JSON String

    • to Map, get leaf node
    • Map to String String
  • JSON string to Map, get the leaf node

    fastjson has two ways:

    • json. parseObject (String, Class< T>)

    //JSON subclass

    • JSONObject.parseObject
    String str ={
     "sign": "sign",
     "data": {
      "type": "第二层",
      "order": {
       "test": "第三层"
      }
     }
    }
    
    Map<String,String> parseObject = JSON.parseObject(str,Map.class);
    	//获取sign节点
    String sign=parseObject.get("sign");
    	//获取data节点
    String data=String.valueOf(parseObject.get("data"));
    	//获取data集合
    Map dataMap  = JSON.parseObject(data,Map.class);
    	//获取order集合
    Map orderMap = (Map)dataMap.get("order"); 
    	//获取叶子节点
    orderMap.get("test");
    

    Map String String

    String str = JSONObject.toJSONString(testMap);
    

    – tools