随笔-26  评论-111  文章-19  trackbacks-0
  2008年12月15日
在Window下启动Hadoop-0.21.0版本时,会出现下面这样的错误提示:

 1 java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
 2 Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
 3 
 4         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 5         at java.security.AccessController.doPrivileged(Native Method)
 6         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
 7         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
 8         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
 9         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
10 Could not find the main class: org.apache.hadoop.util.PlatformName.  Program wil
11 l exit.

经过不断的查找原因和尝试,终于有了解决这个错误的办法,只需要将${HADOOP_HOME}/bin/hadoop-config.sh文件中的第190行的一下的内容

JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m ${HADOOP_JAVA_PLATFORM_OPTS} org.apache.hadoop.util.PlatformName | sed -"s/ /_/g"`


修改成以下的内容即可

JAVA_PLATFORM=`CLASSPATH=${CLASSPATH} ${JAVA} -Xmx32m -classpath ${HADOOP_COMMON_HOME}/hadoop-common-0.21.0.jar org.apache.hadoop.util.PlatformName | sed -"s/ /_/g"`


posted @ 2010-09-29 17:03 snoics 阅读(12307) | 评论 (7)编辑 收藏
    下载地址:http://code.google.com/p/snoics-retrieval/

    版本更新说明

V1.01

                1、提高创建索引的效率

         2、通过对象池管理IndexWriterIndexReader对象

         3、修正若干BUG

V1.0

         初始版本



基于Lucene的全文检索框架,提供快速方便的索引创建及查询方式,并提供扩展功能对框架进行扩展。

    项目地址:http://code.google.com/p/snoics-retrieval/

    

   环境要求

Java1.5+

Lucene 3.0+



posted @ 2010-09-28 16:33 snoics 阅读(2376) | 评论 (1)编辑 收藏


做了一些小的修改和调整

基于Lucene的全文检索框架,提供快速方便的索引创建及查询方式,并提供扩展功能对框架进行扩展。

    项目地址:http://code.google.com/p/snoics-retrieval/

    

环境要求

Java1.5+

Lucene 3.0+

posted @ 2010-08-18 15:00 snoics 阅读(2065) | 评论 (0)编辑 收藏
     摘要:        对四则运算表达式字符串进行解析后计算出结果,可以使用逆波兰表达式进行处理。        首先说明一下什是逆波兰表达式:         逆波兰表达式又叫做后缀表达...  阅读全文
posted @ 2010-07-29 17:44 snoics 阅读(3369) | 评论 (2)编辑 收藏
     摘要:         基于自己的兴趣,利用业务时间在Lucene基础上做的一个搜索框架,请大家多多指教。 一、        介绍 基于Lucene的全文检索框架,提供快速方便的索引创建及查询方式,并提供扩展功能对框架进行扩展。  &nbs...  阅读全文
posted @ 2010-07-26 08:06 snoics 阅读(2738) | 评论 (0)编辑 收藏
    Myeclipse 7 的插件安装方式与原先的方式完全不一样了,下面以JBossTools-2.1.2.GA插件安装为例进行说明。

    假设
            Myeclipse 7的安装路径为:C:\Genuitec
            JBossTools-2.1.2.GA插件的路径为:  C:\eclipse-plugins\plugins\JBossTools-2.1.2.GA-ALL-win32

    将下面这段代码编译后执行:

    
 1package test;
 2
 3import java.io.File;
 4import java.util.ArrayList;
 5import java.util.List;
 6
 7
 8/**
 9 * Descript: 
10 *
11 *
12 */

13
14public class CreatePluginsConfig {
15    private String path;
16    
17    public CreatePluginsConfig(String path){
18        this.path=path;
19    }

20    
21    public void print(){
22        List list=getFileList(path);
23        if(list==null){
24            return;
25        }

26        
27        int length=list.size();
28        for(int i=0;i<length;i++){
29            String result="";
30            String thePath=getFormatPath(getString(list.get(i)));
31            File file=new File(thePath);
32            if(file.isDirectory()){
33                String fileName=file.getName();
34                if(fileName.indexOf("_")<0){
35                    continue;
36                }

37                String[] filenames=fileName.split("_");
38                String filename1=filenames[0];
39                String filename2=filenames[1];
40                result=filename1+","+filename2+",file:/"+path+"\\"+fileName+"\\,4,false";
41                System.out.println(result);
42            }
else if(file.isFile()){
43                String fileName=file.getName();
44                if(fileName.indexOf("_")<0){
45                    continue;
46                }

47                String[] filenames=fileName.split("_");
48                String filename1=filenames[0];
49                String filename2=filenames[1].substring(0, filenames[1].lastIndexOf("."));
50                result=filename1+","+filename2+",file:/"+path+"\\"+fileName+",4,false";
51                System.out.println(result);
52            }

53            
54        }

55    }

56    
57    public List getFileList(String path){
58        path=getFormatPath(path);
59        path=path+"/";
60        File filePath=new File(path);
61        if(!filePath.isDirectory()){
62            return null;
63        }

64        String[] filelist=filePath.list();
65        List filelistFilter=new ArrayList();
66
67        for(int i=0;i<filelist.length;i++){
68            String tempfilename=getFormatPath(path+filelist[i]);
69            filelistFilter.add(tempfilename);
70        }

71        return filelistFilter;
72    }

73    
74    public String getString(Object object){
75        if(object==null){
76            return "";
77        }

78        return String.valueOf(object);
79    }

80    
81    public String getFormatPath(String path) {
82        path = path.replaceAll("\\\\""/");
83        path = path.replaceAll("//""/");
84        return path;
85    }

86    
87    public static void main(String[] args){
88        new CreatePluginsConfig("C:\\eclipse-plugins\\plugins\\JBossTools-2.1.2.GA-ALL-win32\\eclipse\\plugins").print();
89    }

90}
    
    执行完之后,将控制台中打印出的执行结果,直接复制到下面这个文件中:

    C:\Genuitec\MyEclipse 7.0\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info

    然后用 -clean 命令重新启动Myeclipse即了完成插件的安装。
    
posted @ 2008-12-15 13:41 snoics 阅读(8437) | 评论 (13)编辑 收藏