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

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

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

    隨筆-8  評論-31  文章-0  trackbacks-0
      2006年10月24日
    我在Run Nutch的時候出現這樣的錯誤 -

    08/07/07 04:05:41 INFO conf.Configuration: found resource crawl-urlfilter.txt at file:/home/hut/installfiles/nutch-0.9/out/production/nutch-0.9/crawl-urlfilter.txt
    08/07/07 04:05:41 INFO conf.Configuration: found resource parse-plugins.xml at file:/home/hut/installfiles/nutch-0.9/out/production/nutch-0.9/parse-plugins.xml
    08/07/07 04:05:41 INFO fetcher.Fetcher: fetching http://www.yale.edu/
    08/07/07 04:05:41 INFO fetcher.Fetcher: fetching http://www.harvard.edu/
    08/07/07 04:05:41 INFO fetcher.Fetcher: fetch of http://www.harvard.edu/ failed with: org.apache.nutch.protocol.ProtocolNotFound: protocol not found for url=http
    08/07/07 04:05:41 INFO fetcher.Fetcher: fetch of http://www.yale.edu/ failed with: org.apache.nutch.protocol.ProtocolNotFound: protocol not found for url=http

    解決方法:nutch-site.xml
        <property>
            
    <name>plugin.includes</name>
            
    <value>
                nutch-extensionpoints|
    protocol-http|urlfilter-regex|parse-(text|html|js)|index-basic|query-(basic|site|url)|summary-basic|scoring-opic|urlnormalizer-(pass|regex|basic)
            
    </value>
            
    <description>Regular expression naming plugin directory names to
                include. Any plugin not matching 
    this expression is excluded.
                In any 
    case you need at least include the nutch-extensionpoints plugin. By
                
    default Nutch includes crawling just HTML and plain text via HTTP,
                and basic indexing and search plugins. In order to use HTTPS please enable
                protocol
    -httpclient, but be aware of possible intermittent problems with the
                underlying commons
    -httpclient library.
            
    </description>
        
    </property>

    nutch-extensionpoints|被我錯誤的刪除了,還原以后一切工作正常. 默認情況下nutch0.9的目錄結構中并沒有plugin.includes這個properties, 它會載入nutch-default.xml里面的plugin.includes所以定義的所有的plugin. 在nutch-site.xml編輯/加入 plugin.includes properties的目的是為了加入我們自己的plugin而覆蓋nutch-default.xml定義的.
    posted @ 2008-07-10 11:38 自己的小屋 閱讀(2335) | 評論 (0)編輯 收藏
    Nutch0.9 Crawl在Run的時候,有時候會出現 -


    java.lang.ArrayIndexOutOfBoundsException: -1

    at org.apache.lucene.index.MultiReader.isDeleted(MultiReader.java:
    113)

    at org.apache.nutch.indexer.DeleteDuplicates$InputFormat$DDRecordReader.next(DeleteDuplicates.java:
    176)

    at org.apache.hadoop.mapred.MapTask$
    1.next(MapTask.java:157)

    at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:
    46)

    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:
    175)

    at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:
    126)

    Exception in thread 
    "main" java.io.IOException: Job failed!

    at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:
    604)

    at org.apache.nutch.indexer.DeleteDuplicates.dedup(DeleteDuplicates.java:
    439)

    at org.apache.nutch.crawl.Crawl.main(Crawl.java:
    135)

    問題的解決方法:

    https://issues.apache.org/jira/browse/NUTCH-525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515955



    posted @ 2008-07-10 11:32 自己的小屋 閱讀(611) | 評論 (0)編輯 收藏
    那是2007年三月二日,我發了<定位Java類中的每個方法在類文件中的位置>
    引起了幾個大蝦的注意并且給我指點,當時看了以后也沒有怎么弄,也不知道怎么弄.

    這是cape給我的建議:

    最直接的辦法應該是分析class的bytecode,找到每個Method_info->Code Attribute->LineNumberTable Attribute

    今天空閑得慌而是我拿這個method linenumber幾個keyword在網上狂搜了一把,
    http://www.ibm.com/developerworks/cn/java/j-dyn0302/index.html

    得到美文一篇,用Javassist來做. Javassist是一個專門操控java class的bytecode的類,可以動態的改變其狀態,我沒有深究它到底有多大的能耐,有興趣可以去它的官方網站看看,

    http://www.csg.is.titech.ac.jp/~chiba/javassist/

    但是它確實可以象cape指點的那樣,讓我實現對java類中的每個方法的定位(得到類中的某個方法的lineRange)

    而是我就隨便翻了幾個例子以后根據在線文檔寫了不到100行代碼輕松搞定。:) 我高興啊。

    干這個事情的兩個java的source code可以從這里得到:

    http://m.tkk7.com/Files/xmp123/MethodParser.zip

    代碼很簡單,我就不解釋代碼了。

    這是示例結果:
    ------------------------------------------------------------------------------------------------------------------------------
    Analyzing net.blogjava.xmp123.MyMethodInfo ...
    net.blogjava.xmp123.MyMethodInfo.getLineList() locate between 56 and 56

    net.blogjava.xmp123.MyMethodInfo.updateLineList() locate between 63 and 80

    net.blogjava.xmp123.MyMethodInfo.addLineToLineList(int) locate between 87 and 89

    net.blogjava.xmp123.MyMethodInfo.setLineList(java.util.List) locate between 95 and 97
    ...
    ------------------------------------------------------------------------------------------------------------------------------

    希望這東西有用......
    posted @ 2007-08-15 17:56 自己的小屋 閱讀(1138) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2007-03-12 15:40 自己的小屋 閱讀(2260) | 評論 (9)編輯 收藏
    應該說一般的數據庫都有BackUp的需求, MySql備份數據庫的方式很簡單, 但是在網上說得云里霧里, 也應該是我對MySql數據庫不熟悉.
    ?
    目標(Target) : 將本機中的mysql數據庫備份到本機中的mydatabase數據庫中 - 也就是完全的Copy一個數據庫.
    ?
    #1. C:\Program Files\MySQL\MySQL Server 5.0\bin>mysqldump -u root -p mysql>backup_database.sql
    ??? Enter password: ******** (你的root帳戶的密碼)
    ?
    完成以后, 在路徑C:\Program Files\MySQL\MySQL Server 5.0\bin下面就有個backup_database.sql的數據庫文件產生,
    ?
    #2. root登陸Mysql的Client, 建立目標數據庫mydatabase,
    ?
    #3. C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -u root -p yourdatabase<backup_database.sql
    ????Enter password: ******** (你的root帳戶的密碼)
    ?
    #4. Completed, (登陸到mysql的Client,用show tables命令檢查yourdatabase里面的結構和表是不是和mysql數據庫中的結構和表一模一樣.
    ?
    Thanks,
    ?
    -Wanglinghua
    posted @ 2007-03-02 09:07 自己的小屋 閱讀(9178) | 評論 (11)編輯 收藏

    這東西比較有用:[轉載].出處:http://mike20049.spaces.live.com/mmm2006-09-13_01.00/
    我收藏啦.:)
    import java.io.*;

    public class FileOperate {
    ? public FileOperate() {
    ? }

    ? /**
    ?? * 新建目錄
    ?? * @param folderPath String 如 c:/fqf
    ?? * @return boolean
    ?? */
    ? public void newFolder(String folderPath) {
    ??? try {
    ????? String filePath = folderPath;
    ????? filePath = filePath.toString();
    ????? java.io.File myFilePath = new java.io.File(filePath);
    ????? if (!myFilePath.exists()) {
    ??????? myFilePath.mkdir();
    ????? }
    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("新建目錄操作出錯");
    ????? e.printStackTrace();
    ??? }
    ? }

    ? /**
    ?? * 新建文件
    ?? * @param filePathAndName String 文件路徑及名稱 如c:/fqf.txt
    ?? * @param fileContent String 文件內容
    ?? * @return boolean
    ?? */
    ? public void newFile(String filePathAndName, String fileContent) {

    ??? try {
    ????? String filePath = filePathAndName;
    ????? filePath = filePath.toString();
    ????? File myFilePath = new File(filePath);
    ????? if (!myFilePath.exists()) {
    ??????? myFilePath.createNewFile();
    ????? }
    ????? FileWriter resultFile = new FileWriter(myFilePath);
    ????? PrintWriter myFile = new PrintWriter(resultFile);
    ????? String strContent = fileContent;
    ????? myFile.println(strContent);
    ????? resultFile.close();

    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("新建目錄操作出錯");
    ????? e.printStackTrace();

    ??? }

    ? }

    ? /**
    ?? * 刪除文件
    ?? * @param filePathAndName String 文件路徑及名稱 如c:/fqf.txt
    ?? * @param fileContent String
    ?? * @return boolean
    ?? */
    ? public void delFile(String filePathAndName) {
    ??? try {
    ????? String filePath = filePathAndName;
    ????? filePath = filePath.toString();
    ????? java.io.File myDelFile = new java.io.File(filePath);
    ????? myDelFile.delete();

    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("刪除文件操作出錯");
    ????? e.printStackTrace();

    ??? }

    ? }

    ? /**
    ?? * 刪除文件夾
    ?? * @param filePathAndName String 文件夾路徑及名稱 如c:/fqf
    ?? * @param fileContent String
    ?? * @return boolean
    ?? */
    ? public void delFolder(String folderPath) {
    ??? try {
    ????? delAllFile(folderPath); //刪除完里面所有內容
    ????? String filePath = folderPath;
    ????? filePath = filePath.toString();
    ????? java.io.File myFilePath = new java.io.File(filePath);
    ????? myFilePath.delete(); //刪除空文件夾

    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("刪除文件夾操作出錯");
    ????? e.printStackTrace();

    ??? }

    ? }

    ? /**
    ?? * 刪除文件夾里面的所有文件
    ?? * @param path String 文件夾路徑 如 c:/fqf
    ?? */
    ? public void delAllFile(String path) {
    ??? File file = new File(path);
    ??? if (!file.exists()) {
    ????? return;
    ??? }
    ??? if (!file.isDirectory()) {
    ????? return;
    ??? }
    ??? String[] tempList = file.list();
    ??? File temp = null;
    ??? for (int i = 0; i < tempList.length; i++) {
    ????? if (path.endsWith(File.separator)) {
    ??????? temp = new File(path + tempList[i]);
    ????? }
    ????? else {
    ??????? temp = new File(path + File.separator + tempList[i]);
    ????? }
    ????? if (temp.isFile()) {
    ??????? temp.delete();
    ????? }
    ????? if (temp.isDirectory()) {
    ??????? delAllFile(path+"/"+ tempList[i]);//先刪除文件夾里面的文件
    ??????? delFolder(path+"/"+ tempList[i]);//再刪除空文件夾
    ????? }
    ??? }
    ? }

    ? /**
    ?? * 復制單個文件
    ?? * @param oldPath String 原文件路徑 如:c:/fqf.txt
    ?? * @param newPath String 復制后路徑 如:f:/fqf.txt
    ?? * @return boolean
    ?? */
    ? public void copyFile(String oldPath, String newPath) {
    ??? try {
    ????? int bytesum = 0;
    ????? int byteread = 0;
    ????? File oldfile = new File(oldPath);
    ????? if (oldfile.exists()) { //文件存在時
    ??????? InputStream inStream = new FileInputStream(oldPath); //讀入原文件
    ??????? FileOutputStream fs = new FileOutputStream(newPath);
    ??????? byte[] buffer = new byte[1444];
    ??????? int length;
    ??????? while ( (byteread = inStream.read(buffer)) != -1) {
    ????????? bytesum += byteread; //字節數 文件大小
    ????????? System.out.println(bytesum);
    ????????? fs.write(buffer, 0, byteread);
    ??????? }
    ??????? inStream.close();
    ????? }
    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("復制單個文件操作出錯");
    ????? e.printStackTrace();

    ??? }

    ? }

    ? /**
    ?? * 復制整個文件夾內容
    ?? * @param oldPath String 原文件路徑 如:c:/fqf
    ?? * @param newPath String 復制后路徑 如:f:/fqf/ff
    ?? * @return boolean
    ?? */
    ? public void copyFolder(String oldPath, String newPath) {

    ??? try {
    ????? (new File(newPath)).mkdirs(); //如果文件夾不存在 則建立新文件夾
    ????? File a=new File(oldPath);
    ????? String[] file=a.list();
    ????? File temp=null;
    ????? for (int i = 0; i < file.length; i++) {
    ??????? if(oldPath.endsWith(File.separator)){
    ????????? temp=new File(oldPath+file[i]);
    ??????? }
    ??????? else{
    ????????? temp=new File(oldPath+File.separator+file[i]);
    ??????? }

    ??????? if(temp.isFile()){
    ????????? FileInputStream input = new FileInputStream(temp);
    ????????? FileOutputStream output = new FileOutputStream(newPath + "/" +
    ????????????? (temp.getName()).toString());
    ????????? byte[] b = new byte[1024 * 5];
    ????????? int len;
    ????????? while ( (len = input.read(b)) != -1) {
    ??????????? output.write(b, 0, len);
    ????????? }
    ????????? output.flush();
    ????????? output.close();
    ????????? input.close();
    ??????? }
    ??????? if(temp.isDirectory()){//如果是子文件夾
    ????????? copyFolder(oldPath+"/"+file[i],newPath+"/"+file[i]);
    ??????? }
    ????? }
    ??? }
    ??? catch (Exception e) {
    ????? System.out.println("復制整個文件夾內容操作出錯");
    ????? e.printStackTrace();

    ??? }

    ? }

    ? /**
    ?? * 移動文件到指定目錄
    ?? * @param oldPath String 如:c:/fqf.txt
    ?? * @param newPath String 如:d:/fqf.txt
    ?? */
    ? public void moveFile(String oldPath, String newPath) {
    ??? copyFile(oldPath, newPath);
    ??? delFile(oldPath);

    ? }

    ? /**
    ?? * 移動文件到指定目錄
    ?? * @param oldPath String 如:c:/fqf.txt
    ?? * @param newPath String 如:d:/fqf.txt
    ?? */
    ? public void moveFolder(String oldPath, String newPath) {
    ??? copyFolder(oldPath, newPath);
    ??? delFolder(oldPath);

    ? }
    }

    posted @ 2006-10-24 11:02 自己的小屋 閱讀(873) | 評論 (0)編輯 收藏
    主站蜘蛛池模板: 91频在线观看免费大全| 精品免费久久久久久成人影院| 亚洲国产一区在线观看| 日韩一区二区在线免费观看 | 亚洲日韩看片无码电影| 亚洲国产成人久久一区久久| 另类免费视频一区二区在线观看 | 一级特黄录像免费播放肥| 亚洲黄色在线电影| 日本一区二区三区日本免费| 好男人资源在线WWW免费| 色老板亚洲视频免在线观| 亚洲综合色视频在线观看| 无码日韩精品一区二区免费| eeuss影院www天堂免费| 亚洲精品亚洲人成在线播放| 亚洲一区二区三区香蕉| 午夜网站免费版在线观看| 免费人成黄页在线观看日本| 男性gay黄免费网站| 亚洲精品美女视频| 亚洲自偷自偷图片| 日本黄页网站免费| 成人免费在线看片| 国产免费阿v精品视频网址| 老司机亚洲精品影院在线观看| 久久久无码精品亚洲日韩蜜臀浪潮| 在线a亚洲v天堂网2018| 操美女视频免费网站| 一级毛片免费播放| a级大片免费观看| 无码日韩人妻AV一区免费l| 亚洲欧洲AV无码专区| 亚洲精品国产福利在线观看| 国内精品久久久久久久亚洲| 在线观看国产情趣免费视频| 成年免费大片黄在线观看岛国| 无码午夜成人1000部免费视频| 国产va免费精品| 免费国产黄网站在线观看动图| 亚洲一卡2卡3卡4卡5卡6卡|