zoukankan      html  css  js  c++  java
  • KB错误总结

    Initializing Java Tooling".">myeclipse启动An internal error occurred during: "Initializing Java Tooling".
    分类: Web开发   |   iamzhangyouzhi 发布于: 2014-01-09
    启动MyEclipse是报错An internal error occurred during: "Initializing Java Tooling".如下图所示: 解决办法: 1.删除当前工作目录下的WORKSPACE_HOME/.metadata/.plugins/org.eclipse.core.resources/.project,然后重新启动Eclipse 2.如果项目使用了SVN管理,请将要删除的项目下的.indexes和.syncinfo文件拷贝出来,重启后再将这两个文件拷贝回来即可。或者,先close项目,再操作步骤1.
    
    ===========================================================================
    
    // 生成日期字符串
    var date = new Date();
            var y = date.getFullYear();
            var m = date.getMonth()<10 ? "0"+(date.getMonth()+1) :date.getMonth()+1;
            var d = date.getDate()<10 ? "0"+date.getDate() : date.getDate();
            var h = date.getHours()<10 ? "0"+date.getHours() :date.getHours();
            var mm = date.getMinutes()<10 ? "0"+date.getMinutes() :date.getMinutes();
            var s = date.getSeconds()<10 ? "0"+date.getSeconds() :date.getSeconds();
            var ss = date.getMilliseconds();
            var no = y+""+m+""+d+""+h+""+mm+""+s+"_${_currUserName}";
    
    
    ===========================================================================
    
    
    //数组转化List
    Arrays.asList(数组);
    
    
    ===========================================================================
    //选择排序
    用第一个与每一个比较,找到比自己打的就交换
    
    ===========================================================================
    
    //冒泡排序
    相邻的两个进行比较,大的往后移
    
    ===========================================================================
    
    //查看笔记本信息
    dxdiag
    
    ===========================================================================
    
    //Git免密克隆拉取
    1、cmd进入在git环境下输入:git config --global credential.helper store   回车
    2、拉取两次
    
    ===========================================================================
    
    
    //调整Eclipse内存大小
    在eclipse.ini文件末尾加上
    -vmargs
    -Xms256m
    -Xmx1024m
    -XX:PermSize=256M
    -XX:MaxPermSize=1024M
    
    把以上参数尽量改大
    
    
    ===========================================================================
    
    //调整tomcat的内存
    双击tomcat服务器--》open launch configuration--》Argurements里加上
    -Xms128m -Xmx1024m -XX:MaxPermSize=1024m
    
    =======================================================================
    
    其初始空间(即-Xms)是物理内存的1/64,最大空间(-Xmx)是物理内存的1/4。
    
    
    ===============================================================
    
    eclipse误删文件
    右键项目名——》restore local history
    
    
    =====================================
    
    新的OA
    http://192.168.1.234:7000/oa/console/index.action
    
    
    ===========================================
    #收集的比较快的maven仓库
    http://maven.wso2.org/nexus/content/groups/public/
    http://jcenter.bintray.com/
    http://maven.antelink.com/content/repositories/central/
    http://nexus.openkoala.org/nexus/content/groups/Koala-release/
    http://maven.tmatesoft.com/content/groups/public/
    http://mavensync.zkoss.org/maven2/
    http://maven.springframework.org/release/
    
    ===========================================================================
    maven配置
    <mirror>
        <id>UK</id>
        <name>UK Central</name>
        <url>http://uk.maven.org/maven2</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    
    <mirror>
        <id>sonatype</id>
        <name>sonatype Central</name>
        <url>http://repository.sonatype.org/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    
    <mirror>
        <id>jboss-public-repository-group</id>
        <name>JBoss Public Repository Group</name>
        <url>http://repository.jboss.org/nexus/content/groups/public</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
    
    
    ===========================================
    微信企业访问路径写法:timeTaskController.do?timeTask
    @Controller
    @RequestMapping("/timeTaskController")//类
    @RequestMapping(params = "timeTask")方法
    
    物流决策:/util/delNoCarCarrier.action
    @Controller
    @RequestMapping("/util") //类
    @RequestMapping("/getNoCarCarrier.action")//方法
    
    
    ==========================================================
    局域网内无法连接其他机器的服务器
    报错:The Network Adapter could not establish the connection
    
    解决:把对外访问监听打开
    修改:E:oracleproduct11.2.0dbhomeNETWORKADMINlistener.ora
    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.3.18)(PORT = 1521))
        )
      )
    
    然后重启oracle服务即可
    ==============================================================
    
    包命名:com.项目名.模块名.MVC结构
    
    ==================================================
    映射路径无效
    No mapping found for HTTP request with URI [/monitor/itm/demo.do] in DispatcherServlet with name 'springMvc'
    
    @Controller  不生效----》开启注解扫描
    @Service    报错---》开启注解扫描
    @Repository    报错---》开启注解扫描
    
    ================================================
    屏幕分辨率无法调,缺少显卡驱动
    
    =================================
    
    href="javascript:void(0);"
    
    ========================
    在Java中,注解都是大写字母开头
    
    ==============================
    velocity中日期转换:
    value="$!dateTool.format("yyyy-MM-dd HH:mm:ss",$!{qywxCheck.createTime})"
    velocity中日期选择:
    <input type="text" name="createtime" id="createtime" value="" onFocus="WdatePicker({dateFmt:'yyyy-MM'})" class="form-control" style="background: url('/gtgwx/plug-in-ui/images/datetime.png') no-repeat scroll right center transparent;">
                                                                      </div>
    
    
    =======================================
    
    JavaScript返回上一页代码区别:
    
    
    window.history.go(-1);  //返回上一页
    window.history.back();  //返回上一页
    //如果要强行刷新的话就是:window.history.back();location.reload(); window.location.go(-1); //刷新上一页
    
    ===================================================
    表单校验插件
    Validform_v5.3.2.js
    ===================================
    request.getSession(true):若存在会话则返回该会话,否则新建一个会话。
    
    request.getSession(false):若存在会话则返回该会话,否则返回NULL
    当向Session中存取登录信息时,一般建议:HttpSession session =request.getSession();
    
    当从Session中获取登录信息时,一般建议:HttpSession session =request.getSession(false);
    ======================================================================================
    报错:参数个数无效
    oracle的concat()函数只能支持链接两个参数,跟mysql数据不一样
    ===========================================================
    js指定数值的小数点位数:num.toFixed(2);//保留2位小数
    ===================================================
    华软课件下载地址:ftp://kj.sise.com.cn/
    =======================================
    oracle:to_date(dateStr,"dateFormat"
    ===================================
    //制定下拉框选中
    $("#empGender option[value='"+data.SEX+"']").attr("selected",true);
    ===================================================================
    Jquery#ajax请求:
    jQuery.ajax({
                  url: url,
                  async:true,
                  cache: false,
                  dataType: "json",
                  data:form,
                  method:"POST",
                  success: function(data){
                          if(data.success){
                            alert(data.msg);
                            location.reload();
                        }else{
                            alert(data.msg);
                            location.reload();
                        }    
                      }
                });
    
    $.ajax({
                  url: url,
                  async:true,
                  cache: false,
                  dataType: "json",
                  data:form,
                  method:"POST",
                  success: function(data){
                          if(data.success){
                            alert(data.msg);
                            location.reload();
                        }else{
                            alert(data.msg);
                            location.reload();
                        }    
                      }
                });
    =========================================================================
    window.onload = function(){}//js写法
    
    $(document).ready(function(){})可以简写成$(function(){});//文档结构加载完毕执行
    $(window).load(function() {});//页面加载完毕后执行
    $(window).load(function(){...})和body.onload()都存在同样一个问题,因为开始也说到了,它们都需要等到页面的所有内容
    =============================================================================================================
    $("input[name='userchecks']").attr("checked",false);
    ====================================================
    $("tr:odd");//index为奇数的元素1、3、5
    $("tr:even");//index为偶数的元素0、2、4、6
    ==========================================
    样式:透明
    opacity:0-1;
    0是完全透明
    1完全不透明
    ============
    oracle分页查询:
    select b.* from (select rownum,a.* from ITM_PROCESSOR a where a.sysname='微信企业号后台' order by a.usetotal desc) b where ROWNUM>=1 and rownum<=5;
    
    mysql分页查询
    limit 0,3
    ===================================================================================================================================================
    this:当前元素对象
    $("#mytable tr").mouseover(function(){
            $(this).css("background","#000");
            })
    ============================================
    透明度、滤镜
    img {opacity:0.8;filter:alpha(opacity=80);}
    =============================================
    如何把 7.25 四舍五入为最接近的整数?
    您的回答:Math.round(7.25)
    ================================
    js的Math对象
    ============
    19.如何在浏览器的状态栏放入一条消息?
    您的回答:window.status("put your message here")
    正确答案:window.status = "put your message here"
    20.如何获得客户端浏览器的名称?
    您的回答:client.navName
    正确答案:navigator.appName
    ====================================
    json字符串:
    var txt = '{ "employees" : [' +
    '{ "firstName":"Bill" , "lastName":"Gates" },' +
    '{ "firstName":"George" , "lastName":"Bush" },' +
    '{ "firstName":"Thomas" , "lastName":"Carter" } ]}';
    
    将接送字符串转化成json
    var obj = eval ("(" + txt + ")");
    
    数组
    1、String[] str=new String[5];
    2、String[] str=new String[]{"a","b"};
    3、String[] str={"a","b"};
    ======================================
    解决符号冲突:
     var jQuery_1_8_2 = $.noConflict(true);
                jQuery_1_8_2(function($) {
    ===============================================================================
    ================================
    注意:
    1.openSession和getCurrentSession的区别?
       *openSession必须关闭,currentSession在事务结束后自动关闭
       *openSession没有和当前线程绑定,currentSession和当前线程绑定
    2.如果使用currentSession需要在hibernate.cfg.xml文件中进行配置:
       *如果是本地事务(jdbc事务)
         <propertyname="hibernate.current_session_context_class">thread</property>
       *如果是全局事务(jta事务)
       <propertyname="hibernate.current_session_context_class">jta</property>
    =========================================================================
    数据库检索技术:Lucene
    javascript库:vue.js
    数据库缓存技术:redis
    =====================
    eclipse快速转换大小写
    ctrl+shift+x 转为大写 ctrl+shift+y 转为小写
    =============================================
    eclipse快速返回值
    ALT+SHIFT+L
    ===============
    子窗口向父窗口传值:
    window.parent.$("#categoryid").val();
    window.opener.$("#categoryid").val();
    ===========================================================
    select元素选中:
    select元素
    $(this).selectedIndex被选中的option的索引
    获 取select被选中项的文本
    var item = $("select[name=items] option[selected]").text();
    $(o).children().eq(o.selectedIndex)
    $("#toAgent option:selected").val();
    ===========================================================
    js事件绑定,两种方法:
    1、直接在元素体中,onclick="方法名",再在js中定义该方法
    2、根据id获取元素,然后绑定:
        --$("#id").bind("click", function(){});
        --$("#id").click(function(){});
    ===============================================
    <select onchange="">
        <option selected>
    
    <input type="radio" checked>
    ================================
    Jquery选择器
    选中某元素制定id的那个元素
    $("select#id")       错误的写法:$("select #id") 元素与id不能有空格
    ===================================================================
    替换规则:
    String uuid = UUID.randomUUID().toString().toUpperCase().replace("-", "");
    replace(ch1,ch2);//第二个字符是新字符,第一个是被替换字符
    ===============================================================
    js与jq获取元素
    o:[object HTMLSelectElement]
    $(o):[object Object]
    $('#hostip'):[object Object]
    document.getElementById('hostip'):[object HTMLSelectElement]
    ================================================================
    获取iframe中的元素
    var topWinid= document.getElementById('selectUsers').contentWindow.document.getElementById('framid');
    window.parent.$("#categoryid").val();//获取父窗口的元素,弹框
    window.opener.$("#categoryid").val();//获取父窗口的元素,弹窗口
    document.getElementById("iframe的ID").contentWindow.leftConfirm(“数据”);//父页面调用子页面方法
    
    window.parent.backSignOut("数据");//子页面调用父页面方法
    ===========================================================
    Java定时器
    spring定时器/**
     * @author Administrator
     * ITM系统定时器
     */
    //web定时器,当服务器启动时就开始执行
    @Service
    public class ITMTimerTask {
    
    //    @Scheduled(cron = "0 0 0/2 * * ?")        //每2小时执行一次    
    //    @Scheduled(cron = "0/10 * * * * ?")        //每10秒钟一次
        @Scheduled(cron = "0 0/10 * * * ?")        //每10分钟一次
        public void sendAlarmInform(){
            System.out.println("定时器执行。。。。。"+new Date().toLocaleString());
        }
    }
    
    spring定时器的配置:
    <!-- 定时任务配置 scheduler 方式 注解 暂时不支持动态更新 -->
        <context:component-scan base-package="org.jeecgframework.core.timer" />
        <context:component-scan base-package="com.jeecg.qywx.account.service" />
        <task:executor id="executor" pool-size="5" />
        <task:scheduler id="scheduler" pool-size="10" />
        <task:annotation-driven executor="executor"
            scheduler="scheduler" />
    cron表达式:
    //    @Scheduled(cron = "0 0 0/2 * * ?")        //每2小时执行一次    
    //    @Scheduled(cron = "0/10 * * * * ?")        //每10秒钟一次
        @Scheduled(cron = "0 0/10 * * * ?")        //每10分钟一次
    ================================================
    Json相关
    //对象字量量格式
    var obj = { name: "姓名", sex: 25 };
    //JSON对象格式
    var json = { "name": "姓名", "sex": "25" };
    //JSON字符串
    var json_string = '{"name":"姓名","sex":"25"}';
     
    //测试
    document.write(json_string.name) //结果:undefined,说明:不能访问JSON字符串里面的数据
             
    var string_to_json = JSON.parse(json_string);
    document.write(string_to_json.name) //结果:姓名,说明:把JSON字符串转换为JSON对象格式后可以访问数据
     
    var json_to_string = JSON.stringify(json);
    document.write(json_to_string); //结果:{"name":"姓名","sex":"25"} ,说明:把JSON对象转换成了字符串
    
    Json格式:
    {
        "obj": [
            {
                "name": "张三",
                "password": "hhhhhh",
                "age": 13
            },
            {
                "name": "张三",
                "password": "hhhhhh",
                "age": 13
            },
            {
                "name": "张三",
                "password": "hhhhhh",
                "age": 13
            }
        ]
    }
    ================================================
    自动增加元素事件中双引号中传参
    orderstr+="<a href='javascript:void(0);' onclick="initOrderStatus('"+A+B+"')">
    =================================================================================
    switch用法:
    String sign = map.get("conditions").toString();
            switch(sign) {
                case ">":
                    if(getDouble(map.get("indicatesize")) > getDouble(map.get("indicatorsnum"))) return map;break;
                case "<":
                    if(getDouble(map.get("indicatesize")) < getDouble(map.get("indicatorsnum"))) return map;break;
                case "=":
                    if(getDouble(map.get("indicatesize")) == getDouble(map.get("indicatorsnum"))) return map;break;
                case ">=":
                    if(getDouble(map.get("indicatesize")) >= getDouble(map.get("indicatorsnum"))) return map;break;
                case "<=":
                    if(getDouble(map.get("indicatesize")) <= getDouble(map.get("indicatorsnum"))) return map;break;
            }
            return null;
    =================================================================================================================================
    List遍历之前必须要做非空判断
    ==============================
    checkbox勾选
    $("#id").is(":checked")
    if($("#all").is(':checked'))
    ================================
    iframe中关闭弹出层代码:
    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    parent.layer.close(index); //再执行关闭
    
    parent.layer.closeAll();//关闭所有
    =======================================
    layer.open({
                 type : 2,
                 offset: '40px', // y, x
                 area : [ '550px', '400px' ],
                 shade: 0.6, //遮罩透明度
                 maxmin: true,//开启最大化最小化按钮
                 moveType: 1, //拖拽风格,0是默认,1是传统拖动
                 shift: 0, //0-6的动画形式,-1不开启
                 title : "告警通知详情",
                 scrollbar:false,
                 content : url,
                 end: function(){ //回调函数
                     //alert("ddddddd");
                 }
             });    
    
    ======================================
    子窗口刷新父窗口
    parent.location.reload();
    刷新当前创窗口:
    window.location.reload();
    ================================
    序列化表单参数
    var form = $("#propertyForm").serializeObject();
    var url = $("#propertyForm").attr("action");
            jQuery.ajax({
                  url: url,
                  async:true,
                  cache: false,
                  dataType: "json",
                  data:form,
                  method:"POST",
                  success: function(data){
                          if(data.success){
                            alert(data.msg);
                            location.reload();
                        }else{
                            alert(data.msg);
                            location.reload();
                        }    
                      }
                });
    
    ===================================
    在方法头上:
    @RequestMapping(params="doSave")
    
    在方法参数中:Mybatis的语法
    @Param("id") String id
    
    在controller方法中:请求参数
    @RequestParam(required = false, value = "pageNo", defaultValue = "1") int pageNo,
    
    文件上传输入流请求参数:
    @RequestParam(value = "file", required = false) MultipartFile file
    @RequestParam("file") CommonsMultipartFile file
    
    自动封装的实体
    @ModelAttribute AlarmInform query,
    ================================
    oracle当前系统时间
    to_char(sysdate,'yyyy-mm-dd hh24:mi:ss')
    to_date('2009-12-25 14:23:31','yyyy-mm-dd,hh24:mi:ss')
    to_date('2009-12-25 14:23:31','yyyy-mm-dd,hh:mi:ss')
    
    =================================================
    layer.msg(‘提示‘, 2, 1, function(){})
     
    第一个参数:提示
    第二个参数:自动关闭时间
    第三个参数:图标类型
    第四个参数:msg关闭后执行的回调
    ======================================
    刷新本页:
    window.location.replace();
    window.location.reload();
    =====================================
    新增后重定向bug:
    新增记录后,重定向回来页面
    再删除一条,location.reload(),之前的那条回重新新增。原因:request域带着参数
    ===========================================================================
    模态框:除了本框,不能点击其他
    飞模态框:可任意切换
    ================================
    js获取上传文件大小:
    document.getElementById("file1").files[0].size > 1024*1024
    
    ============================================================
    js定时器:
    var pg = document.getElementById("pg");
    setInterval(function(){
    if(pg.value!=100) pg.value+=10;
          else pg.value=0;
    
    }, 1000);
    
    
    function getA(){}
    setInterval('getA()',1000);
    setTimeout("reFresh()",30*60*1000+1000);
    ====================================================
    log4j
    
    private static final Logger logger = Logger.getLogger(HiberAspect.class);
    logger.warn("");
    logger.debug("");
    logger.error("");
    
    ================================
    var fd = new FormData(表单对象);
    
    ================================
    Properties prop = new Properties();    
    prop.load(inStream); //文件输入流   
    String key = prop.getProperty("username");
    
    =================================================
    //镇压类型警告
    @SuppressWarnings("rawtypes")
  • 相关阅读:
    jq元素拖拽
    路径中取文件名
    HBase相关问题
    HBase数据模型
    HBase安装过程
    HBase物理模型
    Hadoop性能调优
    Hive性能调优
    Hadoop资源调度器
    Hive的执行生命周期
  • 原文地址:https://www.cnblogs.com/Jonecmnn/p/7357046.html
Copyright © 2011-2022 走看看