<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    ice world

    There is nothing too difficult if you put your heart into it.
    posts - 104, comments - 103, trackbacks - 0, articles - 0

    2014年1月17日

    這個問題很多小伙伴都遇到了,網上搜羅了半天也沒找到太好、太完美的解決辦法,有人說是因為安裝IE11時聯網了,導致自動打了補丁,這個補丁可以自動檢查IE主頁是否損壞,可以通過卸載相應的補丁解決,我同時又找到了另外一個通過修改hosts文件的方法,貌似目前解決了我的問題,修改方法如下: 使用記事本打開 C:\Windows\System32\drivers\etc\hosts 文件,在最下面追加一行: 127.0.0.1 ieonline.microsoft.com

    posted @ 2016-08-12 10:47 IceWee 閱讀(879) | 評論 (0)編輯 收藏

    將JDK中BIN文件夾下的 msvcr71.dll 這個文件復制到 TOMCAT 中的 BIN 下

    posted @ 2016-01-18 13:43 IceWee 閱讀(427) | 評論 (0)編輯 收藏

    有段日子沒做記錄了,這段日子一直在排雷(前人埋下的隱患代碼,或者直接說bug),今天這個雷讓我排了將近大半天,因為是正式上線的系統,只能看后臺日志,不能調試,打印出的異常信息不完整,種種的條件不充分,導致問題很難定位。標題上的兩個異常,第一個一看就明白是插入的數值大于數據庫字段長度,第二個多是因為Number類型的字段導致,比如精度不足。

    我們的這次問題原因是程序員在做除法運算時沒有對除數進行非零判斷,導致計算出來的數值非法,插入數據庫失敗,請看代碼:
    public static void main(String[] args) {
            
    double a = 10;
            
    double b = 0;
            
    double c = 0;
            
            
    double m = a/c;
            
    double n = b/c;
            
            System.out.println(m);
            System.out.println(n);
        }

    經過計算后,m和n的值分別是多少?沒在實際開發中遇到的可能不知道,或者你有個好習慣不會出現這樣的bug,請看結果:
    Infinity
    NaN

    被除數非零,除數為零做除法的結果是字符串“Infinity”,翻譯成中文就是“無限”,你的中學數學老師可能說過;
    被除數為零,除數為零做觸發的結果是字符串“NaN”,即不是有效的數字。

    就是這個“Infinity”花費了我一小天的時間才定位。下面詳述問題定位的方法。

    異常1:ORA-01438: value larger than specified precision allowed for this column
    了解點數據庫的打眼一看就知道插入的數值超過了表字段長度,但你知道是哪個表哪個字段嗎?我不知道,于是網上查閱了下,Oracle數據庫服務器在Linux上。

    命令行登陸到數據庫所在服務器,進入Oracle的安裝目錄,假設是/opt/oracle/
    進入到如下目錄:/opt/oracle/admin/實例名/udump
    中間的數據庫實例名根據實際情況修改,udump目錄下會有一堆的.trc文件,這些文件記錄了所有操作當前數據庫出現異常的堆棧信息。為了定位問題,我將該目錄下的所有.trc文件都刪除了(當然,刪除之前把udump目錄整個備份了),再進行一次系統的業務操作,查看一下udump目錄,發現立刻生成一個新 的.trc文件,打開查看(內容片段):
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning
    , Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    ORACLE_HOME 
    = /u01/app/oracle/product/10.2/db_1
    System name:    AIX
    Node name
    :    gsdj1
    Release
    :    1
    Version
    :    6
    Machine
    :    00CFD4644C00
    Instance name
    : bjwd1
    Redo thread mounted by this instance: 1
    Oracle process number
    : 132
    Unix process pid
    : 48300280, image: oracle@gsdj1

    *** SERVICE NAME:(bjwd) 2014-03-28 16:48:05.683
    *** SESSION ID:(2969.439612014-03-28 16:48:05.683
    *** 2014-03-28 16:48:05.683
    ksedmp
    : internal or fatal error
    ORA
    -01438: value larger than specified precision allowed for this column
    Current SQL statement 
    for this session:
    insert into CP_TEMP_STOCKTRAN (APPLY_ID, ALIEN, CER_TYPE, CER_NO, TRANS_AM, TRANS_AM_PR, TRANS_TYPE, TRANS_DATE, ENDORSOR, BLIC_TYPE, ALIEN_ID, ENDORSOR_ID, STOCKTRAN_ID) values (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13)

    黃色背景紅色字體的SQL就是罪魁禍首,這僅僅能定位發生問題的數據庫表,字段還得自己排查。異常1讓我定位到了這里,這時想起了異常2。


    異常2: Could not synchronize database state with session
    之前也搜索過這個異常,多數是由于Number類型的字段導致。冷靜的思考一下,平常我們在做表設計時,會把文字類型的字段設置大一些,Number類型的精度也會根據實際業務進行設計,但往往Number類型的字段最容易出問題:
    1、如果將非Number值插入該字段,比如字符串
    2、如果插入的數值精度過多,如字段設計Number(10,2),也就是最大支持8為整數和兩位小數,要插入34.121313就會失敗

    根據表名定位到hibernate的映射文件以及實體類,再從業務功能入口(一個action方法)搜索,終于定位到一個業務接口做了該實體類的保存代碼,定位到了那個字段,定位到了做除法沒有判斷除數是否為0。








    posted @ 2014-03-28 18:54 IceWee 閱讀(873) | 評論 (0)編輯 收藏

    網絡配置:
    臨時(重丟失)
    ifconfig eth0 192.168.1.xxx netmask 255.255.xxx.0


    永久(重啟有效)
    vi /etc/network/interfaces

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    allow-hotplug eth0
    iface eth0 inet static
            address 192.168.1.xxx
            netmask 255.255.xxx.0
            network 192.168.1.1
            broadcast 192.168.1.255
            gateway 192.168.1.1
            
    # dns-* options are implemented by the resolvconf package, if installed
            dns-nameservers 202.106.196.115


    由于非法關機導致重啟后無法聯網

    ifconfig eth0 192.168.1.xxx netmask 255.255.xxx.0 

    route add default gw 192.168.1.1

    重啟后配置丟失,所以必須在重啟之前執行:
    apt-get update

    apt-get install ifupdown

    不能聯網是因為非法關機導致ifup腳本丟失





    posted @ 2014-01-24 10:50 IceWee 閱讀(900) | 評論 (0)編輯 收藏

    源機器:192.168.1.1
    備份機器:192.168.1.2

    前提條件:
    1、兩臺機器的網絡是連通的
    2、兩臺機器必須同時安裝了SVN服務器

    假設:
    源機器上需要同步的庫名為autoSync,訪問地址為:svn://192.168.1.1/autoSync,對其具備讀寫權限的賬戶:sync/sync

    備份機器配置:
    1、創建與源機器庫名相同的空庫
    # 假設備份機器的SVN根目錄建立在 /home/backup/svn/repository下
    svnadmin create /home/backup/svn/repository/autoSync

    2、配置備份機器上的autoSync
    分別修改conf下的svnserve.conf、passwd、authz,根據實際情況配置,假設創建了用戶sync/sync,對庫autoSync具備讀寫權限,配置方法略,配置完成后啟動SVN服務

    3、創建并修改pre-revprop-change文件
    cd /home/backup/svn/repository/autoSync/hooks
    cp pre
    -revprop-change.tmpl pre-revprop-change
    vi pre-revprop-change

    將文件末尾的“exit 1”改為“exit 0”即可,保存退出
    REPOS="$1"
    REV
    ="$2"
    USER
    ="$3"
    PROPNAME
    ="$4"
    ACTION
    ="$5"

    if
    [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi

    echo
    "Changing revision properties other than svn:log is prohibited" >&2
    exit
    0

    增加可執行權限
    chmod 755 pre-revprop-change

    4、初始化
    命令:
    svnsync init --username 用戶名 --password 密碼 備份機器庫URL 源機器庫URL

    說明:
    用戶名和密碼是對源機器SVN庫具備讀寫權限的SVN用戶

    示例:
    svnsync init --username sync --password sync svn://192.168.1.2/autoSync svn://192.168.1.1/autoSync

    5、首次同步
    首次同步即為一次全備份過程,在此期間請停止客戶端段源機器哦一切操作(提交代碼等)
    命令:
    svnsync sync 備份機器庫URL
    示例:
    svnsync sync svn://192.168.1.2/autoSync

    源機器配置
    6、增量自動同步配置
    創建并修改post-commit文件
    # 假設源機器的SVN根目錄建立在 /home/svn/repository下
    cd /home/svn/repository/autoSync/hooks
    cp post
    -commit.tmpl post-commit
    vi post
    -commit

    在文件末尾追加:svnsync sync --non-interactive 備份機器庫URL --username 用戶名 --password 密碼

    說明:
    用戶名和密碼是對備份機器SVN庫具備讀寫權限的SVN用戶

    示例:
    svnsync sync --non-interactive svn://192.168.1.2/autoSync --username sync --password sync

    7、術語
    配置完成,今后客戶端再向SVN(192.168.1.1)提交文件時,會自動觸發源機器(192.168.1.1)向備份機器(192.168.1.2)提交更新

    8、版本庫UUID一致性
    首先查看源機器庫的UUID,假設得到的是:fcdcbee9-6be3-4575-8d4a-681ec15ad8e0
    svnlook uuid svn://192.168.1.1/autoSync

    更新備份機器庫的UUID為源機器庫的UUID
    svnadmin setuuid svn://192.168.1.2/autoSync fcdcbee9-6be3-4575-8d4a-681ec15ad8e0




    posted @ 2014-01-23 11:08 IceWee 閱讀(646) | 評論 (0)編輯 收藏

    本文記錄的安裝步驟是基于基本安裝后的Debian,啟動后漆黑一片,只有命令行,采用在線安裝方式,因此配置中國的鏡像軟件源能提高軟件的下載速度,首先配置軟件源。

    備份源文件
    # cp /etc/apt/sources.list /etc/apt/sources.list.bak

    編輯源文件
    # nano /etc/apt/sources.list

    注釋掉本地光盤源這一行,注釋后如:
    # deb cdrom:[Debian GNU/Linux 6.0.7 _Squeeze_ - Official amd64 NETINST Binary-1 20130223-18:50]/ squeeze main

    取消下面兩行官方源前面的注釋
    deb http://security.debian.org/ squeeze/updates main
    deb-src http://security.debian.org/ squeeze/updates main

    追加163的鏡像源地址
    deb http://mirrors.163.com/debian/ squeeze main non-free contrib
    deb http://mirrors.163.com/debian/ squeeze-proposed-updates main contrib non-free
    deb http://mirrors.163.com/debian-security/ squeeze/updates main contrib non-free
    deb-src http://mirrors.163.com/debian/ squeeze main non-free contrib
    deb-src http://mirrors.163.com/debian/ squeeze-proposed-updates main contrib non-free
    deb-src http://mirrors.163.com/debian-security/ squeeze/updates main contrib non-free
    deb http://ftp.sjtu.edu.cn/debian/ squeeze main non-free contrib
    deb http://ftp.sjtu.edu.cn/debian/ squeeze-proposed-updates main contrib non-free
    deb http://ftp.sjtu.edu.cn/debian-security/ squeeze/updates main contrib non-free
    deb-src http://ftp.sjtu.edu.cn/debian/ squeeze main non-free contrib
    deb-src http://ftp.sjtu.edu.cn/debian/ squeeze-proposed-updates main contrib non-free
    deb-src http://ftp.sjtu.edu.cn/debian-security/ squeeze/updates main contrib non-free

    保存修改
    # ctrl + o 回車
    退出
    # ctrl + x

    更新源
    # apt-get update

    更新系統
    # apt-get upgrade

    安裝SVN服務器
    # apt-get install subversion subversion-tools

    安裝完成后可以運行命令查看SVN服務器版本信息
    # svnserve --version

    配置SVN
    首先創建版本庫的根目錄,如位置:/home/svn/repository,所有項目都將在該目錄下創建相應子文件夾
    # mkdir –p /home/svn/repository

    創建項目版本庫test(僅為演示)
    # svnadmin create /home/svn/repository/test


    修改SVN配置文件
    nano /home/svn/repository/test/conf/svnserve.conf

    以下為文件內容:
    ### This file controls the configuration of the svnserve daemon, if you
    ### use it to allow access to this repository.  (If you only allow
    ### access through http: and/or file: URLs, then this file is
    ### irrelevant.)

    ### Visit http://subversion.tigris.org/ for more information.

    [general]
    ### These options control access to the repository for unauthenticated
    ### and authenticated users.  Valid values are "write", "read",
    ### and "none".  The sample settings below are the defaults
    # 未授權配置為禁止訪問none,已授權配置為可以讀寫write
    anon-access = none
    auth-access = write
    ### The password-db option controls the location of the password
    ### database file.  Unless you specify a path starting with a /,
    ### the file's location is relative to the directory containing
    ### this configuration file.
    ### If SASL is enabled (see below), this file will NOT be used.
    ### Uncomment the line below to use the default password file.
    # 用戶數據庫文件,配置授權用戶,當前使用的文件是和svnserve.conf在相同目錄下的passwd文件,也可以指定其他絕對路徑文件,如:/home/svn/passwd
    password-db = passwd
    ### The authz-db option controls the location of the authorization
    ### rules for path-based access control.  Unless you specify a path
    ### starting with a /, the file's location is relative to the the
    ### directory containing this file.  If you don't specify an
    ### authz-db, no path-based access control is done.
    ### Uncomment the line below to use the default authorization file.
    # 授權文件,配置如同用戶配置
    authz-db = authz
    ### This option specifies the authentication realm of the repository.
    ### If two repositories have the same authentication realm, they should
    ### have the same password database, and vice versa.  The default realm
    ### is repository's uuid.
    # realm = My First Repository

    [sasl]
    ### This option specifies whether you want to use the Cyrus SASL
    ### library for authentication. Default is false.
    ### This section will be ignored if svnserve is not built with Cyrus
    ### SASL support; to check, run 'svnserve --version' and look for a line
    ### reading 'Cyrus SASL authentication is available.'
    # use-sasl = true
    ### These options specify the desired strength of the security layer
    ### that you want SASL to provide. 0 means no encryption, 1 means
    ### integrity-checking only, values larger than 1 are correlated
    ### to the effective key length for encryption (e.g. 128 means 128-bit
    ### encryption). The values below are the defaults.
    # min-encryption = 0
    # max-encryption = 256


    保存
    # ctrl + o 回車

    退出
    # ctrl + x

    配置用戶
    # nano passwd

    以下為文件內容:
    ### This file is an example password file for svnserve.
    ### Its format is similar to that of svnserve.conf. As shown in the
    ### example below it contains one section labelled [users].
    ### The name and password for each user follow, one account per line.

    [users]
    # harry = harryssecret
    # sally = sallyssecret
    IceWee = IceWee

    增加用戶IceWee,密碼也為IceWee,=號兩側需要有空格,保存(ctrl + o 回車)退出(ctrl + x)

    配置訪問權限
    # nano authz

    以下為文件內容:
    ### This file is an example authorization file for svnserve.
    ### Its format is identical to that of mod_authz_svn authorization
    ### files.
    ### As shown below each section defines authorizations for the path and
    ### (optional) repository specified by the section name.
    ### The authorizations follow. An authorization line can refer to:
    ###  - a single user,
    ###  - a group of users defined in a special [groups] section,
    ###  - an alias defined in a special [aliases] section,
    ###  - all authenticated users, using the '$authenticated' token,
    ###  - only anonymous users, using the '$anonymous' token,
    ###  - anyone, using the '*' wildcard.
    ###
    ### A match can be inverted by prefixing the rule with '~'. Rules can
    ### grant read ('r') access, read-write ('rw') access, or no access
    ### ('').

    [aliases]
    # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

    [groups]
    # harry_and_sally = harry,sally
    # harry_sally_and_joe = harry,sally,&joe
    developers = IceWee

    # [/foo/bar]
    # harry = rw
    # &joe = r
    # * =

    # [repository:/baz/fuz]
    # @harry_and_sally = rw
    # * = r

    [/]
    * = r
    IceWee = rw
    @developers = rw

    [/tags]
    IceWee = rw

    默認所有用戶可讀取根,IceWee可以讀寫根??梢苑謩e對子目錄進行授權,如上的tags目錄,IceWee具有讀寫權限,以及IceWee所在的組developers也具備讀寫權限。

    啟動SVN服務器
    # svnserve -d -r /home/svn/repository
    -d含義為后臺運行(daemon),-r指定的根目錄,如訪問test應該使用這樣的地址 svn://hostname:port/test

    停止SVN服務
    # killall svnserve

    備份還原命令,與oracle的備份有些類似
    導出
    # svnadmin dump /home/svn/repository/test > /home/bak/test.dump

    導入
    # svnadmin load /home/svn/repository/demo < /home/bak/demo.dump
    導入前提:
    必須先創建要導入版本庫目錄,如上的demo,則需要做以下操作
    # svnadmin create /home/svn/respository/demo
    修改svnserve.conf、passwd、authz等文件,前面已介紹


     





    posted @ 2014-01-17 15:48 IceWee 閱讀(1228) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 亚洲综合视频在线| 亚洲成a人无码亚洲成www牛牛| 99re免费99re在线视频手机版| 欧洲乱码伦视频免费| 另类专区另类专区亚洲| 亚洲VA成无码人在线观看天堂| 无遮免费网站在线入口| 另类图片亚洲校园小说区| 亚洲免费精彩视频在线观看| 四虎成人免费观看在线网址| a毛片免费在线观看| 亚洲天堂2017无码中文| 国产免费拔擦拔擦8x| 久久青草精品38国产免费| 久久精品国产亚洲αv忘忧草| 日韩在线视频免费看| 日韩免费无码一区二区三区| 无码天堂亚洲国产AV| 亚洲成无码人在线观看| 三上悠亚亚洲一区高清| 手机在线毛片免费播放| 久久免费精品视频| 国产精品亚洲lv粉色| 亚洲黑人嫩小videos| 日韩精品视频免费观看| 久久精品免费视频观看| 美女被免费网站在线视频免费| 亚洲制服中文字幕第一区| 免费国产成人高清视频网站| 亚洲电影免费观看| 99视频免费在线观看| 免费又黄又爽又猛大片午夜| 亚洲av成人一区二区三区| 亚洲成熟xxxxx电影| 亚洲无码日韩精品第一页| 美女黄网站人色视频免费国产 | 久久精品国产亚洲av品善| 亚洲精品中文字幕无乱码| 亚洲国产精品无码中文字| 国产亚洲精品自在线观看| 国产免费131美女视频|